From 2e013ffb3ed4fa69e8df6b9ca4be264830458884 Mon Sep 17 00:00:00 2001 From: "Callek%gmail.com" Date: Fri, 14 Mar 2008 05:46:45 +0000 Subject: [PATCH] Bug 422872, fix test in test_contentAreaUtils.js for both suite and toolkit. r=sayrer git-svn-id: svn://10.0.0.236/trunk@247799 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/suite/common/tests/unit/test_contentAreaUtils.js | 9 +++++++-- .../toolkit/content/tests/unit/test_contentAreaUtils.js | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/mozilla/suite/common/tests/unit/test_contentAreaUtils.js b/mozilla/suite/common/tests/unit/test_contentAreaUtils.js index 980e0d9d8f8..264a4ae09a2 100644 --- a/mozilla/suite/common/tests/unit/test_contentAreaUtils.js +++ b/mozilla/suite/common/tests/unit/test_contentAreaUtils.js @@ -71,14 +71,19 @@ function test_urlSecurityCheck() { do_throw("urlSecurityCheck failed to handle the http URI as a string (uri spec)"); } + let shouldThrow = true; try { urlSecurityCheck(CHROME_URI, nullPrincipal, DISALLOW_INHERIT_PRINCIPAL); - do_throw("urlSecurityCheck should throw when linking to a chrome uri with a null principal"); } - catch(ex) { } + catch(ex) { + shouldThrow = false; + } + if (shouldThrow) + do_throw("urlSecurityCheck should throw when linking to a chrome uri with a null principal"); } + function run_test() { loadUtilsScript(); diff --git a/mozilla/toolkit/content/tests/unit/test_contentAreaUtils.js b/mozilla/toolkit/content/tests/unit/test_contentAreaUtils.js index abd501f17d1..d337a443168 100644 --- a/mozilla/toolkit/content/tests/unit/test_contentAreaUtils.js +++ b/mozilla/toolkit/content/tests/unit/test_contentAreaUtils.js @@ -71,14 +71,19 @@ function test_urlSecurityCheck() { do_throw("urlSecurityCheck failed to handle the http URI as a string (uri spec)"); } + let shouldThrow = true; try { urlSecurityCheck(CHROME_URI, nullPrincipal, DISALLOW_INHERIT_PRINCIPAL); - do_throw("urlSecurityCheck should throw when linking to a chrome uri with a null principal"); } - catch(ex) { } + catch(ex) { + shouldThrow = false; + } + if (shouldThrow) + do_throw("urlSecurityCheck should throw when linking to a chrome uri with a null principal"); } + function run_test() { loadUtilsScript();