diff --git a/suite/common/tests/unit/test_contentAreaUtils.js b/suite/common/tests/unit/test_contentAreaUtils.js index 980e0d9d8f8..264a4ae09a2 100644 --- a/suite/common/tests/unit/test_contentAreaUtils.js +++ b/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/toolkit/content/tests/unit/test_contentAreaUtils.js b/toolkit/content/tests/unit/test_contentAreaUtils.js index abd501f17d1..d337a443168 100644 --- a/toolkit/content/tests/unit/test_contentAreaUtils.js +++ b/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();