Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4008d31

Browse filesBrowse files
youennfwebkit-commit-queue
authored andcommitted
ScriptElement should use FetchOptions::mode according its crossOrigin attribute
https://bugs.webkit.org/show_bug.cgi?id=161686 Patch by Youenn Fablet <youenn@apple.com> on 2016-09-12 Reviewed by Darin Adler. Source/WebCore: Setting ScriptElement fetch mode according its crossOrigin attribute. Removing LoadableClassicScriptchecking of CORS since this is now done at ResourceLoader/CachedResource level. Updating CachedResourceLoader to ensure that a resource that matches an on-going resource load but with different fetch mode/origin, always gets its loading started if the resource state is not Cached. Tests: fast/dom/script-crossorigin-loads-fail-origin.html http/tests/security/cross-origin-cached-images-parallel.html http/tests/security/cross-origin-cached-images.html http/tests/security/cross-origin-cached-scripts-parallel.html http/tests/security/cross-origin-cached-scripts.html http/tests/security/script-crossorigin-loads-correctly-credentials.html http/tests/security/script-with-dataurl.html * dom/LoadableClassicScript.cpp: (WebCore::LoadableClassicScript::create): (WebCore::LoadableClassicScript::notifyFinished): Checking CORS failures using the resource state. (WebCore::LoadableClassicScript::~LoadableClassicScript): Deleted. (WebCore::LoadableClassicScript::isLoaded): Deleted. * dom/LoadableClassicScript.h: * dom/ScriptElement.cpp: (WebCore::ScriptElement::requestClassicScript): (WebCore::ScriptElement::requestScriptWithCache): Using CachedResourceRequest::setAsPotentiallyCrossOrigin to set fetch mode according crossOrigin attribute. * dom/ScriptElement.h: * loader/cache/CachedImage.cpp: (WebCore::CachedImage::setBodyDataFrom): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest): Adding support for script resources. (WebCore::CachedResourceLoader::requestResource): Ensuring that 'updated' resources gets actually loaded. * loader/cache/CachedScript.cpp: (WebCore::CachedScript::setBodyDataFrom): Implementing specific data copy from another CachedScript. * loader/cache/CachedScript.h: LayoutTests: Added new tests. Updated cookie test for robustness as the order of the cookie items when more than one may not be preserved. Moved one of the blink test to http/tests as it requires HTTP to run properly. Updated blink test expectation as it is run from file, while it should be run from http. Copied a similar test to http/tests/local to ensure that script load fails when served from the filesystem , CORS check failing. The test was previously passing in WebKit as the test file was served from filesystem and was granted universal access. The CORS checks were done through SecurityOrigin::canRequest which was testing that first. With the patch, CORS checks are done at a lower level and do not take in to account universal access. This aligns with Chrome and Firefox behavior. * http/tests/local/script-crossorigin-loads-fail-origin-expected.txt: Added. * http/tests/local/script-crossorigin-loads-fail-origin.html: Copied from LayoutTests/imported/blink/http/tests/security/script-crossorigin-loads-correctly-credentials.html. * http/tests/cookies/resources/third-party-cookie-relaxing-iframe.html: Sorting the cookie to make the test more resistant. * http/tests/security/cross-origin-cached-images-expected.txt: Added. * http/tests/security/cross-origin-cached-images-parallel-expected.txt: Added. * http/tests/security/cross-origin-cached-images-parallel.html: Renamed from LayoutTests/http/tests/security/cross-origin-cached-resource-parallel.html. * http/tests/security/cross-origin-cached-images.html: Renamed from LayoutTests/http/tests/security/cross-origin-cached-resource.html. * http/tests/security/cross-origin-cached-resource-parallel-expected.txt: Removed. * http/tests/security/cross-origin-cached-scripts-expected.txt: Added. * http/tests/security/cross-origin-cached-scripts-parallel-expected.txt: Added. * http/tests/security/cross-origin-cached-scripts-parallel.html: Added. * http/tests/security/cross-origin-cached-scripts.html: Added. * http/tests/security/resources/cors-script.php: Updated according chromium script to activate CORS credentials header if requested. * http/tests/security/resources/cross-origin-cached-resource-iframe.html: * http/tests/security/resources/notify-loaded.js: Added. * http/tests/security/script-crossorigin-loads-correctly-credentials-expected.txt: Renamed from LayoutTests/imported/blink/http/tests/security/script-crossorigin-loads-correctly-credentials-expected.txt. * http/tests/security/script-crossorigin-loads-correctly-credentials.html: Renamed from LayoutTests/imported/blink/http/tests/security/script-crossorigin-loads-correctly-credentials.html. * http/tests/security/script-with-dataurl-expected.txt: Added. * http/tests/security/script-with-dataurl.html: Added. * http/tests/security/script-with-failed-cors-check-fails-to-load-expected.txt: Canonical link: https://commits.webkit.org/180053@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@205854 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 316bd65 commit 4008d31
Copy full SHA for 4008d31

