diff --git a/testing/web-platform/mozilla/meta/service-workers/service-worker/fetch-cors-xhr.https.html.ini b/testing/web-platform/mozilla/meta/service-workers/service-worker/fetch-cors-xhr.https.html.ini deleted file mode 100644 index 908ece2a1085..000000000000 --- a/testing/web-platform/mozilla/meta/service-workers/service-worker/fetch-cors-xhr.https.html.ini +++ /dev/null @@ -1,6 +0,0 @@ -[fetch-cors-xhr.https.html] - type: testharness - expected: TIMEOUT - [Verify CORS XHR of fetch() in a Service Worker] - expected: TIMEOUT - diff --git a/testing/web-platform/mozilla/tests/service-workers/service-worker/fetch-cors-xhr.https.html b/testing/web-platform/mozilla/tests/service-workers/service-worker/fetch-cors-xhr.https.html index 3562592469dc..3b1f1d6bc321 100644 --- a/testing/web-platform/mozilla/tests/service-workers/service-worker/fetch-cors-xhr.https.html +++ b/testing/web-platform/mozilla/tests/service-workers/service-worker/fetch-cors-xhr.https.html @@ -11,7 +11,7 @@ async_test(function(t) { var SCRIPT = 'resources/fetch-rewrite-worker.js'; var host_info = get_host_info(); - login(t) + login_https(t) .then(function() { return service_worker_unregister_and_register(t, SCRIPT, SCOPE); }) @@ -28,7 +28,7 @@ async_test(function(t) { service_worker_unregister_and_done(t, SCOPE); }); frame.contentWindow.postMessage({}, - host_info['HTTP_ORIGIN'], + host_info['HTTPS_ORIGIN'], [channel.port2]); }); }) diff --git a/testing/web-platform/mozilla/tests/service-workers/service-worker/resources/fetch-cors-xhr-iframe.html b/testing/web-platform/mozilla/tests/service-workers/service-worker/resources/fetch-cors-xhr-iframe.html index 7279b4855eb8..96b363a344e3 100644 --- a/testing/web-platform/mozilla/tests/service-workers/service-worker/resources/fetch-cors-xhr-iframe.html +++ b/testing/web-platform/mozilla/tests/service-workers/service-worker/resources/fetch-cors-xhr-iframe.html @@ -54,8 +54,8 @@ function create_serial_promise(test_cases) { window.addEventListener('message', function(evt) { var port = evt.ports[0]; - var url = host_info['HTTP_ORIGIN'] + path; - var remote_url = host_info['HTTP_REMOTE_ORIGIN'] + path; + var url = host_info['HTTPS_ORIGIN'] + path; + var remote_url = host_info['HTTPS_REMOTE_ORIGIN'] + path; // If the 4th value of the item of TEST_CASES is true, the test case outputs // warning messages. So such tests must be executed in serial to match the // expected output text. @@ -76,15 +76,15 @@ window.addEventListener('message', function(evt) { [remote_url + '?ignore', false, FAIL, true], // Executed in serial. [remote_url + '?ignore', true, FAIL, true], // Executed in serial. [ - remote_url + '?ACAOrigin=' + host_info['HTTP_ORIGIN'] + '&ignore', + remote_url + '?ACAOrigin=' + host_info['HTTPS_ORIGIN'] + '&ignore', false, SUCCESS ], [ - remote_url + '?ACAOrigin=' + host_info['HTTP_ORIGIN'] + '&ignore', + remote_url + '?ACAOrigin=' + host_info['HTTPS_ORIGIN'] + '&ignore', true, FAIL, true // Executed in serial. ], [ - remote_url + '?ACAOrigin=' + host_info['HTTP_ORIGIN'] + + remote_url + '?ACAOrigin=' + host_info['HTTPS_ORIGIN'] + '&ACACredentials=true&ignore', true, SUCCESS ], @@ -94,15 +94,15 @@ window.addEventListener('message', function(evt) { [remote_url + '?Auth&ignore', false, FAIL, true], // Executed in serial. [remote_url + '?Auth&ignore', true, FAIL, true], // Executed in serial. [ - remote_url + '?Auth&ACAOrigin=' + host_info['HTTP_ORIGIN'] + '&ignore', + remote_url + '?Auth&ACAOrigin=' + host_info['HTTPS_ORIGIN'] + '&ignore', false, 'STATUS401' ], [ - remote_url + '?Auth&ACAOrigin=' + host_info['HTTP_ORIGIN'] + '&ignore', + remote_url + '?Auth&ACAOrigin=' + host_info['HTTPS_ORIGIN'] + '&ignore', true, FAIL, true // Executed in serial. ], [ - remote_url + '?Auth&ACAOrigin=' + host_info['HTTP_ORIGIN'] + + remote_url + '?Auth&ACAOrigin=' + host_info['HTTPS_ORIGIN'] + '&ACACredentials=true&ignore', true, SUCCESS ], @@ -144,26 +144,41 @@ window.addEventListener('message', function(evt) { [ url + '?mode=cors&url=' + encodeURIComponent(remote_url + '?ACAOrigin=' + - host_info['HTTP_ORIGIN']), + host_info['HTTPS_ORIGIN']), false, SUCCESS ], [ url + '?mode=cors&url=' + encodeURIComponent(remote_url + '?ACAOrigin=' + - host_info['HTTP_ORIGIN']), + host_info['HTTPS_ORIGIN']), + true, FAIL + ], + [ + url + '?mode=cors&url=' + + encodeURIComponent(remote_url + '?ACAOrigin=' + + host_info['HTTPS_ORIGIN'] + + '&ACACredentials=true'), true, SUCCESS ], [ remote_url + '?mode=cors&url=' + encodeURIComponent(remote_url + '?ACAOrigin=' + - host_info['HTTP_ORIGIN']), + host_info['HTTPS_ORIGIN']), false, SUCCESS ], [ remote_url + '?mode=cors&url=' + encodeURIComponent(remote_url + '?ACAOrigin=' + - host_info['HTTP_ORIGIN']), + host_info['HTTPS_ORIGIN']), + true, FAIL + ], + [ + remote_url + + '?mode=cors&url=' + + encodeURIComponent(remote_url + '?ACAOrigin=' + + host_info['HTTPS_ORIGIN'] + + '&ACACredentials=true'), true, SUCCESS ] ]; diff --git a/testing/web-platform/mozilla/tests/service-workers/service-worker/resources/test-helpers.sub.js b/testing/web-platform/mozilla/tests/service-workers/service-worker/resources/test-helpers.sub.js index f11b94ee023f..fae734fdaf35 100644 --- a/testing/web-platform/mozilla/tests/service-workers/service-worker/resources/test-helpers.sub.js +++ b/testing/web-platform/mozilla/tests/service-workers/service-worker/resources/test-helpers.sub.js @@ -166,8 +166,8 @@ function base_path() { function test_login(test, origin, username, password, cookie) { return new Promise(function(resolve, reject) { with_iframe( - origin + - '/service-worker/resources/fetch-access-control-login.html') + origin + base_path() + + 'resources/fetch-access-control-login.html') .then(test.step_func(function(frame) { var channel = new MessageChannel(); channel.port1.onmessage = test.step_func(function() {