Revert "Bug 1182569: Update tests when converting docshell loads to use AynscOpen2"

This reverts commit b73225e886f84182384a2b5b09f83e51501bdc38.
This commit is contained in:
janekptacijarabaci 2018-04-22 22:16:35 +02:00 committed by Roy Tam
commit 9faac1b961
2 changed files with 5 additions and 18 deletions

View file

@ -39,6 +39,7 @@ var policy = {
{ {
// Remember last content type seen for the test url // Remember last content type seen for the test url
if (contentLocation.spec.endsWith(urlSuffix)) { if (contentLocation.spec.endsWith(urlSuffix)) {
assert.ok(frame === browserElement, "correct <browser> element");
sendAsyncMessage("shouldLoad", {contentType: contentType, isTopLevel: isTopLevel}); sendAsyncMessage("shouldLoad", {contentType: contentType, isTopLevel: isTopLevel});
return Ci.nsIContentPolicy.REJECT_REQUEST; return Ci.nsIContentPolicy.REJECT_REQUEST;
} }

View file

@ -18,35 +18,21 @@ function f() {
</script> </script>
<script type="application/javascript"> <script type="application/javascript">
SimpleTest.requestFlakyTimeout(
"Blocking an iframe does not cause the onerror event to be fired");
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED); setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var frameLoadCount = 0; 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() { function frameLoaded() {
frameLoadCount++; frameLoadCount++;
if (frameLoadCount == 1) { if (frameLoadCount == 1) {
document.getElementsByTagName("object")[0].type = "application/x-test"; document.getElementsByTagName("object")[0].type = "application/x-test";
document.getElementsByTagName("use")[0].setAttributeNS("http://www.w3.org/1999/xlink", "href", location.href + "#a"); document.getElementsByTagName("use")[0].setAttributeNS("http://www.w3.org/1999/xlink", "href", location.href + "#a");
} else if (frameLoadCount == 2) {
// wait two seconds and verify that frame navigation did not succeed isnot(SpecialPowers.wrap(window.frame1).location.href.indexOf('chrome://'),
setTimeout(frameNavBlocked, 2000); 0, 'plugin shouldnt be able to cause navigation to chrome URLs');
return; SimpleTest.finish();
} }
// 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> </script>
<!-- Note that <svg:use> ends up creating an anonymous subtree, which means that the plugin <!-- Note that <svg:use> ends up creating an anonymous subtree, which means that the plugin