Backed out changeset 92848bd0c1e0 (bug 1561964) for dom/security android mochitest failures

This commit is contained in:
Noemi Erli 2019-08-30 04:05:45 +03:00
Родитель dee3c435aa
Коммит 178d154900
9 изменённых файлов: 67 добавлений и 95 удалений

Просмотреть файл

@ -49,28 +49,24 @@
<!-- websockets: upgrade ws:// to wss://--> <!-- websockets: upgrade ws:// to wss://-->
<script type="application/javascript"> <script type="application/javascript">
// WebSocket tests are not supported on Android yet. Bug 1566168 var mySocket = new WebSocket("ws://example.com/tests/dom/security/test/csp/file_upgrade_insecure");
const {AppConstants} = SpecialPowers.Cu.import("resource://gre/modules/AppConstants.jsm", {}); mySocket.onopen = function(e) {
if (AppConstants.platform !== "android") { if (mySocket.url.includes("wss://")) {
var mySocket = new WebSocket("ws://example.com/tests/dom/security/test/csp/file_upgrade_insecure"); window.parent.postMessage({result: "websocket-ok"}, "*");
mySocket.onopen = function(e) { }
if (mySocket.url.includes("wss://")) { else {
window.parent.postMessage({result: "websocket-ok"}, "*"); window.parent.postMessage({result: "websocket-error"}, "*");
} }
else { mySocket.close();
window.parent.postMessage({result: "websocket-error"}, "*"); };
} mySocket.onerror = function(e) {
mySocket.close(); // debug information for Bug 1316305
}; dump(" xxx mySocket.onerror: (mySocket): " + mySocket + "\n");
mySocket.onerror = function(e) { dump(" xxx mySocket.onerror: (mySocket.url): " + mySocket.url + "\n");
// debug information for Bug 1316305 dump(" xxx mySocket.onerror: (e): " + e + "\n");
dump(" xxx mySocket.onerror: (mySocket): " + mySocket + "\n"); dump(" xxx mySocket.onerror: (e.message): " + e.message + "\n");
dump(" xxx mySocket.onerror: (mySocket.url): " + mySocket.url + "\n"); window.parent.postMessage({result: "websocket-unexpected-error"}, "*");
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,23 +50,19 @@
<!-- websockets: upgrade ws:// to wss://--> <!-- websockets: upgrade ws:// to wss://-->
<script type="application/javascript"> <script type="application/javascript">
// WebSocket tests are not supported on Android Yet. Bug 1566168. var mySocket = new WebSocket("ws://example.com/tests/dom/security/test/csp/file_upgrade_insecure");
const {AppConstants} = SpecialPowers.Cu.import("resource://gre/modules/AppConstants.jsm", {}); mySocket.onopen = function(e) {
if (AppConstants.platform !== "android") { if (mySocket.url.includes("wss://")) {
var mySocket = new WebSocket("ws://example.com/tests/dom/security/test/csp/file_upgrade_insecure"); window.parent.postMessage({result: "websocket-ok"}, "*");
mySocket.onopen = function(e) { }
if (mySocket.url.includes("wss://")) { else {
window.parent.postMessage({result: "websocket-ok"}, "*"); window.parent.postMessage({result: "websocket-error"}, "*");
} }
else { mySocket.close();
window.parent.postMessage({result: "websocket-error"}, "*"); };
} mySocket.onerror = function(e) {
mySocket.close(); window.parent.postMessage({result: "websocket-unexpected-error"}, "*");
}; };
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://) -->

Просмотреть файл

@ -252,7 +252,7 @@ prefs =
[test_frameancestors.html] [test_frameancestors.html]
skip-if = fission skip-if = fission
[test_frameancestors_userpass.html] [test_frameancestors_userpass.html]
skip-if = fission skip-if = fission || 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]
@ -291,9 +291,11 @@ 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 = fission || (os != 'linux' && !debug) # Bug 1183300 skip-if = fission || (toolkit == 'android') || (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]
@ -331,7 +333,7 @@ skip-if = fission
[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' # no websocket support Bug 982828 skip-if = toolkit == 'android'
[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]
@ -385,7 +387,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 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 = skip-if =
(toolkit == 'android') || (os == 'win' && bits == 32) || (toolkit == 'android') || (os == 'win' && bits == 32) ||
fission # Crashes: @ mozilla::dom::ContentParent::CommonCreateWindow(mozilla::dom::PBrowserParent*, bool, unsigned int const&, bool const&, bool const&, bool const&, nsIURI*, nsTString<char> const&, float const&, unsigned long, nsTString<char16_t> const&, nsresult&, nsCOMPtr<nsIRemoteTab>&, bool*, int&, nsIPrincipal*, nsIReferrerInfo*, bool, nsIContentSecurityPolicy*) fission # Crashes: @ mozilla::dom::ContentParent::CommonCreateWindow(mozilla::dom::PBrowserParent*, bool, unsigned int const&, bool const&, bool const&, bool const&, nsIURI*, nsTString<char> const&, float const&, unsigned long, nsTString<char16_t> const&, nsresult&, nsCOMPtr<nsIRemoteTab>&, bool*, int&, nsIPrincipal*, nsIReferrerInfo*, bool, nsIContentSecurityPolicy*)

Просмотреть файл

@ -28,8 +28,6 @@
* 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.
@ -52,7 +50,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", "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 { // (2) test that all requests within an >> http << page get updated
@ -62,7 +60,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", "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 { // (3) test that all requests within an >> http << page get updated, but do
@ -73,7 +71,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", "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 { // (4) test that no requests get updated if >> upgrade-insecure-requests << is not used
@ -84,7 +82,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",
"nested-img-error" "websocket-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
@ -96,18 +94,11 @@ 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", "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(test.results[0] == "iframe-ok" ? "websocket-ok" : "websocket-error");
}
}
var counter = 0; var counter = 0;
var curTest; var curTest;

Просмотреть файл

@ -35,10 +35,13 @@ skip-if = fission || verify
[test_nosniff_navigation.html] [test_nosniff_navigation.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' # no pdf reader on Android skip-if = toolkit == '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]
@ -54,7 +57,7 @@ skip-if = fission # Fails intermittently under Fission
[test_same_site_cookies_about.html] [test_same_site_cookies_about.html]
skip-if = fission # Fails intermittently under Fission skip-if = fission # Fails intermittently under Fission
[test_assert_about_page_no_csp.html] [test_assert_about_page_no_csp.html]
skip-if = !debug skip-if = !debug || toolkit == 'android'
[test_same_site_cookies_laxByDefault.html] [test_same_site_cookies_laxByDefault.html]
skip-if = fission skip-if = fission
support-files = closeWindow.sjs support-files = closeWindow.sjs

Просмотреть файл

@ -12,8 +12,6 @@
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().
@ -21,11 +19,7 @@
// 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 = ""; let origWhiteList = SpecialPowers.getCharPref("csp.about_uris_without_csp");
// 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);
@ -35,9 +29,7 @@
myFrame.src = "about:blank"; myFrame.src = "about:blank";
// booom :-) // 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>"; 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,7 +22,6 @@ 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;
@ -149,24 +148,22 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=803225
mailtoProtocolStatus(); mailtoProtocolStatus();
// Test 7: wss protocol // Test 7: wss protocol
// WebSocket tests are not supported on Android Yet. Bug 1566168. var wss;
if (AppConstants.platform !== "android") { 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"; 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>

Просмотреть файл

@ -25,7 +25,8 @@ skip-if =
(toolkit == 'android') || webrender || (verify && !debug && (os == 'linux')) || # Android: TIMED_OUT; bug 1402554 (toolkit == 'android') || webrender || (verify && !debug && (os == 'linux')) || # Android: TIMED_OUT; bug 1402554
fission # Crashes: @ mozilla::dom::BrowsingContextGroup::EnsureSubscribed(mozilla::dom::ContentParent*) fission # Crashes: @ mozilla::dom::BrowsingContextGroup::EnsureSubscribed(mozilla::dom::ContentParent*)
[test_bug803225.html] [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] [test_frameNavigation.html]
skip-if = fission || webrender || (debug && (os == 'linux' || os == 'win')) || (os == 'win' && !debug) # webrender: bug 1424752 # Bug 1391823; Bug 1353608 skip-if = fission || toolkit == 'android' || webrender || (debug && (os == 'linux' || os == 'win')) || (os == 'win' && !debug) # Android: TIMED_OUT; webrender: bug 1424752 # Bug 1391823; Bug 1353608
[test_redirect.html] [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"/> <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] ];
@ -42,14 +40,10 @@ 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;
} }