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