diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-05-01 09:53:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-01 09:53:46 +0200 |
commit | ae45e61da06ba989fcbb856183d9578d4d4f51ed (patch) | |
tree | 5c7dea17ce684c1cce57011ef487370c22d0e677 /dom/plugins/test | |
parent | fefce8f7ccbc476cfc46e61b01eff069346d3c73 (diff) | |
parent | cc4036a9cd56d504667c07fe215e61b22ab0e1f4 (diff) | |
download | UXP-ae45e61da06ba989fcbb856183d9578d4d4f51ed.tar UXP-ae45e61da06ba989fcbb856183d9578d4d4f51ed.tar.gz UXP-ae45e61da06ba989fcbb856183d9578d4d4f51ed.tar.lz UXP-ae45e61da06ba989fcbb856183d9578d4d4f51ed.tar.xz UXP-ae45e61da06ba989fcbb856183d9578d4d4f51ed.zip |
Merge pull request #311 from janekptacijarabaci/security_blocking_data_2
Use asyncOpen2() for docshell loads
Diffstat (limited to 'dom/plugins/test')
-rw-r--r-- | dom/plugins/test/mochitest/test_bug813906.html | 22 |
1 files changed, 18 insertions, 4 deletions
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 |