30 files changed

+416-85Lines changed: 416 additions & 85 deletions
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎LayoutTests/ChangeLog‎

Copy file name to clipboardExpand all lines: LayoutTests/ChangeLog
+40Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,43 @@
1+
2016-09-12 Youenn Fablet <youenn@apple.com>
2+
3+
ScriptElement should use FetchOptions::mode according its crossOrigin attribute
4+
https://bugs.webkit.org/show_bug.cgi?id=161686
5+
6+
Reviewed by Darin Adler.
7+
8+
Added new tests.
9+
Updated cookie test for robustness as the order of the cookie items when more than one may not be preserved.
10+
11+
Moved one of the blink test to http/tests as it requires HTTP to run properly.
12+
Updated blink test expectation as it is run from file, while it should be run from http.
13+
14+
Copied a similar test to http/tests/local to ensure that script load fails when served from the filesystem , CORS check failing.
15+
The test was previously passing in WebKit as the test file was served from filesystem and was granted universal access.
16+
The CORS checks were done through SecurityOrigin::canRequest which was testing that first.
17+
With the patch, CORS checks are done at a lower level and do not take in to account universal access.
18+
This aligns with Chrome and Firefox behavior.
19+
20+
* http/tests/local/script-crossorigin-loads-fail-origin-expected.txt: Added.
21+
* http/tests/local/script-crossorigin-loads-fail-origin.html: Copied from LayoutTests/imported/blink/http/tests/security/script-crossorigin-loads-correctly-credentials.html.
22+
* http/tests/cookies/resources/third-party-cookie-relaxing-iframe.html: Sorting the cookie to make the test more resistant.
23+
* http/tests/security/cross-origin-cached-images-expected.txt: Added.
24+
* http/tests/security/cross-origin-cached-images-parallel-expected.txt: Added.
25+
* http/tests/security/cross-origin-cached-images-parallel.html: Renamed from LayoutTests/http/tests/security/cross-origin-cached-resource-parallel.html.
26+
* http/tests/security/cross-origin-cached-images.html: Renamed from LayoutTests/http/tests/security/cross-origin-cached-resource.html.
27+
* http/tests/security/cross-origin-cached-resource-parallel-expected.txt: Removed.
28+
* http/tests/security/cross-origin-cached-scripts-expected.txt: Added.
29+
* http/tests/security/cross-origin-cached-scripts-parallel-expected.txt: Added.
30+
* http/tests/security/cross-origin-cached-scripts-parallel.html: Added.
31+
* http/tests/security/cross-origin-cached-scripts.html: Added.
32+
* http/tests/security/resources/cors-script.php: Updated according chromium script to activate CORS credentials header if requested.
33+
* http/tests/security/resources/cross-origin-cached-resource-iframe.html:
34+
* http/tests/security/resources/notify-loaded.js: Added.
35+
* http/tests/security/script-crossorigin-loads-correctly-credentials-expected.txt: Renamed from LayoutTests/imported/blink/http/tests/security/script-crossorigin-loads-correctly-credentials-expected.txt.
36+
* http/tests/security/script-crossorigin-loads-correctly-credentials.html: Renamed from LayoutTests/imported/blink/http/tests/security/script-crossorigin-loads-correctly-credentials.html.
37+
* http/tests/security/script-with-dataurl-expected.txt: Added.
38+
* http/tests/security/script-with-dataurl.html: Added.
39+
* http/tests/security/script-with-failed-cors-check-fails-to-load-expected.txt:
40+
141
2016-09-12 Fujii Hironori <Hironori.Fujii@sony.com>
242

343
[GTK] Fix lint warnings of LayoutTests/platform/gtk/TestExpectations
Collapse file

‎LayoutTests/http/tests/cookies/resources/third-party-cookie-relaxing-iframe.html‎

Copy file name to clipboardExpand all lines: LayoutTests/http/tests/cookies/resources/third-party-cookie-relaxing-iframe.html
+9-2Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,18 @@
2121
alert("Unknown message.");
2222
}
2323

