diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-30 22:12:53 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-30 22:12:53 +0200 |
commit | b8e6315292839cd8a3263fec9d69555b7202c781 (patch) | |
tree | 46af79fff094bb39528e13770ed298aa9bfbc585 /dom | |
parent | d45c25971c084ba4afb38cec530f789969d6a338 (diff) | |
download | UXP-b8e6315292839cd8a3263fec9d69555b7202c781.tar UXP-b8e6315292839cd8a3263fec9d69555b7202c781.tar.gz UXP-b8e6315292839cd8a3263fec9d69555b7202c781.tar.lz UXP-b8e6315292839cd8a3263fec9d69555b7202c781.tar.xz UXP-b8e6315292839cd8a3263fec9d69555b7202c781.zip |
Bug 1182569: Update tests when converting docshell loads to use AynscOpen2
Diffstat (limited to 'dom')
-rw-r--r-- | dom/base/test/file_simplecontentpolicy.js | 1 | ||||
-rw-r--r-- | dom/plugins/test/mochitest/test_bug813906.html | 22 |
2 files changed, 18 insertions, 5 deletions
diff --git a/dom/base/test/file_simplecontentpolicy.js b/dom/base/test/file_simplecontentpolicy.js index 1f9606c49..2727b9530 100644 --- a/dom/base/test/file_simplecontentpolicy.js +++ b/dom/base/test/file_simplecontentpolicy.js @@ -39,7 +39,6 @@ var policy = { { // Remember last content type seen for the test url if (contentLocation.spec.endsWith(urlSuffix)) { - assert.ok(frame === browserElement, "correct <browser> element"); sendAsyncMessage("shouldLoad", {contentType: contentType, isTopLevel: isTopLevel}); return Ci.nsIContentPolicy.REJECT_REQUEST; } diff --git a/dom/plugins/test/mochitest/test_bug813906.html b/dom/plugins/test/mochitest/test_bug813906.html index 04c34daaf..d18dbbff2 100644 --- a/dom/plugins/test/mochitest/test_bug813906.html +++ b/dom/plugins/test/mochitest/test_bug813906.html @@ -18,21 +18,35 @@ function f() { </script> <script type="application/javascript"> +SimpleTest.requestFlakyTimeout( + "Blocking an iframe does not cause the onerror event to be fired"); + SimpleTest.waitForExplicitFinish(); setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED); var frameLoadCount = 0; + +function frameNavBlocked() { + isnot(SpecialPowers.wrap(window.frame1).location.href.indexOf('chrome://'), + 0, 'plugin shouldnt be able to cause navigation to chrome URLs'); + SimpleTest.finish(); +} + function frameLoaded() { frameLoadCount++; if (frameLoadCount == 1) { document.getElementsByTagName("object")[0].type = "application/x-test"; document.getElementsByTagName("use")[0].setAttributeNS("http://www.w3.org/1999/xlink", "href", location.href + "#a"); - } else if (frameLoadCount == 2) { - isnot(SpecialPowers.wrap(window.frame1).location.href.indexOf('chrome://'), - 0, 'plugin shouldnt be able to cause navigation to chrome URLs'); - SimpleTest.finish(); + + // wait two seconds and verify that frame navigation did not succeed + setTimeout(frameNavBlocked, 2000); + return; } + // we should never get here, but just in case, make sure the test fails in that case. + ok(false, "onload() event should not fire for blocked navigation"); + SimpleTest.finish(); } + </script> <!-- Note that <svg:use> ends up creating an anonymous subtree, which means that the plugin |