Bug 907770 - Part 2: Test changes for https support on b2g/android. r=jmaher
--- a/content/base/test/mochitest.ini
+++ b/content/base/test/mochitest.ini
@@ -214,21 +214,19 @@ support-files =
somedatas.resource
somedatas.resource^headers^
variable_style_sheet.sjs
viewport_helpers.js
w3element_traversal.svg
wholeTexty-helper.xml
[test_CrossSiteXHR.html]
-skip-if = toolkit == 'android'
[test_CrossSiteXHR_cache.html]
-skip-if = toolkit == 'android'
[test_CrossSiteXHR_origin.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s # b2g(https not working, bug 907770) b2g-debug(https not working, bug 907770) b2g-desktop(https not working, bug 907770)
+skip-if = buildapp == 'b2g' || e10s # last test fails to trigger onload on e10s/b2g
[test_DOMException.html]
[test_EventSource_redirects.html]
[test_NodeIterator_basics_filters.xhtml]
[test_NodeIterator_mutations_1.xhtml]
[test_NodeIterator_mutations_2.html]
[test_NodeIterator_mutations_3.html]
[test_XHR.html]
[test_XHRDocURI.html]
--- a/netwerk/test/mochitests/test_user_agent_overrides.html
+++ b/netwerk/test/mochitests/test_user_agent_overrides.html
@@ -38,27 +38,21 @@ function getUA(host) {
xhr.send();
is(xhr.status, 200, 'request failed');
is(typeof xhr.response, 'string', 'invalid response');
return xhr.response;
}
function testUA(options, callback) {
- var [domain, override, test_hosts, skip, expected] =
- [options.domain, options.override, options.test_hosts, options.skip, options.expected];
+ var [domain, override, test_hosts, expected] =
+ [options.domain, options.override, options.test_hosts, options.expected];
info('Overriding ' + domain + ' with ' + override);
- if (skip) {
- todo(false, 'Skipping');
- callback();
- return;
- }
-
function is_subdomain(host) {
var [test_domain] = host.slice(host.lastIndexOf('/') + 1).split(':', 1);
return test_domain === domain || test_domain.endsWith('.' + domain);
}
var localhost = location.origin;
var overrideNavigator = is_subdomain(localhost);
var navigator_ua, test_ua = [];
@@ -99,22 +93,16 @@ function testUA(options, callback) {
is(getUA(test_host), test_ua[i],
'Header UA not restored at step ' + (++step));
});
callback();
});
});
}
-// mochitests on Android appear to have trouble with https
-// but when it eventually works, we should re-enable the test
-var skipHttps = /android/i.test(DEFAULT_UA);
-if (skipHttps) {
- SimpleTest.doesThrow(function () getUA('https://example.com'), 'Re-enable https test');
-}
var step = 0; // for logging
var tests = [
// should override both header and navigator.userAgent
{
domain: location.hostname,
override: UA_WHOLE_OVERRIDE,
test_hosts: [location.origin],
@@ -145,17 +133,16 @@ var tests = [
override: UA_WHOLE_OVERRIDE,
test_hosts: ['http://example.org',
'http://test1.example.org'],
expected: DEFAULT_UA
},
// should work with https
{
- skip: skipHttps,
domain: 'example.com',
override: UA_WHOLE_OVERRIDE,
test_hosts: ['https://example.com',
'https://test1.example.com',
'https://sub1.test1.example.com'],
expected: UA_WHOLE_EXPECTED
},
];
@@ -238,9 +225,8 @@ testOverrides(function ()
testPriority(SimpleTest.finish)
)
);
</script>
</pre>
</body>
</html>
-