Bug 1184973 - Don't use https in b2g tests because of bustage, a=RyanVM

CLOSED TREE
This commit is contained in:
Michael Layzell 2015-08-26 17:25:32 -04:00
parent ec9e5103e2
commit 9dbb6e3bfe
5 changed files with 30 additions and 3 deletions

View File

@ -2,7 +2,7 @@
<head>
<title>frame for storage allowed test</title>
<script type="text/javascript" src="https://example.com/tests/dom/tests/mochitest/general/storagePermissionsUtils.js"></script>
<script type="text/javascript" src="//example.com/tests/dom/tests/mochitest/general/storagePermissionsUtils.js"></script>
<script type="text/javascript">
task(function* () {

View File

@ -2,7 +2,7 @@
<head>
<title>frame for storage allowed test</title>
<script type="text/javascript" src="https://example.com/tests/dom/tests/mochitest/general/storagePermissionsUtils.js"></script>
<script type="text/javascript" src="//example.com/tests/dom/tests/mochitest/general/storagePermissionsUtils.js"></script>
<script type="text/javascript">
task(function* () {

View File

@ -27,6 +27,9 @@ function handleRequest(request, response) {
data += str.value;
} while (read != 0);
// No scheme is provided in data URIs, so explicitly provide one
data = data.replace('//example.com', 'http://example.com');
// Write out the file as a data: URI, and redirect to it
response.setStatusLine('1.1', 302, 'Found');
response.setHeader('Location', 'data:text/html,' + encodeURIComponent(data) + "#nullprincipal");

View File

@ -3,7 +3,7 @@
<head>
<title>frame for storage prevented test</title>
<script type="text/javascript" src="https://example.com/tests/dom/tests/mochitest/general/storagePermissionsUtils.js"></script>
<script type="text/javascript" src="//example.com/tests/dom/tests/mochitest/general/storagePermissionsUtils.js"></script>
<script type="text/javascript">
task(function* () {

View File

@ -230,3 +230,27 @@ function task(fn) {
}
var thirdparty = "https://example.com/tests/dom/tests/mochitest/general/";
// XXX B2G HACK
var b2gOnly = (function() {
function pref(name) {
try {
return SpecialPowers.getBoolPref(name);
} catch (e) {
// Out of an over-abundance of caution, don't use https
// if we can't check the pref
return true;
}
}
var isAndroid = !!navigator.userAgent.includes("Android");
var isMulet = pref("b2g.is_mulet");
var isB2g = isMulet || (!isAndroid && /Mobile|Tablet/.test(navigator.userAgent));
return isB2g ? true : undefined;
})();
// Switch to http:// in b2g because https:// in tests isn't supported
if (b2gOnly) {
thirdparty = "http://example.com/tests/dom/tests/mochitest/general/";
}