Bug 1117650 - Part 3 - Move all CORS tests into dom/security/test (r=sicking)
☠☠ backed out by 218c8f17c77f ☠ ☠
authorChristoph Kerschbaumer <mozilla@christophkerschbaumer.com>
Mon, 05 Jan 2015 09:47:13 -0800
changeset 251962 aff44058c7992c1075b8e865e08d60ff30f62348
parent 251961 eef01ed4d40606a4e196f624c0f8b481673ed647
child 251963 48409acb6e9847f9f007e95d112b08bbe1914d8a
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking
bugs1117650
milestone38.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 1117650 - Part 3 - Move all CORS tests into dom/security/test (r=sicking)
dom/base/test/file_CrossSiteXHR_cache_server.sjs
dom/base/test/file_CrossSiteXHR_inner.html
dom/base/test/file_CrossSiteXHR_inner.jar
dom/base/test/file_CrossSiteXHR_inner_data.sjs
dom/base/test/file_CrossSiteXHR_server.sjs
dom/base/test/mochitest.ini
dom/base/test/test_CrossSiteXHR.html
dom/base/test/test_CrossSiteXHR_cache.html
dom/base/test/test_CrossSiteXHR_origin.html
dom/security/test/cors/file_CrossSiteXHR_cache_server.sjs
dom/security/test/cors/file_CrossSiteXHR_inner.html
dom/security/test/cors/file_CrossSiteXHR_inner.jar
dom/security/test/cors/file_CrossSiteXHR_inner_data.sjs
dom/security/test/cors/file_CrossSiteXHR_server.sjs
dom/security/test/cors/mochitest.ini
dom/security/test/cors/test_CrossSiteXHR.html
dom/security/test/cors/test_CrossSiteXHR_cache.html
dom/security/test/cors/test_CrossSiteXHR_origin.html
dom/security/test/moz.build
--- a/dom/base/test/mochitest.ini
+++ b/dom/base/test/mochitest.ini
@@ -59,21 +59,16 @@ support-files =
   delayedServerEvents.sjs
   echo.sjs
   eventsource.resource
   eventsource.resource^headers^
   eventsource_redirect.resource
   eventsource_redirect.resource^headers^
   eventsource_redirect_to.resource
   eventsource_redirect_to.resource^headers^
-  file_CrossSiteXHR_cache_server.sjs
-  file_CrossSiteXHR_inner.html
-  file_CrossSiteXHR_inner.jar
-  file_CrossSiteXHR_inner_data.sjs
-  file_CrossSiteXHR_server.sjs
   file_XHRDocURI.text
   file_XHRDocURI.text^headers^
   file_XHRDocURI.xml
   file_XHRDocURI.xml^headers^
   file_XHRDocURI.html
   file_XHRDocURI.html^headers^
   file_XHRDocURI.sjs
   file_XHRResponseURL.js