24+
function sortCookie(cookie)
25+
{
26+
var items = cookie.split("; ");
27+
items.sort();
28+
return items.join("; ");
29+
}
30+
2431
var stage = 1;
2532
function showCookies()
2633
{
27-
alert("Test stage " + stage++ + " document.cookie is: " + document.cookie);
28-
parent.window.postMessage("done", "*");
34+
alert("Test stage " + stage++ + " document.cookie is: " + sortCookie(document.cookie));
35+
parent.window.postMessage("done", "*");
2936
}
3037

3138
function sendXHR(queryCommand)
Collapse file
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CONSOLE MESSAGE: Origin is not allowed by Access-Control-Allow-Origin.
2+
CONSOLE MESSAGE: Cross-origin script load denied by Cross-Origin Resource Sharing policy.
3+
This test fails if the script loads correctly.
4+
5+
PASS
Collapse file
+23Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<body>
2+
<p>This test fails if the script loads correctly.</p>
3+
<pre></pre>
4+
<script>
5+
if (window.testRunner) {
6+
testRunner.dumpAsText();
7+
testRunner.waitUntilDone();
8+
}
9+
10+
function done(msg) {
11+
document.querySelector("pre").innerHTML = msg;
12+
if (window.testRunner)
13+
testRunner.notifyDone();
14+
}
15+
16+
var script = document.createElement("script");
17+
script.crossOrigin = "use-credentials";
18+
// We are serving the test from the filesystem, so it should fail as authorized origin is 127.0.0.1:8000.
19+
script.src = "http://localhost:8000/security/resources/cors-script.php?credentials=true";
20+
script.onload = function() { done("FAIL"); }
21+
script.onerror = function() { done("PASS");}
22+
document.body.appendChild(script);
23+
</script>
Collapse file
+17Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
CONSOLE MESSAGE: Origin http://localhost:8080 is not allowed by Access-Control-Allow-Origin.
2+
CONSOLE MESSAGE: Cross-origin image load denied by Cross-Origin Resource Sharing policy.
3+
CONSOLE MESSAGE: Origin http://localhost:8080 is not allowed by Access-Control-Allow-Origin.
4+
CONSOLE MESSAGE: Cross-origin image load denied by Cross-Origin Resource Sharing policy.
5+
Tests source origin difference for cached resources.
6+
7+
Trying to load sequentially the same image from different origins.
8+
Test 1 PASS: Loaded img http://127.0.0.1:8000/security/resources/abe-allow-star.php?allowCache from localhost:8000 (crossOrigin=anonymous)
9+
Test 2 PASS: Loaded img http://127.0.0.1:8000/security/resources/abe-allow-star.php?allowCache from localhost:8080 (crossOrigin=anonymous)
10+
Test 3 PASS: Loaded img http://127.0.0.1:8000/security/resources/allow-if-origin.php?allowCache&origin=http%3A%2F%2Flocalhost%3A8000 from localhost:8000 (crossOrigin=anonymous)
11+
Test 4 PASS: Did not load img http://127.0.0.1:8000/security/resources/allow-if-origin.php?allowCache&origin=http%3A%2F%2Flocalhost%3A8000 from localhost:8080 (crossOrigin=anonymous)
12+
Test 5 PASS: Loaded img http://127.0.0.1:8080/security/resources/abe-allow-star.php?allowCache from localhost:8000
13+
Test 6 PASS: Loaded img http://127.0.0.1:8080/security/resources/abe-allow-star.php?allowCache from localhost:8000 (crossOrigin=anonymous)
14+
Test 7 PASS: Loaded img http://127.0.0.1:8080/security/resources/allow-if-origin.php?allowCache&origin=http%3A%2F%2Flocalhost%3A8000 from localhost:8080
15+
Test 8 PASS: Did not load img http://127.0.0.1:8080/security/resources/allow-if-origin.php?allowCache&origin=http%3A%2F%2Flocalhost%3A8000 from localhost:8080 (crossOrigin=anonymous)
16+
17+
Collapse file
+17Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
CONSOLE MESSAGE: Origin http://localhost:8080 is not allowed by Access-Control-Allow-Origin.
2+
CONSOLE MESSAGE: Cross-origin image load denied by Cross-Origin Resource Sharing policy.
3+
CONSOLE MESSAGE: Origin http://localhost:8080 is not allowed by Access-Control-Allow-Origin.
4+
CONSOLE MESSAGE: Cross-origin image load denied by Cross-Origin Resource Sharing policy.
5+
Tests source origin difference for cached resources.
6+
7+
Trying to load sequentially the same image from different origins.
8+
Test 1 PASS: Loaded img http://127.0.0.1:8000/security/resources/abe-allow-star.php?allowCache from localhost:8000 (crossOrigin=anonymous)
9+
Test 2 PASS: Loaded img http://127.0.0.1:8000/security/resources/abe-allow-star.php?allowCache from localhost:8080 (crossOrigin=anonymous)
10+
Test 3 PASS: Loaded img http://127.0.0.1:8000/security/resources/allow-if-origin.php?allowCache&origin=http%3A%2F%2Flocalhost%3A8000&delay=200 from localhost:8000 (crossOrigin=anonymous)
11+
Test 4 PASS: Did not load img http://127.0.0.1:8000/security/resources/allow-if-origin.php?allowCache&origin=http%3A%2F%2Flocalhost%3A8000&delay=200 from localhost:8080 (crossOrigin=anonymous)
12+
Test 5 PASS: Loaded img http://127.0.0.1:8080/security/resources/abe-allow-star.php?allowCache from localhost:8000
13+
Test 6 PASS: Loaded img http://127.0.0.1:8080/security/resources/abe-allow-star.php?allowCache from localhost:8000 (crossOrigin=anonymous)
14+
Test 7 PASS: Loaded img http://127.0.0.1:8080/security/resources/allow-if-origin.php?allowCache&origin=http%3A%2F%2Flocalhost%3A8000&delay=200 from localhost:8080
15+
Test 8 PASS: Did not load img http://127.0.0.1:8080/security/resources/allow-if-origin.php?allowCache&origin=http%3A%2F%2Flocalhost%3A8000&delay=200 from localhost:8080 (crossOrigin=anonymous)
16+
17+
Collapse file

