зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1117650 - Part 2 - Move all MixedContentBlocker 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
This commit is contained in:
Родитель
c8504a0662
Коммит
4804cd4b56
|
@ -1,20 +0,0 @@
|
|||
[DEFAULT]
|
||||
support-files =
|
||||
bug803225_test_mailto.html
|
||||
file_mixed_content_frameNavigation.html
|
||||
file_mixed_content_frameNavigation_blankTarget.html
|
||||
file_mixed_content_frameNavigation_grandchild.html
|
||||
file_mixed_content_frameNavigation_innermost.html
|
||||
file_mixed_content_frameNavigation_secure.html
|
||||
file_mixed_content_frameNavigation_secure_grandchild.html
|
||||
file_mixed_content_main.html
|
||||
file_mixed_content_main_bug803225.html
|
||||
file_mixed_content_main_bug803225_websocket_wsh.py
|
||||
file_mixed_content_server.sjs
|
||||
|
||||
[test_mixed_content_blocker.html]
|
||||
skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' || e10s #TIMED_OUT, SSL_REQUIRED
|
||||
[test_mixed_content_blocker_bug803225.html]
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #TIMED_OUT, SSL_REQUIRED
|
||||
[test_mixed_content_blocker_frameNavigation.html]
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #TIMED_OUT, SSL_REQUIRED
|
|
@ -17,7 +17,6 @@ GeckoCppUnitTests([
|
|||
|
||||
MOCHITEST_MANIFESTS += [
|
||||
'chrome/mochitest.ini',
|
||||
'mixedcontentblocker/mochitest.ini',
|
||||
'mochitest.ini',
|
||||
'websocket_hybi/mochitest.ini',
|
||||
]
|
||||
|
|
|
@ -12,7 +12,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=840388
|
|||
<div id="testContent"></div>
|
||||
|
||||
<script>
|
||||
var baseUrlHttps = "https://example.com/tests/dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation_innermost.html";
|
||||
var baseUrlHttps = "https://example.com/tests/dom/security/test/mixedcontentblocker/file_frameNavigation_innermost.html";
|
||||
|
||||
// For tests that require setTimeout, set the maximum polling time to 50 x 100ms = 5 seconds.
|
||||
var MAX_COUNT = 50;
|
||||
|
@ -44,7 +44,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=840388
|
|||
counter_test1++;
|
||||
return;
|
||||
}
|
||||
if (loc == "http://example.com/tests/dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation_innermost.html?insecurePage_navigate_child_response") {
|
||||
if (loc == "http://example.com/tests/dom/security/test/mixedcontentblocker/file_frameNavigation_innermost.html?insecurePage_navigate_child_response") {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
|
@ -63,7 +63,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=840388
|
|||
|
||||
// Test 2: Navigate secure grandchild iframe to insecure grandchild iframe on a page that has no secure parents
|
||||
var iframe_test2 = document.createElement("iframe");
|
||||
iframe_test2.src = "http://example.com/tests/dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation_grandchild.html"
|
||||
iframe_test2.src = "http://example.com/tests/dom/security/test/mixedcontentblocker/file_frameNavigation_grandchild.html"
|
||||
iframe_test2.onerror = function() {
|
||||
parent.postMessage({"test": "insecurePage_navigate_grandchild", "msg": "got an on error alert when loading or navigating testing iframe"}, "http://mochi.test:8888");
|
||||
};
|
|
@ -9,7 +9,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=841850
|
|||
<title>Tests for Mixed Content Frame Navigation</title>
|
||||
</head>
|
||||
<body>
|
||||
<a href="http://example.com/tests/dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation_innermost.html?blankTarget" id="blankTarget" target="_blank">Go to http site</a>
|
||||
<a href="http://example.com/tests/dom/security/test/mixedcontentblocker/file_frameNavigation_innermost.html?blankTarget" id="blankTarget" target="_blank">Go to http site</a>
|
||||
|
||||
<script>
|
||||
var blankTarget = document.getElementById("blankTarget");
|
|
@ -9,7 +9,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=840388
|
|||
<title>Tests for Mixed Content Frame Navigation</title>
|
||||
</head>
|
||||
<body>
|
||||
<iframe src="https://example.com/tests/dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation_innermost.html?insecurePage_navigate_grandchild" id="child"></iframe>
|
||||
<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 50 x 100ms = 5 seconds.
|
||||
|
@ -32,7 +32,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=840388
|
|||
counter++;
|
||||
return;
|
||||
}
|
||||
if (loc == "http://example.com/tests/dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation_innermost.html?insecurePage_navigate_grandchild_response") {
|
||||
if (loc == "http://example.com/tests/dom/security/test/mixedcontentblocker/file_frameNavigation_innermost.html?insecurePage_navigate_grandchild_response") {
|
||||
return;
|
||||
}
|
||||
else {
|
|
@ -9,7 +9,7 @@
|
|||
switch (type) {
|
||||
case "insecurePage_navigate_child":
|
||||
document.getElementById("content").innerHTML =
|
||||
'<a href="http://example.com/tests/dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation_innermost.html?insecurePage_navigate_child_response" id="link">Testing\<\/a>';
|
||||
'<a href="http://example.com/tests/dom/security/test/mixedcontentblocker/file_frameNavigation_innermost.html?insecurePage_navigate_child_response" id="link">Testing\<\/a>';
|
||||
document.getElementById("link").click();
|
||||
break;
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
|||
|
||||
case "insecurePage_navigate_grandchild":
|
||||
document.getElementById("content").innerHTML =
|
||||
'<a href="http://example.com/tests/dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation_innermost.html?insecurePage_navigate_grandchild_response" id="link">Testing\<\/a>';
|
||||
'<a href="http://example.com/tests/dom/security/test/mixedcontentblocker/file_frameNavigation_innermost.html?insecurePage_navigate_grandchild_response" id="link">Testing\<\/a>';
|
||||
document.getElementById("link").click();
|
||||
break;
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
|||
|
||||
case "securePage_navigate_child":
|
||||
document.getElementById("content").innerHTML =
|
||||
'<a href="http://example.com/tests/dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation_innermost.html?securePage_navigate_child_response" id="link">Testing\<\/a>';
|
||||
'<a href="http://example.com/tests/dom/security/test/mixedcontentblocker/file_frameNavigation_innermost.html?securePage_navigate_child_response" id="link">Testing\<\/a>';
|
||||
document.getElementById("link").click();
|
||||
break;
|
||||
|
||||
|
@ -42,7 +42,7 @@
|
|||
|
||||
case "securePage_navigate_grandchild":
|
||||
document.getElementById("content").innerHTML=
|
||||
'<a href="http://example.com/tests/dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation_innermost.html?securePage_navigate_grandchild_response" id="link">Testing\<\/a>';
|
||||
'<a href="http://example.com/tests/dom/security/test/mixedcontentblocker/file_frameNavigation_innermost.html?securePage_navigate_grandchild_response" id="link">Testing\<\/a>';
|
||||
document.getElementById("link").click();
|
||||
break;
|
||||
|
|
@ -12,7 +12,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=840388
|
|||
<div id="testContent"></div>
|
||||
|
||||
<script>
|
||||
var baseUrl = "https://example.com/tests/dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation_innermost.html";
|
||||
var baseUrl = "https://example.com/tests/dom/security/test/mixedcontentblocker/file_frameNavigation_innermost.html";
|
||||
|
||||
// For tests that require setTimeout, set the maximum polling time to 50 x 100ms = 5 seconds.
|
||||
var MAX_COUNT = 50;
|
||||
|
@ -44,7 +44,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=840388
|
|||
counter_test1++;
|
||||
return;
|
||||
}
|
||||
if (loc == "http://example.com/tests/dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation_innermost.html?insecurePage_navigate_child_response") {
|
||||
if (loc == "http://example.com/tests/dom/security/test/mixedcontentblocker/file_frameNavigation_innermost.html?insecurePage_navigate_child_response") {
|
||||
return;
|
||||
} else {
|
||||
if(counter_test1 < MAX_COUNT) {
|
||||
|
@ -62,7 +62,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=840388
|
|||
|
||||
// Test 2: Open an http page in a new tab from a link click with target=_blank.
|
||||
var iframe_test3 = document.createElement("iframe");
|
||||
iframe_test3.src = "https://example.com/tests/dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation_blankTarget.html";
|
||||
iframe_test3.src = "https://example.com/tests/dom/security/test/mixedcontentblocker/file_frameNavigation_blankTarget.html";
|
||||
iframe_test3.onerror = function() {
|
||||
parent.postMessage({"test": "blankTarget", "msg": "got an onerror event when loading or navigating testing iframe"}, "http://mochi.test:8888");
|
||||
};
|
|
@ -10,7 +10,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=840388
|
|||
</head>
|
||||
<body>
|
||||
|
||||
<iframe src="https://example.com/tests/dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation_innermost.html?securePage_navigate_grandchild" id="child"></iframe>
|
||||
<iframe src="https://example.com/tests/dom/security/test/mixedcontentblocker/file_frameNavigation_innermost.html?securePage_navigate_grandchild" id="child"></iframe>
|
||||
<script>
|
||||
// For tests that require setTimeout, set the maximum polling time to 50 x 100ms = 5 seconds.
|
||||
var MAX_COUNT = 50;
|
||||
|
@ -33,7 +33,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=840388
|
|||
counter++;
|
||||
return;
|
||||
}
|
||||
if (loc == "http://example.com/tests/dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation_innermost.html?securePage_navigate_grandchild_response") {
|
||||
if (loc == "http://example.com/tests/dom/security/test/mixedcontentblocker/file_frameNavigation_innermost.html?securePage_navigate_grandchild_response") {
|
||||
return;
|
||||
}
|
||||
else {
|
|
@ -38,7 +38,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=62178
|
|||
-->
|
||||
|
||||
<script>
|
||||
var baseUrl = "http://example.com/tests/dom/base/test/mixedcontentblocker/file_mixed_content_server.sjs";
|
||||
var baseUrl = "http://example.com/tests/dom/security/test/mixedcontentblocker/file_server.sjs";
|
||||
|
||||
//For tests that require setTimeout, set the maximum polling time to 100 x 100ms = 10 seconds.
|
||||
var MAX_COUNT = 100;
|
|
@ -112,7 +112,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=803225
|
|||
var webHandler = SpecialPowers.Cc["@mozilla.org/uriloader/web-handler-app;1"].
|
||||
createInstance(SpecialPowers.Ci.nsIWebHandlerApp);
|
||||
webHandler.name = "Web Handler";
|
||||
webHandler.uriTemplate = "http://example.com/tests/dom/base/test/mixedcontentblocker/bug803225_test_mailto.html?s=%";
|
||||
webHandler.uriTemplate = "http://example.com/tests/dom/security/test/mixedcontentblocker/file_bug803225_test_mailto.html?s=%";
|
||||
|
||||
var uri = ioService.newURI("mailto:foo@bar.com", null, null);
|
||||
webHandler.launchWithURI(uri);
|
||||
|
@ -144,7 +144,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=803225
|
|||
|
||||
// Test 8: wss protocol
|
||||
var wss;
|
||||
wss = new WebSocket("wss://example.com/tests/dom/base/test/mixedcontentblocker/file_mixed_content_main_bug803225_websocket");
|
||||
wss = new WebSocket("wss://example.com/tests/dom/security/test/mixedcontentblocker/file_main_bug803225_websocket");
|
||||
|
||||
var status_wss = "started";
|
||||
wss.onopen = function(e) {
|
|
@ -0,0 +1,20 @@
|
|||
[DEFAULT]
|
||||
support-files =
|
||||
file_bug803225_test_mailto.html
|
||||
file_frameNavigation.html
|
||||
file_frameNavigation_blankTarget.html
|
||||
file_frameNavigation_grandchild.html
|
||||
file_frameNavigation_innermost.html
|
||||
file_frameNavigation_secure.html
|
||||
file_frameNavigation_secure_grandchild.html
|
||||
file_main.html
|
||||
file_main_bug803225.html
|
||||
file_main_bug803225_websocket_wsh.py
|
||||
file_server.sjs
|
||||
|
||||
[test_main.html]
|
||||
skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' || e10s #TIMED_OUT, SSL_REQUIRED
|
||||
[test_bug803225.html]
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #TIMED_OUT, SSL_REQUIRED
|
||||
[test_frameNavigation.html]
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #TIMED_OUT, SSL_REQUIRED
|
|
@ -64,7 +64,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=803225
|
|||
changePrefs(counter);
|
||||
counter++;
|
||||
log("\nblockDisplay set to "+blockDisplay+", blockActive set to "+blockActive+".");
|
||||
document.getElementById('framediv').innerHTML = '<iframe id="testHarness" src="https://example.com/tests/dom/base/test/mixedcontentblocker/file_mixed_content_main_bug803225.html"></iframe>';
|
||||
document.getElementById('framediv').innerHTML = '<iframe id="testHarness" src="https://example.com/tests/dom/security/test/mixedcontentblocker/file_main_bug803225.html"></iframe>';
|
||||
}
|
||||
else {
|
||||
//set the prefs back to what they were set to originally
|
||||
|
@ -141,7 +141,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=803225
|
|||
|
||||
<body>
|
||||
<div id="framediv">
|
||||
<iframe id="testHarness" src="https://example.com/tests/dom/base/test/mixedcontentblocker/file_mixed_content_main_bug803225.html"></iframe>
|
||||
<iframe id="testHarness" src="https://example.com/tests/dom/security/test/mixedcontentblocker/file_main_bug803225.html"></iframe>
|
||||
</div>
|
||||
<pre id="log"></pre>
|
||||
</body>
|
|
@ -42,7 +42,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=840388
|
|||
// If we are here, all the insecure tests have run.
|
||||
// If we haven't changed the iframe to run the secure tests, change it now.
|
||||
if (!secureTestsStarted) {
|
||||
document.getElementById('testing_frame').src = "https://example.com/tests/dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation_secure.html";
|
||||
document.getElementById('testing_frame').src = "https://example.com/tests/dom/security/test/mixedcontentblocker/file_frameNavigation_secure.html";
|
||||
secureTestsStarted = true;
|
||||
}
|
||||
for (var prop in testsToRunSecure) {
|
||||
|
@ -64,7 +64,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=840388
|
|||
blockActive = SpecialPowers.getBoolPref("security.mixed_content.block_active_content");
|
||||
log("blockActive set to "+blockActive+".");
|
||||
secureTestsStarted = false;
|
||||
document.getElementById('framediv').innerHTML = '<iframe src="http://example.com/tests/dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation.html" id="testing_frame"></iframe>';
|
||||
document.getElementById('framediv').innerHTML = '<iframe src="http://example.com/tests/dom/security/test/mixedcontentblocker/file_frameNavigation.html" id="testing_frame"></iframe>';
|
||||
}
|
||||
else {
|
||||
//set the prefs back to what they were set to originally
|
||||
|
@ -119,7 +119,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=840388
|
|||
|
||||
<body>
|
||||
<div id="framediv">
|
||||
<iframe src="http://example.com/tests/dom/base/test/mixedcontentblocker/file_mixed_content_frameNavigation.html" id="testing_frame"></iframe>
|
||||
<iframe src="http://example.com/tests/dom/security/test/mixedcontentblocker/file_frameNavigation.html" id="testing_frame"></iframe>
|
||||
</div>
|
||||
|
||||
<pre id="log"></pre>
|
|
@ -62,7 +62,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=62178
|
|||
}
|
||||
|
||||
function reloadFrame() {
|
||||
document.getElementById('framediv').innerHTML = '<iframe id="testHarness" src="https://example.com/tests/dom/base/test/mixedcontentblocker/file_mixed_content_main.html"></iframe>';
|
||||
document.getElementById('framediv').innerHTML = '<iframe id="testHarness" src="https://example.com/tests/dom/security/test/mixedcontentblocker/file_main.html"></iframe>';
|
||||
}
|
||||
|
||||
function checkTestsCompleted() {
|
|
@ -14,6 +14,7 @@ GeckoCppUnitTests([
|
|||
|
||||
MOCHITEST_MANIFESTS += [
|
||||
'csp/mochitest.ini',
|
||||
'mixedcontentblocker/mochitest.ini',
|
||||
]
|
||||
|
||||
MOCHITEST_CHROME_MANIFESTS += [
|
||||
|
|
Загрузка…
Ссылка в новой задаче