зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1117650 - Part 3 - Move all CORS tests into dom/security/test (r=sicking)
--HG-- rename : dom/base/test/file_CrossSiteXHR_cache_server.sjs => dom/security/test/cors/file_CrossSiteXHR_cache_server.sjs rename : dom/base/test/file_CrossSiteXHR_inner.html => dom/security/test/cors/file_CrossSiteXHR_inner.html rename : dom/base/test/file_CrossSiteXHR_inner.jar => dom/security/test/cors/file_CrossSiteXHR_inner.jar rename : dom/base/test/file_CrossSiteXHR_inner_data.sjs => dom/security/test/cors/file_CrossSiteXHR_inner_data.sjs rename : dom/base/test/file_CrossSiteXHR_server.sjs => dom/security/test/cors/file_CrossSiteXHR_server.sjs rename : dom/base/test/test_CrossSiteXHR.html => dom/security/test/cors/test_CrossSiteXHR.html rename : dom/base/test/test_CrossSiteXHR_cache.html => dom/security/test/cors/test_CrossSiteXHR_cache.html rename : dom/base/test/test_CrossSiteXHR_origin.html => dom/security/test/cors/test_CrossSiteXHR_origin.html
This commit is contained in:
Родитель
0a021977b8
Коммит
6e8135dbde
|
@ -64,11 +64,6 @@ support-files =
|
|||
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
|
||||
|
@ -319,10 +314,6 @@ skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop spec
|
|||
[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]
|
||||
|
|
|
@ -7,7 +7,7 @@ function handleRequest(request, response)
|
|||
});
|
||||
|
||||
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);
|
||||
|
@ -22,7 +22,7 @@ function handleRequest(request, response)
|
|||
// 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);
|
|
@ -138,7 +138,7 @@ function handleRequest(request, response)
|
|||
|
||||
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);
|
|
@ -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
|
|
@ -44,11 +44,11 @@ function runTest() {
|
|||
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;
|
||||
|
||||
|
@ -874,7 +874,7 @@ function runTest() {
|
|||
|
||||
|
||||
// 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,
|
|
@ -30,7 +30,7 @@ function runTest() {
|
|||
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;
|
||||
|
||||
|
@ -428,7 +428,7 @@ function runTest() {
|
|||
});
|
||||
}
|
||||
|
||||
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=";
|
||||
|
|
@ -39,10 +39,10 @@ var origins =
|
|||
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'
|
||||
},
|
||||
];
|
||||
|
||||
|
@ -61,14 +61,14 @@ function runTest() {
|
|||
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";
|
|
@ -13,6 +13,7 @@ GeckoCppUnitTests([
|
|||
])
|
||||
|
||||
MOCHITEST_MANIFESTS += [
|
||||
'cors/mochitest.ini',
|
||||
'csp/mochitest.ini',
|
||||
'mixedcontentblocker/mochitest.ini',
|
||||
]
|
||||
|
|
Загрузка…
Ссылка в новой задаче