@@ -314,20 +309,16 @@ skip-if = (buildapp == 'b2g' && toolkit 
 [test_window_cross_origin_props.html]
 [test_window_define_symbol.html]
 [test_window_enumeration.html]
 [test_window_extensible.html]
 [test_window_indexing.html]
 [test_window_named_frame_enumeration.html]
 [test_writable-replaceable.html]
 [test_navigatorPrefOverride.html]
-[test_CrossSiteXHR.html]
-[test_CrossSiteXHR_cache.html]
-[test_CrossSiteXHR_origin.html]
-skip-if = buildapp == 'b2g' || e10s # last test fails to trigger onload on e10s/b2g
 [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]
 [test_XHRResponseURL.html]
rename from dom/base/test/file_CrossSiteXHR_cache_server.sjs
rename to dom/security/test/cors/file_CrossSiteXHR_cache_server.sjs
--- a/dom/base/test/file_CrossSiteXHR_cache_server.sjs
+++ b/dom/security/test/cors/file_CrossSiteXHR_cache_server.sjs
@@ -2,32 +2,32 @@ function handleRequest(request, response
 {
   var query = {};
   request.queryString.split('&').forEach(function (val) {
     var [name, value] = val.split('=');
     query[name] = unescape(value);
   });
 
   if ("setState" in query) {
-    setState("test/dom/base/test_CrossSiteXHR_cache:secData",
+    setState("test/dom/security/test/cors/test_CrossSiteXHR_cache:secData",
              query.setState);
 
     response.setHeader("Cache-Control", "no-cache", false);
     response.setHeader("Content-Type", "text/plain", false);
     response.write("hi");
 
     return;
   }
 
   var isPreflight = request.method == "OPTIONS";
 
   // Send response
 
   secData =
-    eval(getState("test/dom/base/test_CrossSiteXHR_cache:secData"));
+    eval(getState("test/dom/security/test/cors/test_CrossSiteXHR_cache:secData"));
 
   if (secData.allowOrigin)
     response.setHeader("Access-Control-Allow-Origin", secData.allowOrigin);
 
   if (isPreflight) {
     if (secData.allowHeaders)
       response.setHeader("Access-Control-Allow-Headers", secData.allowHeaders);
 
rename from dom/base/test/file_CrossSiteXHR_inner.html
rename to dom/security/test/cors/file_CrossSiteXHR_inner.html
rename from dom/base/test/file_CrossSiteXHR_inner.jar
rename to dom/security/test/cors/file_CrossSiteXHR_inner.jar
rename from dom/base/test/file_CrossSiteXHR_inner_data.sjs
rename to dom/security/test/cors/file_CrossSiteXHR_inner_data.sjs
rename from dom/base/test/file_CrossSiteXHR_server.sjs
rename to dom/security/test/cors/file_CrossSiteXHR_server.sjs
--- a/dom/base/test/file_CrossSiteXHR_server.sjs
+++ b/dom/security/test/cors/file_CrossSiteXHR_server.sjs
@@ -133,17 +133,17 @@ function handleRequest(request, response
     }
 
     if (query.exposeHeaders)
       response.setHeader("Access-Control-Expose-Headers", query.exposeHeaders);
   }
 
   if (query.hop && query.hop < hops.length) {
     newURL = hops[query.hop].server +
-             "/tests/dom/base/test/file_CrossSiteXHR_server.sjs?" +
+             "/tests/dom/security/test/cors/file_CrossSiteXHR_server.sjs?" +
              "hop=" + (query.hop + 1) + "&hops=" + query.hops;
     response.setStatusLine(null, 307, "redirect");
     response.setHeader("Location", newURL);
 
     return;
   }
 
   // Send response body
new file mode 100644
--- /dev/null
+++ b/dom/security/test/cors/mochitest.ini
@@ -0,0 +1,12 @@
+[DEFAULT]
+support-files =
+  file_CrossSiteXHR_cache_server.sjs
+  file_CrossSiteXHR_inner.html
+  file_CrossSiteXHR_inner.jar
+  file_CrossSiteXHR_inner_data.sjs
+  file_CrossSiteXHR_server.sjs
+
+[test_CrossSiteXHR.html]
+[test_CrossSiteXHR_cache.html]
+[test_CrossSiteXHR_origin.html]
+skip-if = buildapp == 'b2g' || e10s # last test fails to trigger onload on e10s/b2g
rename from dom/base/test/test_CrossSiteXHR.html
rename to dom/security/test/cors/test_CrossSiteXHR.html
--- a/dom/base/test/test_CrossSiteXHR.html
+++ b/dom/security/test/cors/test_CrossSiteXHR.html
@@ -39,21 +39,21 @@ function initTestCallback() {
 }
 
 function runTest() {
   var loader = document.getElementById('loader');
   var loaderWindow = loader.contentWindow;
   loader.onload = function () { gen.next() };
 
   // Test preflight-less requests
-  basePath = "/tests/dom/base/test/file_CrossSiteXHR_server.sjs?"
+  basePath = "/tests/dom/security/test/cors/file_CrossSiteXHR_server.sjs?"
   baseURL = "http://mochi.test:8888" + basePath;
 
   // Test preflighted requests
-  loader.src = "http://example.org/tests/dom/base/test/file_CrossSiteXHR_inner.html";
+  loader.src = "http://example.org/tests/dom/security/test/cors/file_CrossSiteXHR_inner.html";
   origin = "http://example.org";
   yield undefined;
 
   tests =     [// Plain request
                { pass: 1,
                  method: "GET",
                  noAllowPreflight: 1,
                },
@@ -869,17 +869,17 @@ function runTest() {
   }
 
   // Make sure to clear cookies to avoid affecting other tests
   document.cookie = "a=; path=/; expires=Thu, 01-Jan-1970 00:00:01 GMT"
   is(document.cookie, "", "No cookies should be left over");
 
 
   // Test redirects
-  is(loader.src, "http://example.org/tests/dom/base/test/file_CrossSiteXHR_inner.html");
+  is(loader.src, "http://example.org/tests/dom/security/test/cors/file_CrossSiteXHR_inner.html");
   is(origin, "http://example.org");
 
   tests = [{ pass: 1,
              method: "GET",
              hops: [{ server: "http://example.com",
                       allowOrigin: origin
                     },
                     ],
rename from dom/base/test/test_CrossSiteXHR_cache.html
rename to dom/security/test/cors/test_CrossSiteXHR_cache.html
--- a/dom/base/test/test_CrossSiteXHR_cache.html
+++ b/dom/security/test/cors/test_CrossSiteXHR_cache.html
@@ -25,17 +25,17 @@ window.addEventListener("message", funct
 
 gen = runTest();
 
 function runTest() {
   var loader = document.getElementById('loader');
   var loaderWindow = loader.contentWindow;
   loader.onload = function () { gen.next() };
 
-  loader.src = "http://example.org/tests/dom/base/test/file_CrossSiteXHR_inner.html";
+  loader.src = "http://example.org/tests/dom/security/test/cors/file_CrossSiteXHR_inner.html";
   origin = "http://example.org";
   yield undefined;
 
   tests = [{ pass: 0,
              method: "GET",
              headers: { "x-my-header": "myValue" },
            },
            { pass: 1,
@@ -423,17 +423,17 @@ function runTest() {
     tests.push({ newTest: "*******" },
                { pass: 1,
                  method: "DELETE",
                  allowMethods: "DELETE",
                  cacheTime: 3600,
                });
   }
 
-  baseURL = "http://mochi.test:8888/tests/dom/base/test/" +
+  baseURL = "http://mochi.test:8888/tests/dom/security/test/cors/" +
              "file_CrossSiteXHR_cache_server.sjs?";
   setStateURL = baseURL + "setState=";
 
   var unique = Date.now();
   for (test of tests) {
     if (test.newTest) {
       unique++;
       continue;
rename from dom/base/test/test_CrossSiteXHR_origin.html
rename to dom/security/test/cors/test_CrossSiteXHR_origin.html
--- a/dom/base/test/test_CrossSiteXHR_origin.html
+++ b/dom/security/test/cors/test_CrossSiteXHR_origin.html
@@ -34,20 +34,20 @@ var origins =
    { server: 'http://ex\xe4mple.test',
      origin: 'http://xn--exmple-cua.test'
    },
    { server: 'http://xn--exmple-cua.test' },
    { server: 'http://\u03c0\u03b1\u03c1\u03ac\u03b4\u03b5\u03b9\u03b3\u03bc\u03b1.\u03b4\u03bf\u03ba\u03b9\u03bc\u03ae',
      origin: 'http://xn--hxajbheg2az3al.xn--jxalpdlp'
    },
    { origin: 'http://example.org',
-     file: 'jar:http://example.org/tests/dom/base/test/file_CrossSiteXHR_inner.jar!/file_CrossSiteXHR_inner.html'
+     file: 'jar:http://example.org/tests/dom/security/test/cors/file_CrossSiteXHR_inner.jar!/file_CrossSiteXHR_inner.html'
    },
    { origin: 'null',
-     file: 'http://example.org/tests/dom/base/test/file_CrossSiteXHR_inner_data.sjs'
+     file: 'http://example.org/tests/dom/security/test/cors/file_CrossSiteXHR_inner_data.sjs'
    },
    ];
 
    //['https://example.com:443'],
    //['https://sub1.test1.example.com:443'],
 
 window.addEventListener("message", function(e) {
   gen.send(e.data);
@@ -56,24 +56,24 @@ window.addEventListener("message", funct
 gen = runTest();
 
 function runTest() {
   var loader = document.getElementById('loader');
   var loaderWindow = loader.contentWindow;
   loader.onload = function () { gen.next() };
 
   // Test preflight-less requests
-  basePath = "/tests/dom/base/test/file_CrossSiteXHR_server.sjs?"
+  basePath = "/tests/dom/security/test/cors/file_CrossSiteXHR_server.sjs?"
   baseURL = "http://mochi.test:8888" + basePath;
 
   for (originEntry of origins) {
     origin = originEntry.origin || originEntry.server;
 
     loader.src = originEntry.file ||
-                 (originEntry.server + "/tests/dom/base/test/file_CrossSiteXHR_inner.html");
+                 (originEntry.server + "/tests/dom/security/test/cors/file_CrossSiteXHR_inner.html");
     yield undefined;
 
     var isNullOrigin = origin == "null";
 
     port = /:\d+/;
     passTests = [
       origin,
       "*",
--- a/dom/security/test/moz.build
+++ b/dom/security/test/moz.build
@@ -8,15 +8,16 @@ XPCSHELL_TESTS_MANIFESTS += [
     'unit/xpcshell.ini',
 ]
 
 GeckoCppUnitTests([
     'TestCSPParser',
 ])
 
 MOCHITEST_MANIFESTS += [
+    'cors/mochitest.ini',
     'csp/mochitest.ini',
     'mixedcontentblocker/mochitest.ini',
 ]
 
 MOCHITEST_CHROME_MANIFESTS += [
     'csp/chrome.ini',
 ]