‎…oss-origin-cached-resource-parallel.html‎ ‎…cross-origin-cached-images-parallel.html‎LayoutTests/http/tests/security/cross-origin-cached-resource-parallel.html renamed to LayoutTests/http/tests/security/cross-origin-cached-images-parallel.html LayoutTests/http/tests/security/cross-origin-cached-resource-parallel.html renamed to LayoutTests/http/tests/security/cross-origin-cached-images-parallel.html

Copy file name to clipboardExpand all lines: LayoutTests/http/tests/security/cross-origin-cached-images-parallel.html
+11-12Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<html>
22
<body>
33
<p>Tests source origin difference for cached resources.</p
4-
<p>Trying to load sequentially the same image from various origins.</p>
5-
<p>All images should load.</p>
4+
<p>Trying to load sequentially the same image from different origins.</p>
65
<div id="console"></div>
76
<div>
87
<iframe id="iframe1"></iframe>
@@ -40,28 +39,28 @@
4039
var iframeURL8080 = "http://localhost:8080/security/resources/cross-origin-cached-resource-iframe.html";
4140

4241
var allowAllImage1 = "http://127.0.0.1:8000/security/resources/abe-allow-star.php?allowCache";
43-
var allow8000Image1 = "http://127.0.0.1:8000/security/resources/allow-if-origin.php?allowCache&origin=http%3A%2F%2Flocalhost%3A8000";
42+
var allow8000Image1 = "http://127.0.0.1:8000/security/resources/allow-if-origin.php?allowCache&origin=http%3A%2F%2Flocalhost%3A8000&delay=200";
4443

4544
var allowAllImage2 = "http://127.0.0.1:8080/security/resources/abe-allow-star.php?allowCache";
46-
var allow8000Image2 = "http://127.0.0.1:8080/security/resources/allow-if-origin.php?allowCache&origin=http%3A%2F%2Flocalhost%3A8000";
45+
var allow8000Image2 = "http://127.0.0.1:8080/security/resources/allow-if-origin.php?allowCache&origin=http%3A%2F%2Flocalhost%3A8000&delay=200";
4746

