зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset c06eb27d0c64 (bug 1561964) for mochitest failures CLOSED TREE
This commit is contained in:
Родитель
8e59d02a2e
Коммит
71a457f2bf
|
@ -49,28 +49,24 @@
|
|||
|
||||
<!-- websockets: upgrade ws:// to wss://-->
|
||||
<script type="application/javascript">
|
||||
// WebSocket tests are not supported on Android yet. Bug 1566168
|
||||
const {AppConstants} = SpecialPowers.Cu.import("resource://gre/modules/AppConstants.jsm", {});
|
||||
if (AppConstants.platform !== "android") {
|
||||
var mySocket = new WebSocket("ws://example.com/tests/dom/security/test/csp/file_upgrade_insecure");
|
||||
mySocket.onopen = function(e) {
|
||||
if (mySocket.url.includes("wss://")) {
|
||||
window.parent.postMessage({result: "websocket-ok"}, "*");
|
||||
}
|
||||
else {
|
||||
window.parent.postMessage({result: "websocket-error"}, "*");
|
||||
}
|
||||
mySocket.close();
|
||||
};
|
||||
mySocket.onerror = function(e) {
|
||||
// debug information for Bug 1316305
|
||||
dump(" xxx mySocket.onerror: (mySocket): " + mySocket + "\n");
|
||||
dump(" xxx mySocket.onerror: (mySocket.url): " + mySocket.url + "\n");
|
||||
dump(" xxx mySocket.onerror: (e): " + e + "\n");
|
||||
dump(" xxx mySocket.onerror: (e.message): " + e.message + "\n");
|
||||
window.parent.postMessage({result: "websocket-unexpected-error"}, "*");
|
||||
};
|
||||
}
|
||||
var mySocket = new WebSocket("ws://example.com/tests/dom/security/test/csp/file_upgrade_insecure");
|
||||
mySocket.onopen = function(e) {
|
||||
if (mySocket.url.includes("wss://")) {
|
||||
window.parent.postMessage({result: "websocket-ok"}, "*");
|
||||
}
|
||||
else {
|
||||
window.parent.postMessage({result: "websocket-error"}, "*");
|
||||
}
|
||||
mySocket.close();
|
||||
};
|
||||
mySocket.onerror = function(e) {
|
||||
// debug information for Bug 1316305
|
||||
dump(" xxx mySocket.onerror: (mySocket): " + mySocket + "\n");
|
||||
dump(" xxx mySocket.onerror: (mySocket.url): " + mySocket.url + "\n");
|
||||
dump(" xxx mySocket.onerror: (e): " + e + "\n");
|
||||
dump(" xxx mySocket.onerror: (e.message): " + e.message + "\n");
|
||||
window.parent.postMessage({result: "websocket-unexpected-error"}, "*");
|
||||
};
|
||||
</script>
|
||||
|
||||
<!-- form action: (upgrade POST from http:// to https://) -->
|
||||
|
|
|
@ -50,23 +50,19 @@
|
|||
|
||||
<!-- websockets: upgrade ws:// to wss://-->
|
||||
<script type="application/javascript">
|
||||
// WebSocket tests are not supported on Android Yet. Bug 1566168.
|
||||
const {AppConstants} = SpecialPowers.Cu.import("resource://gre/modules/AppConstants.jsm", {});
|
||||
if (AppConstants.platform !== "android") {
|
||||
var mySocket = new WebSocket("ws://example.com/tests/dom/security/test/csp/file_upgrade_insecure");
|
||||
mySocket.onopen = function(e) {
|
||||
if (mySocket.url.includes("wss://")) {
|
||||
window.parent.postMessage({result: "websocket-ok"}, "*");
|
||||
}
|
||||
else {
|
||||
window.parent.postMessage({result: "websocket-error"}, "*");
|
||||
}
|
||||
mySocket.close();
|
||||
};
|
||||
mySocket.onerror = function(e) {
|
||||
window.parent.postMessage({result: "websocket-unexpected-error"}, "*");
|
||||
};
|
||||
}
|
||||
var mySocket = new WebSocket("ws://example.com/tests/dom/security/test/csp/file_upgrade_insecure");
|
||||
mySocket.onopen = function(e) {
|
||||
if (mySocket.url.includes("wss://")) {
|
||||
window.parent.postMessage({result: "websocket-ok"}, "*");
|
||||
}
|
||||
else {
|
||||
window.parent.postMessage({result: "websocket-error"}, "*");
|
||||
}
|
||||
mySocket.close();
|
||||
};
|
||||
mySocket.onerror = function(e) {
|
||||
window.parent.postMessage({result: "websocket-unexpected-error"}, "*");
|
||||
};
|
||||
</script>
|
||||
|
||||
<!-- form action: (upgrade POST from http:// to https://) -->
|
||||
|
|
|
@ -250,6 +250,7 @@ prefs =
|
|||
[test_evalscript_allowed_by_strict_dynamic.html]
|
||||
[test_frameancestors.html]
|
||||
[test_frameancestors_userpass.html]
|
||||
skip-if = toolkit == 'android' # Times out, not sure why (bug 1008445)
|
||||
[test_inlinescript.html]
|
||||
[test_inlinestyle.html]
|
||||
[test_invalid_source_expression.html]
|
||||
|
@ -288,9 +289,11 @@ skip-if = verify
|
|||
[test_win_open_blocked.html]
|
||||
[test_upgrade_insecure.html]
|
||||
# no ssl support as well as websocket tests do not work (see test_websocket.html)
|
||||
skip-if = os != 'linux' && !debug # Bug 1183300
|
||||
skip-if = (toolkit == 'android') || (os != 'linux' && !debug) # Bug 1183300
|
||||
[test_upgrade_insecure_reporting.html]
|
||||
skip-if = toolkit == 'android'
|
||||
[test_upgrade_insecure_cors.html]
|
||||
skip-if = toolkit == 'android'
|
||||
[test_upgrade_insecure_loopback.html]
|
||||
[test_report_for_import.html]
|
||||
[test_blocked_uri_in_reports.html]
|
||||
|
@ -327,7 +330,7 @@ tags = mcb
|
|||
[test_iframe_srcdoc.html]
|
||||
[test_image_nonce.html]
|
||||
[test_websocket_self.html]
|
||||
skip-if = toolkit == 'android' # no websocket support Bug 982828
|
||||
skip-if = toolkit == 'android'
|
||||
[test_ignore_xfo.html]
|
||||
[test_data_csp_inheritance.html]
|
||||
[test_data_csp_merge.html]
|
||||
|
@ -379,7 +382,7 @@ support-files =
|
|||
file_script_template.html
|
||||
file_script_template.js
|
||||
[test_reloadInFreshProcess.html]
|
||||
# no large-allocation on win32, no e10s-multi support on Android Bug 1530770
|
||||
# no ssl support on android and no large-allocation on win32
|
||||
skip-if = (toolkit == 'android') || (os == 'win' && bits == 32)
|
||||
support-files =
|
||||
file_reloadInFreshProcess.sjs
|
||||
|
|
|
@ -28,8 +28,6 @@
|
|||
* received by the server (*.sjs) were actually *https* requests.
|
||||
*/
|
||||
|
||||
const {AppConstants} = SpecialPowers.Cu.import("resource://gre/modules/AppConstants.jsm", {});
|
||||
|
||||
const UPGRADE_POLICY =
|
||||
"upgrade-insecure-requests;" + // upgrade all http requests to https
|
||||
"block-all-mixed-content;" + // upgrade should be enforced before block-all.
|
||||
|
@ -52,7 +50,7 @@ var tests = [
|
|||
deliveryMethod: "header",
|
||||
results: [
|
||||
"iframe-ok", "script-ok", "img-ok", "img-redir-ok", "font-ok", "xhr-ok", "style-ok",
|
||||
"media-ok", "object-ok", "form-ok", "nested-img-ok"
|
||||
"media-ok", "object-ok", "form-ok", "websocket-ok", "nested-img-ok"
|
||||
]
|
||||
},
|
||||
{ // (2) test that all requests within an >> http << page get updated
|
||||
|
@ -62,7 +60,7 @@ var tests = [
|
|||
deliveryMethod: "header",
|
||||
results: [
|
||||
"iframe-ok", "script-ok", "img-ok", "img-redir-ok", "font-ok", "xhr-ok", "style-ok",
|
||||
"media-ok", "object-ok", "form-ok", "nested-img-ok"
|
||||
"media-ok", "object-ok", "form-ok", "websocket-ok", "nested-img-ok"
|
||||
]
|
||||
},
|
||||
{ // (3) test that all requests within an >> http << page get updated, but do
|
||||
|
@ -73,7 +71,7 @@ var tests = [
|
|||
deliveryMethod: "header",
|
||||
results: [
|
||||
"iframe-ok", "script-ok", "img-ok", "img-redir-ok", "font-ok", "xhr-ok", "style-ok",
|
||||
"media-ok", "object-ok", "form-ok", "nested-img-ok"
|
||||
"media-ok", "object-ok", "form-ok", "websocket-ok", "nested-img-ok"
|
||||
]
|
||||
},
|
||||
{ // (4) test that no requests get updated if >> upgrade-insecure-requests << is not used
|
||||
|
@ -84,7 +82,7 @@ var tests = [
|
|||
results: [
|
||||
"iframe-error", "script-error", "img-error", "img-redir-error", "font-error",
|
||||
"xhr-error", "style-error", "media-error", "object-error", "form-error",
|
||||
"nested-img-error"
|
||||
"websocket-error", "nested-img-error"
|
||||
]
|
||||
},
|
||||
{ // (5) test that all requests within an >> https << page using meta CSP get updated
|
||||
|
@ -96,18 +94,11 @@ var tests = [
|
|||
deliveryMethod: "meta",
|
||||
results: [
|
||||
"iframe-ok", "script-ok", "img-ok", "img-redir-ok", "font-ok", "xhr-ok", "style-ok",
|
||||
"media-ok", "object-ok", "form-ok", "nested-img-ok"
|
||||
"media-ok", "object-ok", "form-ok", "websocket-ok", "nested-img-ok"
|
||||
]
|
||||
},
|
||||
];
|
||||
|
||||
// TODO: WebSocket tests are not supported on Android Yet. Bug 1566168.
|
||||
if (AppConstants.platform !== "android") {
|
||||
for (let test of tests) {
|
||||
test.results.push("websocket-ok");
|
||||
}
|
||||
}
|
||||
|
||||
var counter = 0;
|
||||
var curTest;
|
||||
|
||||
|
|
|
@ -26,10 +26,13 @@ support-files =
|
|||
[test_nosniff.html]
|
||||
[test_block_script_wrong_mime.html]
|
||||
[test_block_toplevel_data_navigation.html]
|
||||
skip-if = toolkit == 'android' # intermittent failure
|
||||
[test_block_toplevel_data_img_navigation.html]
|
||||
skip-if = toolkit == 'android' # intermittent failure
|
||||
[test_allow_opening_data_pdf.html]
|
||||
skip-if = toolkit == 'android' # no pdf reader on Android
|
||||
skip-if = toolkit == 'android'
|
||||
[test_allow_opening_data_json.html]
|
||||
skip-if = toolkit == 'android'
|
||||
[test_block_subresource_redir_to_data.html]
|
||||
[test_same_site_cookies_subrequest.html]
|
||||
[test_same_site_cookies_toplevel_nav.html]
|
||||
|
@ -40,5 +43,6 @@ skip-if = toolkit == 'android' # no pdf reader on Android
|
|||
[test_same_site_cookies_iframe.html]
|
||||
[test_same_site_cookies_about.html]
|
||||
[test_assert_about_page_no_csp.html]
|
||||
skip-if = !debug || toolkit == 'android'
|
||||
[test_same_site_cookies_laxByDefault.html]
|
||||
support-files = closeWindow.sjs
|
||||
|
|
|
@ -12,8 +12,6 @@
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
SimpleTest.expectAssertions(0, 1);
|
||||
|
||||
const {AppConstants} = SpecialPowers.Cu.import("resource://gre/modules/AppConstants.jsm", {});
|
||||
|
||||
// Test Setup:
|
||||
// The test overrules the whitelist of about: pages that are allowed to load without a CSP
|
||||
// and makes sure to hit the assertion within AssertAboutPageHasCSP().
|
||||
|
@ -21,11 +19,7 @@
|
|||
// test loads a second dummy data: URI to reset the old cache and finally resets the pref
|
||||
// used for testing purposes.
|
||||
|
||||
let origWhiteList = "";
|
||||
// Android doesn't have this pref
|
||||
if (AppConstants.platform !== "android") {
|
||||
origWhiteList = SpecialPowers.getCharPref("csp.about_uris_without_csp");
|
||||
}
|
||||
let origWhiteList = SpecialPowers.getCharPref("csp.about_uris_without_csp");
|
||||
|
||||
SpecialPowers.setCharPref("csp.about_uris_without_csp", "");
|
||||
SpecialPowers.setBoolPref("csp.overrule_about_uris_without_csp_whitelist", true);
|
||||
|
@ -35,9 +29,7 @@
|
|||
myFrame.src = "about:blank";
|
||||
// booom :-)
|
||||
|
||||
if (origWhiteList !== "") {
|
||||
SpecialPowers.setCharPref("csp.about_uris_without_csp", origWhiteList);
|
||||
}
|
||||
SpecialPowers.setCharPref("csp.about_uris_without_csp", origWhiteList);
|
||||
myFrame.src = "data:text/html,<body>just a dumy data: URI</body>";
|
||||
|
||||
SpecialPowers.setBoolPref("csp.overrule_about_uris_without_csp_whitelist", false);
|
||||
|
|
|
@ -22,7 +22,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=803225
|
|||
-->
|
||||
|
||||
<script>
|
||||
const {AppConstants} = SpecialPowers.Cu.import("resource://gre/modules/AppConstants.jsm", {});
|
||||
|
||||
//For tests that require setTimeout, set the timeout interval
|
||||
var TIMEOUT_INTERVAL = 100;
|
||||
|
@ -149,24 +148,22 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=803225
|
|||
mailtoProtocolStatus();
|
||||
|
||||
// Test 7: wss protocol
|
||||
// WebSocket tests are not supported on Android Yet. Bug 1566168.
|
||||
if (AppConstants.platform !== "android") {
|
||||
var wss;
|
||||
wss = new WebSocket("wss://example.com/tests/dom/security/test/mixedcontentblocker/file_main_bug803225_websocket");
|
||||
var wss;
|
||||
wss = new WebSocket("wss://example.com/tests/dom/security/test/mixedcontentblocker/file_main_bug803225_websocket");
|
||||
|
||||
var status_wss = "started";
|
||||
wss.onopen = function(e) {
|
||||
status_wss = "opened";
|
||||
wss.close();
|
||||
}
|
||||
wss.onclose = function(e) {
|
||||
if(status_wss == "opened") {
|
||||
parent.postMessage({"test": "wss", "msg": "resource with wss protocol loaded"}, "http://mochi.test:8888");
|
||||
} else {
|
||||
parent.postMessage({"test": "wss", "msg": "resource with wss protocol did not load"}, "http://mochi.test:8888");
|
||||
}
|
||||
var status_wss = "started";
|
||||
wss.onopen = function(e) {
|
||||
status_wss = "opened";
|
||||
wss.close();
|
||||
}
|
||||
wss.onclose = function(e) {
|
||||
if(status_wss == "opened") {
|
||||
parent.postMessage({"test": "wss", "msg": "resource with wss protocol loaded"}, "http://mochi.test:8888");
|
||||
} else {
|
||||
parent.postMessage({"test": "wss", "msg": "resource with wss protocol did not load"}, "http://mochi.test:8888");
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -22,7 +22,7 @@ support-files =
|
|||
[test_main.html]
|
||||
skip-if = (toolkit == 'android') || webrender || (verify && !debug && (os == 'linux')) # Android: TIMED_OUT; bug 1402554
|
||||
[test_bug803225.html]
|
||||
skip-if = (os=='linux' && bits==32) || headless # Linux32:bug 1324870; Headless:bug 1405870
|
||||
skip-if = toolkit == 'android' || (os=='linux' && bits==32) || headless #Android: TIMED_OUT; Linux32:bug 1324870; Headless:bug 1405870
|
||||
[test_frameNavigation.html]
|
||||
skip-if = webrender || (debug && (os == 'linux' || os == 'win')) || (os == 'win' && !debug) # webrender: bug 1424752 # Bug 1391823; Bug 1353608
|
||||
skip-if = (toolkit == 'android') || webrender || (debug && (os == 'linux' || os == 'win')) || (os == 'win' && !debug) # Android: TIMED_OUT; webrender: bug 1424752 # Bug 1391823; Bug 1353608
|
||||
[test_redirect.html]
|
||||
|
|
|
@ -11,8 +11,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=803225
|
|||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
|
||||
<script>
|
||||
const {AppConstants} = SpecialPowers.Cu.import("resource://gre/modules/AppConstants.jsm", {});
|
||||
|
||||
var counter = 0;
|
||||
var settings = [ [true, true], [true, false], [false, true], [false, false] ];
|
||||
|
||||
|
@ -42,14 +40,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=803225
|
|||
unsafe_about: false,
|
||||
data_protocol: false,
|
||||
javascript: false,
|
||||
mailto: false,
|
||||
wss: false,
|
||||
};
|
||||
|
||||
if (AppConstants.platform !== "android") {
|
||||
// WebSocket tests are not supported on Android Yet. Bug 1566168.
|
||||
testsToRun.wss = false;
|
||||
testsToRun.mailto = false;
|
||||
}
|
||||
|
||||
function log(msg) {
|
||||
document.getElementById("log").textContent += "\n" + msg;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче