| Index: third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-origin-header-in-isolated-world.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-origin-header-in-isolated-world.html b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-origin-header-in-isolated-world.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..65904723fb01096436048a230e7630cd8b52a15c
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-origin-header-in-isolated-world.html
|
| @@ -0,0 +1,33 @@
|
| +<!DOCTYPE html>
|
| +<script src="/js-test-resources/testharness.js"></script>
|
| +<script src="/js-test-resources/testharnessreport.js"></script>
|
| +<script>
|
| +if (window.testRunner) {
|
| + // Testing with "http" scheme than "chrome-extension://" since content_shell
|
| + // doesn't register the extension scheme as a web safe isolated scheme.
|
| + testRunner.setIsolatedWorldSecurityOrigin(1, 'http://example.com');
|
| +}
|
| +
|
| +function runTest() {
|
| + const xhr = new XMLHttpRequest();
|
| + xhr.open('GET', 'http://localhost:8000/xmlhttprequest/resources/access-control-origin-header-in-isolated-world.php');
|
| + xhr.setRequestHeader('X-Custom-Header', 'PASS');
|
| + xhr.onerror = () => {
|
| + postMessage('FAIL: XHR errored', '*');
|
| + };
|
| + xhr.onload = () => {
|
| + postMessage(xhr.responseText, '*');
|
| + };
|
| + xhr.send();
|
| +}
|
| +
|
| +async_test(t => {
|
| + addEventListener('message', t.step_func(event => {
|
| + assert_equals(event.data, 'PASS');
|
| + t.done();
|
| + }));
|
| + testRunner.evaluateScriptInIsolatedWorld(1, String(eval('runTest')) + '\nrunTest();');
|
| +}, 'The Origin header contains the origin of the isolated world where the script is running');
|
| +
|
| +done();
|
| +</script>
|
|
|