4847
document.getElementById('iframe1').src = iframeURL8000 + "#" +
49-
encodeURIComponent(JSON.stringify({url: allowAllImage1, shouldPass:true, crossOrigin: "anonymous", id: 1}));
48+
encodeURIComponent(JSON.stringify({node: "img", url: allowAllImage1, shouldPass:true, crossOrigin: "anonymous", id: 1}));
5049
document.getElementById('iframe2').src = iframeURL8080 + "#" +
51-
encodeURIComponent(JSON.stringify({url: allowAllImage1, shouldPass: true, crossOrigin: "anonymous", id: 2}));
50+
encodeURIComponent(JSON.stringify({node: "img", url: allowAllImage1, shouldPass: true, crossOrigin: "anonymous", id: 2}));
5251
document.getElementById('iframe3').src = iframeURL8000 + "#" +
53-
encodeURIComponent(JSON.stringify({url: allow8000Image1, shouldPass: true, crossOrigin: "anonymous", id: 3}));
52+
encodeURIComponent(JSON.stringify({node: "img", url: allow8000Image1, shouldPass: true, crossOrigin: "anonymous", id: 3}));
5453
document.getElementById('iframe4').src = iframeURL8080 + "#" +
55-
encodeURIComponent(JSON.stringify({url: allow8000Image1, shouldPass: false, crossOrigin: "anonymous", id: 4}));
54+
encodeURIComponent(JSON.stringify({node: "img", url: allow8000Image1, shouldPass: false, crossOrigin: "anonymous", id: 4}));
5655

5756
document.getElementById('iframe5').src = iframeURL8000 + "#" +
58-
encodeURIComponent(JSON.stringify({url: allowAllImage2, shouldPass:true, id: 5}));
57+
encodeURIComponent(JSON.stringify({node: "img", url: allowAllImage2, shouldPass:true, id: 5}));
5958
document.getElementById('iframe6').src = iframeURL8000 + "#" +
60-
encodeURIComponent(JSON.stringify({url: allowAllImage2, shouldPass:true, crossOrigin: "anonymous", id: 6}));
59+
encodeURIComponent(JSON.stringify({node: "img", url: allowAllImage2, shouldPass:true, crossOrigin: "anonymous", id: 6}));
6160
document.getElementById('iframe7').src = iframeURL8080 + "#" +
62-
encodeURIComponent(JSON.stringify({url: allow8000Image2, shouldPass:true, id: 7}));
61+
encodeURIComponent(JSON.stringify({node: "img", url: allow8000Image2, shouldPass:true, id: 7}));
6362
document.getElementById('iframe8').src = iframeURL8080 + "#" +
64-
encodeURIComponent(JSON.stringify({url: allow8000Image2, shouldPass:false, crossOrigin: "anonymous", id: 8}));
63+
encodeURIComponent(JSON.stringify({node: "img", url: allow8000Image2, shouldPass:false, crossOrigin: "anonymous", id: 8}));
6564
</script>
6665
</body>
6766
</html>
Collapse file

‎…curity/cross-origin-cached-resource.html‎ ‎…security/cross-origin-cached-images.html‎LayoutTests/http/tests/security/cross-origin-cached-resource.html renamed to LayoutTests/http/tests/security/cross-origin-cached-images.html LayoutTests/http/tests/security/cross-origin-cached-resource.html renamed to LayoutTests/http/tests/security/cross-origin-cached-images.html

Copy file name to clipboardExpand all lines: LayoutTests/http/tests/security/cross-origin-cached-images.html
+9-10Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<html>
22
<body>
33
<p>Tests source origin difference for cached resources.</p
4-
<p>Trying to load sequentially the same image from various origins.</p>
5-
<p>All images should load.</p>
4+
<p>Trying to load sequentially the same image from different origins.</p>
65
<div id="console"></div>
76
<div>
87
<iframe id="iframe1"></iframe>
@@ -43,31 +42,31 @@
4342
// Four first tests try to load an image with a given origin and then the same image (in cache) with a different origin.
4443
if (counter == 1)
4544
document.getElementById('iframe1').src = iframeURL8000 + "#" +
46-
encodeURIComponent(JSON.stringify({url: allowAllImage1, shouldPass:true, crossOrigin: "anonymous", id: 1}));
45+
encodeURIComponent(JSON.stringify({node: "img", url: allowAllImage1, shouldPass:true, crossOrigin: "anonymous", id: 1}));
4746
else if (counter == 2)
4847
document.getElementById('iframe2').src = iframeURL8080 + "#" +
49-
encodeURIComponent(JSON.stringify({url: allowAllImage1, shouldPass: true, crossOrigin: "anonymous", id: 2}));
48+
encodeURIComponent(JSON.stringify({node: "img", url: allowAllImage1, shouldPass: true, crossOrigin: "anonymous", id: 2}));
5049
else if (counter == 3)
5150
document.getElementById('iframe3').src = iframeURL8000 + "#" +
52-
encodeURIComponent(JSON.stringify({url: allow8000Image1, shouldPass: true, crossOrigin: "anonymous", id: 3}));
51+
encodeURIComponent(JSON.stringify({node: "img", url: allow8000Image1, shouldPass: true, crossOrigin: "anonymous", id: 3}));
5352
// Fourth image load should fail since requesting image from localhost:8080 while only allowed from localhost:8000.
5453
else if (counter == 4)
5554
document.getElementById('iframe4').src = iframeURL8080 + "#" +
56-
encodeURIComponent(JSON.stringify({url: allow8000Image1, shouldPass: false, crossOrigin: "anonymous", id: 4}));
55+
encodeURIComponent(JSON.stringify({node: "img", url: allow8000Image1, shouldPass: false, crossOrigin: "anonymous", id: 4}));
5756

