gecko-dev/dom/security/test/mixedcontentblocker/file_frameNavigation_grandc...

58 строки
1.9 KiB
HTML
Исходник Обычный вид История

<!DOCTYPE HTML>
<html>
<!--
Tests for Mixed Content Blocker - Navigating Grandchild frames when a secure parent doesn't exist
https://bugzilla.mozilla.org/show_bug.cgi?id=840388
-->
<head>
<meta charset="utf-8">
<title>Tests for Mixed Content Frame Navigation</title>
</head>
<body>
Bug 1117650 - Part 2: Move all MixedContent tests into dom/security/test. r=tanvi --HG-- rename : dom/base/test/mixedcontentblocker/bug803225_test_mailto.html => dom/security/test/mixedcontentblocker/file_bug803225_test_mailto.html rename : dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation.html => dom/security/test/mixedcontentblocker/file_frameNavigation.html rename : dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation_blankTarget.html => dom/security/test/mixedcontentblocker/file_frameNavigation_blankTarget.html rename : dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation_grandchild.html => dom/security/test/mixedcontentblocker/file_frameNavigation_grandchild.html rename : dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation_innermost.html => dom/security/test/mixedcontentblocker/file_frameNavigation_innermost.html rename : dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation_secure.html => dom/security/test/mixedcontentblocker/file_frameNavigation_secure.html rename : dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation_secure_grandchild.html => dom/security/test/mixedcontentblocker/file_frameNavigation_secure_grandchild.html rename : dom/base/test/mixedcontentblocker/file_mixed_content_main.html => dom/security/test/mixedcontentblocker/file_main.html rename : dom/base/test/mixedcontentblocker/file_mixed_content_main_bug803225.html => dom/security/test/mixedcontentblocker/file_main_bug803225.html rename : dom/base/test/mixedcontentblocker/file_mixed_content_main_bug803225_websocket_wsh.py => dom/security/test/mixedcontentblocker/file_main_bug803225_websocket_wsh.py rename : dom/base/test/mixedcontentblocker/file_mixed_content_server.sjs => dom/security/test/mixedcontentblocker/file_server.sjs rename : dom/base/test/mixedcontentblocker/mochitest.ini => dom/security/test/mixedcontentblocker/mochitest.ini rename : dom/base/test/mixedcontentblocker/test_mixed_content_blocker_bug803225.html => dom/security/test/mixedcontentblocker/test_bug803225.html rename : dom/base/test/mixedcontentblocker/test_mixed_content_blocker_frameNavigation.html => dom/security/test/mixedcontentblocker/test_frameNavigation.html rename : dom/base/test/mixedcontentblocker/test_mixed_content_blocker.html => dom/security/test/mixedcontentblocker/test_main.html extra : rebase_source : ea9c355fb48d4c42d31135733f9904e510713edc
2015-06-09 02:21:43 +03:00
<iframe src="https://example.com/tests/dom/security/test/mixedcontentblocker/file_frameNavigation_innermost.html?insecurePage_navigate_grandchild" id="child"></iframe>
<script>
// For tests that require setTimeout, set the maximum polling time to 100 x 100ms = 10 seconds.
var MAX_COUNT = 50;
var TIMEOUT_INTERVAL = 100;
var counter = 0;
var child = document.getElementById("child");
function navigationStatus(child)
{
// When the page is navigating, it goes through about:blank and we will get a permission denied for loc.
// Catch that specific exception and return
try {
var loc;
if (child.contentDocument) {
loc = child.contentDocument.location;
}
} catch(e) {
if (e.message && e.message.indexOf("Permission denied to access property") == -1) {
// We received an exception we didn't expect.
throw e;
}
counter++;
return;
}
Bug 1117650 - Part 2: Move all MixedContent tests into dom/security/test. r=tanvi --HG-- rename : dom/base/test/mixedcontentblocker/bug803225_test_mailto.html => dom/security/test/mixedcontentblocker/file_bug803225_test_mailto.html rename : dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation.html => dom/security/test/mixedcontentblocker/file_frameNavigation.html rename : dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation_blankTarget.html => dom/security/test/mixedcontentblocker/file_frameNavigation_blankTarget.html rename : dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation_grandchild.html => dom/security/test/mixedcontentblocker/file_frameNavigation_grandchild.html rename : dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation_innermost.html => dom/security/test/mixedcontentblocker/file_frameNavigation_innermost.html rename : dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation_secure.html => dom/security/test/mixedcontentblocker/file_frameNavigation_secure.html rename : dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation_secure_grandchild.html => dom/security/test/mixedcontentblocker/file_frameNavigation_secure_grandchild.html rename : dom/base/test/mixedcontentblocker/file_mixed_content_main.html => dom/security/test/mixedcontentblocker/file_main.html rename : dom/base/test/mixedcontentblocker/file_mixed_content_main_bug803225.html => dom/security/test/mixedcontentblocker/file_main_bug803225.html rename : dom/base/test/mixedcontentblocker/file_mixed_content_main_bug803225_websocket_wsh.py => dom/security/test/mixedcontentblocker/file_main_bug803225_websocket_wsh.py rename : dom/base/test/mixedcontentblocker/file_mixed_content_server.sjs => dom/security/test/mixedcontentblocker/file_server.sjs rename : dom/base/test/mixedcontentblocker/mochitest.ini => dom/security/test/mixedcontentblocker/mochitest.ini rename : dom/base/test/mixedcontentblocker/test_mixed_content_blocker_bug803225.html => dom/security/test/mixedcontentblocker/test_bug803225.html rename : dom/base/test/mixedcontentblocker/test_mixed_content_blocker_frameNavigation.html => dom/security/test/mixedcontentblocker/test_frameNavigation.html rename : dom/base/test/mixedcontentblocker/test_mixed_content_blocker.html => dom/security/test/mixedcontentblocker/test_main.html extra : rebase_source : ea9c355fb48d4c42d31135733f9904e510713edc
2015-06-09 02:21:43 +03:00
if (loc == "http://example.com/tests/dom/security/test/mixedcontentblocker/file_frameNavigation_innermost.html?insecurePage_navigate_grandchild_response") {
return;
}
else {
if(counter < MAX_COUNT) {
counter++;
setTimeout(navigationStatus, TIMEOUT_INTERVAL, child);
}
else {
// After we have called setTimeout the maximum number of times, assume navigating the iframe is blocked
parent.parent.postMessage({"test": "insecurePage_navigate_grandchild", "msg": "navigating to insecure grandchild iframe blocked on insecure page"}, "http://mochi.test:8888");
}
}
}
setTimeout(navigationStatus, TIMEOUT_INTERVAL, child);
</script>
</body>
</html>