Bug 1189581 - Make service-workers/service-worker/fetch-cors-xhr.https.html pass; r=bkelly
☠☠ backed out by f7e6d2a69f8c ☠ ☠
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 20 Oct 2015 09:41:49 -0400
changeset 303833 df12438d4091e89409a5449b067867e57c24858b
parent 303832 828b2b47a4db350bff9d646535e8169a21ecd610
child 303834 c7cedbb6e3fb4662698c587bfad980d1113485ff
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbkelly
bugs1189581
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1189581 - Make service-workers/service-worker/fetch-cors-xhr.https.html pass; r=bkelly
testing/web-platform/mozilla/meta/service-workers/service-worker/fetch-cors-xhr.https.html.ini
testing/web-platform/mozilla/tests/service-workers/service-worker/fetch-cors-xhr.https.html
testing/web-platform/mozilla/tests/service-workers/service-worker/resources/fetch-cors-xhr-iframe.html
testing/web-platform/mozilla/tests/service-workers/service-worker/resources/test-helpers.sub.js
deleted file mode 100644
--- 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
-
--- 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
@@ -6,33 +6,33 @@
 <script src="resources/test-helpers.sub.js?pipe=sub"></script>
 <body>
 <script>
 async_test(function(t) {
     var SCOPE = 'resources/fetch-cors-xhr-iframe.html';
     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);
         })
       .then(function(registration) {
           return wait_for_state(t, registration.installing, 'activated');
         })
       .then(function() { return with_iframe(SCOPE); })
       .then(function(frame) {
           return new Promise(function(resolve, reject) {
               var channel = new MessageChannel();
               channel.port1.onmessage = t.step_func(function(e) {
                   assert_equals(e.data.results, 'finish');
                   frame.remove();
                   service_worker_unregister_and_done(t, SCOPE);
                 });
               frame.contentWindow.postMessage({},
-                                              host_info['HTTP_ORIGIN'],
+                                              host_info['HTTPS_ORIGIN'],
                                               [channel.port2]);
             });
         })
       .catch(unreached_rejection(t));
   }, 'Verify CORS XHR of fetch() in a Service Worker');
 </script>
 </body>
--- 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
@@ -49,18 +49,18 @@ function create_serial_promise(test_case
           return create_test_promise(test_case[0], test_case[1], test_case[2]);
         });
     });
     return promise;
 }
 
 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.
     var TEST_CASES = [
       // Reject tests
       [url + '?reject', false, FAIL],
       [url + '?reject', true, FAIL],
       [remote_url + '?reject', false, FAIL],
@@ -71,43 +71,43 @@ window.addEventListener('message', funct
       [remote_url + '?resolve-null', false, FAIL],
       [remote_url + '?resolve-null', true, FAIL],
       // Fallback tests
       [url + '?ignore', false, SUCCESS],
       [url + '?ignore', true, SUCCESS],
       [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
       ],
       // Credential test (fallback)
       [url + '?Auth&ignore', false, SUCCESS],
       [url + '?Auth&ignore', true, SUCCESS],
       [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
       ],
       // Basic response
       [
         url + '?mode=same-origin&url=' + encodeURIComponent(url),
         false, SUCCESS
       ],
@@ -139,36 +139,51 @@ window.addEventListener('message', funct
       [
         remote_url + '?mode=no-cors&url=' + encodeURIComponent(remote_url),
         false, FAIL
       ],
       // CORS response
       [
         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
       ]
     ];
     var promises = [];
     var serial_tests = [];
     for (var i = 0; i < TEST_CASES.length ; ++i) {
       if (!TEST_CASES[i][3]) {
         promises.push(create_test_promise(TEST_CASES[i][0],
--- 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
@@ -161,18 +161,18 @@ function service_worker_test(url, descri
 
 function base_path() {
   return location.pathname.replace(/\/[^\/]*$/, '/');
 }
 
 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() {
                 frame.remove();
                 resolve();
               });
             frame.contentWindow.postMessage(
               {username: username, password: password, cookie: cookie},