5857
// Four next tests try to load a cross-origin image without cors and then with cors.
5958
else if (counter == 5)
6059
document.getElementById('iframe5').src = iframeURL8000 + "#" +
61-
encodeURIComponent(JSON.stringify({url: allowAllImage2, shouldPass:true, id: 5}));
60+
encodeURIComponent(JSON.stringify({node: "img", url: allowAllImage2, shouldPass:true, id: 5}));
6261
else if (counter == 6)
6362
document.getElementById('iframe6').src = iframeURL8000 + "#" +
64-
encodeURIComponent(JSON.stringify({url: allowAllImage2, shouldPass:true, crossOrigin: "anonymous", id: 6}));
63+
encodeURIComponent(JSON.stringify({node: "img", url: allowAllImage2, shouldPass:true, crossOrigin: "anonymous", id: 6}));
6564
else if (counter == 7)
6665
document.getElementById('iframe7').src = iframeURL8080 + "#" +
67-
encodeURIComponent(JSON.stringify({url: allow8000Image2, shouldPass:true, id: 7}));
66+
encodeURIComponent(JSON.stringify({node: "img", url: allow8000Image2, shouldPass:true, id: 7}));
6867
else if (counter == 8)
6968
document.getElementById('iframe8').src = iframeURL8080 + "#" +
70-
encodeURIComponent(JSON.stringify({url: allow8000Image2, shouldPass:false, crossOrigin: "anonymous", id: 8}));
69+
encodeURIComponent(JSON.stringify({node: "img", url: allow8000Image2, shouldPass:false, crossOrigin: "anonymous", id: 8}));
7170
else if (window.testRunner)
7271
testRunner.notifyDone();
7372
}
Collapse file

‎LayoutTests/http/tests/security/cross-origin-cached-resource-parallel-expected.txt‎

Copy file name to clipboardExpand all lines: LayoutTests/http/tests/security/cross-origin-cached-resource-parallel-expected.txt
-19Lines changed: 0 additions & 19 deletions
This file was deleted.
Collapse file
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
CONSOLE MESSAGE: Origin http://localhost:8080 is not allowed by Access-Control-Allow-Origin.
2+
CONSOLE MESSAGE: Cross-origin script load denied by Cross-Origin Resource Sharing policy.
3+
CONSOLE MESSAGE: Origin http://localhost:8080 is not allowed by Access-Control-Allow-Origin.
4+
CONSOLE MESSAGE: Cross-origin script load denied by Cross-Origin Resource Sharing policy.
5+
Tests source origin difference for cached resources.
6+
7+
Trying to load sequentially the same script from different origins.
8+
Test 1 PASS: Loaded script http://127.0.0.1:8000/security/resources/allow-if-origin.php?allowCache&origin=http%3A%2F%2Flocalhost%3A8000&name=notify-loaded.js from localhost:8000 (crossOrigin=anonymous)
9+
Test 2 PASS: Did not load script http://127.0.0.1:8000/security/resources/allow-if-origin.php?allowCache&origin=http%3A%2F%2Flocalhost%3A8000&name=notify-loaded.js from localhost:8080 (crossOrigin=anonymous)
10+
Test 3 PASS: Loaded script http://127.0.0.1:8080/security/resources/allow-if-origin.php?allowCache&origin=http%3A%2F%2Flocalhost%3A8000&name=notify-loaded.js from localhost:8080
11+
Test 4 PASS: Did not load script http://127.0.0.1:8080/security/resources/allow-if-origin.php?allowCache&origin=http%3A%2F%2Flocalhost%3A8000&name=notify-loaded.js from localhost:8080 (crossOrigin=anonymous)
12+
13+

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.