<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[213914] trunk/LayoutTests</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/213914">213914</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2017-03-14 10:30:19 -0700 (Tue, 14 Mar 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Import web-platform-tests/cors
https://bugs.webkit.org/show_bug.cgi?id=169565

Patch by Youenn Fablet &lt;youenn@apple.com&gt; on 2017-03-14
Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

* resources/import-expectations.json:
* web-platform-tests/cors/304-expected.txt: Added.
* web-platform-tests/cors/304.htm: Added.
* web-platform-tests/cors/OWNERS: Added.
* web-platform-tests/cors/README.md: Added.
* web-platform-tests/cors/allow-headers-expected.txt: Added.
* web-platform-tests/cors/allow-headers.htm: Added.
* web-platform-tests/cors/basic-expected.txt: Added.
* web-platform-tests/cors/basic.htm: Added.
* web-platform-tests/cors/credentials-flag-expected.txt: Added.
* web-platform-tests/cors/credentials-flag.htm: Added.
* web-platform-tests/cors/late-upload-events-expected.txt: Added.
* web-platform-tests/cors/late-upload-events.htm: Added.
* web-platform-tests/cors/origin-expected.txt: Added.
* web-platform-tests/cors/origin.htm: Added.
* web-platform-tests/cors/preflight-cache-expected.txt: Added.
* web-platform-tests/cors/preflight-cache.htm: Added.
* web-platform-tests/cors/preflight-failure-expected.txt: Added.
* web-platform-tests/cors/preflight-failure.htm: Added.
* web-platform-tests/cors/redirect-origin-expected.txt: Added.
* web-platform-tests/cors/redirect-origin.htm: Added.
* web-platform-tests/cors/redirect-preflight-2-expected.txt: Added.
* web-platform-tests/cors/redirect-preflight-2.htm: Added.
* web-platform-tests/cors/redirect-preflight-expected.txt: Added.
* web-platform-tests/cors/redirect-preflight.htm: Added.
* web-platform-tests/cors/redirect-userinfo-expected.txt: Added.
* web-platform-tests/cors/redirect-userinfo.htm: Added.
* web-platform-tests/cors/remote-origin-expected.txt: Added.
* web-platform-tests/cors/remote-origin.htm: Added.
* web-platform-tests/cors/request-headers-expected.txt: Added.
* web-platform-tests/cors/request-headers.htm: Added.
* web-platform-tests/cors/resources/304.py: Added.
(error):
(main):
* web-platform-tests/cors/resources/checkandremove.py: Added.
(main):
* web-platform-tests/cors/resources/cors-cookie.py: Added.
(main):
* web-platform-tests/cors/resources/cors-headers.asis: Added.
* web-platform-tests/cors/resources/cors-makeheader.py: Added.
(main):
* web-platform-tests/cors/resources/preflight.py: Added.
(main):
* web-platform-tests/cors/resources/remote-xhrer.html: Added.
* web-platform-tests/cors/resources/status.py: Added.
(main):
* web-platform-tests/cors/resources/w3c-import.log: Added.
* web-platform-tests/cors/response-headers-expected.txt: Added.
* web-platform-tests/cors/response-headers.htm: Added.
* web-platform-tests/cors/simple-requests-expected.txt: Added.
* web-platform-tests/cors/simple-requests.htm: Added.
* web-platform-tests/cors/status-async-expected.txt: Added.
* web-platform-tests/cors/status-async.htm: Added.
* web-platform-tests/cors/status-expected.txt: Added.
* web-platform-tests/cors/status-preflight-expected.txt: Added.
* web-platform-tests/cors/status-preflight.htm: Added.
* web-platform-tests/cors/status.htm: Added.
* web-platform-tests/cors/support.js: Added.
(dirname):
* web-platform-tests/cors/w3c-import.log: Added.

LayoutTests:

* tests-options.json:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsTestExpectations">trunk/LayoutTests/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsTestExpectationsorig">trunk/LayoutTests/TestExpectations.orig</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cresourcesimportexpectationsjson">trunk/LayoutTests/imported/w3c/resources/import-expectations.json</a></li>
<li><a href="#trunkLayoutTeststestsoptionsjson">trunk/LayoutTests/tests-options.json</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/LayoutTests/imported/w3c/web-platform-tests/cors/</li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscors304expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/304-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscors304htm">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/304.htm</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsOWNERS">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/OWNERS</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsREADMEmd">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/README.md</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsallowheadersexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/allow-headers-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsallowheadershtm">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/allow-headers.htm</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsbasicexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/basic-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsbasichtm">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/basic.htm</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorscredentialsflagexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/credentials-flag-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorscredentialsflaghtm">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/credentials-flag.htm</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorslateuploadeventsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/late-upload-events-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorslateuploadeventshtm">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/late-upload-events.htm</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsoriginexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/origin-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsoriginhtm">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/origin.htm</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorspreflightcacheexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/preflight-cache-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorspreflightcachehtm">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/preflight-cache.htm</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorspreflightfailureexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/preflight-failure-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorspreflightfailurehtm">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/preflight-failure.htm</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsredirectoriginexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-origin-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsredirectoriginhtm">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-origin.htm</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsredirectpreflight2expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-preflight-2-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsredirectpreflight2htm">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-preflight-2.htm</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsredirectpreflightexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-preflight-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsredirectpreflighthtm">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-preflight.htm</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsredirectuserinfoexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-userinfo-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsredirectuserinfohtm">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-userinfo.htm</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsremoteoriginexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/remote-origin-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsremoteoriginhtm">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/remote-origin.htm</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsrequestheadersexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/request-headers-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsrequestheadershtm">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/request-headers.htm</a></li>
<li>trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/</li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsresources304py">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/304.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsresourcescheckandremovepy">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/checkandremove.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsresourcescorscookiepy">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/cors-cookie.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsresourcescorsheadersasis">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/cors-headers.asis</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsresourcescorsmakeheaderpy">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/cors-makeheader.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsresourcespreflightpy">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/preflight.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsresourcesremotexhrerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/remote-xhrer.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsresourcesstatuspy">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/status.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsresourcesw3cimportlog">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/w3c-import.log</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsresponseheadersexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/response-headers-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsresponseheadershtm">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/response-headers.htm</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorssimplerequestsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/simple-requests-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorssimplerequestshtm">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/simple-requests.htm</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsstatusasyncexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/status-async-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsstatusasynchtm">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/status-async.htm</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsstatusexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/status-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsstatuspreflightexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/status-preflight-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsstatuspreflighthtm">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/status-preflight.htm</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsstatushtm">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/status.htm</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorssupportjs">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/support.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscorsw3cimportlog">trunk/LayoutTests/imported/w3c/web-platform-tests/cors/w3c-import.log</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (213913 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-03-14 17:21:17 UTC (rev 213913)
+++ trunk/LayoutTests/ChangeLog        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2017-03-14  Youenn Fablet  &lt;youenn@apple.com&gt;
+
+        Import web-platform-tests/cors
+        https://bugs.webkit.org/show_bug.cgi?id=169565
+
+        Reviewed by Sam Weinig.
+
+        * tests-options.json:
+
</ins><span class="cx"> 2017-03-14  Antoine Quint  &lt;graouts@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Modern Media Controls] iOS may attempt to load fullscreen icon variants
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (213913 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations        2017-03-14 17:21:17 UTC (rev 213913)
+++ trunk/LayoutTests/TestExpectations        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -302,6 +302,20 @@
</span><span class="cx"> webkit.org/b/154310 [ Debug ] imported/w3c/web-platform-tests/html/dom/reflection-text.html  [ Skip ]
</span><span class="cx"> webkit.org/b/162517 [ Debug ] imported/w3c/web-platform-tests/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-support.htm [ Skip ]
</span><span class="cx"> 
</span><ins>+# Tests that are flaky due to console log / error messages
+webkit.org/b/169565 imported/w3c/web-platform-tests/cors/basic.htm [ Failure ]
+webkit.org/b/169565 imported/w3c/web-platform-tests/cors/credentials-flag.htm [ Failure ]
+webkit.org/b/169565 imported/w3c/web-platform-tests/cors/preflight-cache.htm [ Failure ]
+webkit.org/b/169565 imported/w3c/web-platform-tests/cors/preflight-failure.htm [ Failure ]
+webkit.org/b/169565 imported/w3c/web-platform-tests/cors/redirect-origin.htm [ Failure ]
+webkit.org/b/169565 imported/w3c/web-platform-tests/cors/redirect-preflight.htm [ Failure ]
+webkit.org/b/169565 imported/w3c/web-platform-tests/cors/redirect-preflight-2.htm [ Failure ]
+webkit.org/b/169565 imported/w3c/web-platform-tests/cors/simple-requests.htm [ Failure ]
+webkit.org/b/169565 imported/w3c/web-platform-tests/cors/simple-requests.htm [ Failure ]
+webkit.org/b/169565 imported/w3c/web-platform-tests/cors/status-preflight.htm [ Failure ]
+webkit.org/b/169565 imported/w3c/web-platform-tests/cors/status-async.htm [ Failure ]
+webkit.org/b/169565 imported/w3c/web-platform-tests/cors/304.htm [ Failure ]
+
</ins><span class="cx"> # WPT tests that fail after doing full test repository reimport and need further investigation
</span><span class="cx"> imported/w3c/web-platform-tests/XMLHttpRequest/send-entity-body-document.htm [ Pass Failure Timeout ]
</span><span class="cx"> imported/w3c/web-platform-tests/dom/nodes/Document-createElement-namespace.html [ Pass Failure ]
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectationsorig"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations.orig (213913 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations.orig        2017-03-14 17:21:17 UTC (rev 213913)
+++ trunk/LayoutTests/TestExpectations.orig        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -35,6 +35,9 @@
</span><span class="cx"> media/controls/ipad [ Skip ]
</span><span class="cx"> fast/text-autosizing [ Skip ]
</span><span class="cx"> 
</span><ins>+# window.showModalDialog is only tested in DumpRenderTree on Mac.
+editing/execCommand/show-modal-dialog-during-execCommand.html [ Skip ]
+
</ins><span class="cx"> fast/shadow-dom/touch-event-on-text-assigned-to-slot.html [ Skip ]
</span><span class="cx"> 
</span><span class="cx"> fast/forms/attributed-strings.html [ Skip ]
</span><span class="lines">@@ -711,6 +714,12 @@
</span><span class="cx"> imported/w3c/web-platform-tests/webrtc/no-media-call.html [ Failure  ]
</span><span class="cx"> imported/w3c/web-platform-tests/webrtc/promises-call.html [ Failure  ]
</span><span class="cx"> 
</span><ins>+# Need updating wptserve
+imported/w3c/web-platform-tests/XMLHttpRequest/setrequestheader-content-type.htm [ Skip ]
+imported/w3c/web-platform-tests/XMLHttpRequest/open-url-redirected-worker-origin.htm [ Skip ]
+imported/w3c/web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/NavigatorID.html [ Skip ]
+imported/w3c/web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/NavigatorID.worker.html [ Skip ]
+
</ins><span class="cx"> # Only iOS WK1 has testRunner.setPagePaused.
</span><span class="cx"> fast/dom/timer-fire-after-page-pause.html [ Skip ]
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (213913 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2017-03-14 17:21:17 UTC (rev 213913)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -1,3 +1,71 @@
</span><ins>+2017-03-14  Youenn Fablet  &lt;youenn@apple.com&gt;
+
+        Import web-platform-tests/cors
+        https://bugs.webkit.org/show_bug.cgi?id=169565
+
+        Reviewed by Sam Weinig.
+
+        * resources/import-expectations.json:
+        * web-platform-tests/cors/304-expected.txt: Added.
+        * web-platform-tests/cors/304.htm: Added.
+        * web-platform-tests/cors/OWNERS: Added.
+        * web-platform-tests/cors/README.md: Added.
+        * web-platform-tests/cors/allow-headers-expected.txt: Added.
+        * web-platform-tests/cors/allow-headers.htm: Added.
+        * web-platform-tests/cors/basic-expected.txt: Added.
+        * web-platform-tests/cors/basic.htm: Added.
+        * web-platform-tests/cors/credentials-flag-expected.txt: Added.
+        * web-platform-tests/cors/credentials-flag.htm: Added.
+        * web-platform-tests/cors/late-upload-events-expected.txt: Added.
+        * web-platform-tests/cors/late-upload-events.htm: Added.
+        * web-platform-tests/cors/origin-expected.txt: Added.
+        * web-platform-tests/cors/origin.htm: Added.
+        * web-platform-tests/cors/preflight-cache-expected.txt: Added.
+        * web-platform-tests/cors/preflight-cache.htm: Added.
+        * web-platform-tests/cors/preflight-failure-expected.txt: Added.
+        * web-platform-tests/cors/preflight-failure.htm: Added.
+        * web-platform-tests/cors/redirect-origin-expected.txt: Added.
+        * web-platform-tests/cors/redirect-origin.htm: Added.
+        * web-platform-tests/cors/redirect-preflight-2-expected.txt: Added.
+        * web-platform-tests/cors/redirect-preflight-2.htm: Added.
+        * web-platform-tests/cors/redirect-preflight-expected.txt: Added.
+        * web-platform-tests/cors/redirect-preflight.htm: Added.
+        * web-platform-tests/cors/redirect-userinfo-expected.txt: Added.
+        * web-platform-tests/cors/redirect-userinfo.htm: Added.
+        * web-platform-tests/cors/remote-origin-expected.txt: Added.
+        * web-platform-tests/cors/remote-origin.htm: Added.
+        * web-platform-tests/cors/request-headers-expected.txt: Added.
+        * web-platform-tests/cors/request-headers.htm: Added.
+        * web-platform-tests/cors/resources/304.py: Added.
+        (error):
+        (main):
+        * web-platform-tests/cors/resources/checkandremove.py: Added.
+        (main):
+        * web-platform-tests/cors/resources/cors-cookie.py: Added.
+        (main):
+        * web-platform-tests/cors/resources/cors-headers.asis: Added.
+        * web-platform-tests/cors/resources/cors-makeheader.py: Added.
+        (main):
+        * web-platform-tests/cors/resources/preflight.py: Added.
+        (main):
+        * web-platform-tests/cors/resources/remote-xhrer.html: Added.
+        * web-platform-tests/cors/resources/status.py: Added.
+        (main):
+        * web-platform-tests/cors/resources/w3c-import.log: Added.
+        * web-platform-tests/cors/response-headers-expected.txt: Added.
+        * web-platform-tests/cors/response-headers.htm: Added.
+        * web-platform-tests/cors/simple-requests-expected.txt: Added.
+        * web-platform-tests/cors/simple-requests.htm: Added.
+        * web-platform-tests/cors/status-async-expected.txt: Added.
+        * web-platform-tests/cors/status-async.htm: Added.
+        * web-platform-tests/cors/status-expected.txt: Added.
+        * web-platform-tests/cors/status-preflight-expected.txt: Added.
+        * web-platform-tests/cors/status-preflight.htm: Added.
+        * web-platform-tests/cors/status.htm: Added.
+        * web-platform-tests/cors/support.js: Added.
+        (dirname):
+        * web-platform-tests/cors/w3c-import.log: Added.
+
</ins><span class="cx"> 2017-03-13  Youenn Fablet  &lt;youenn@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Sync web-platform-tests up to revision a5b95cb31914507088a4eda16f7674bbc6f3313f
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cresourcesimportexpectationsjson"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/resources/import-expectations.json (213913 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/resources/import-expectations.json        2017-03-14 17:21:17 UTC (rev 213913)
+++ trunk/LayoutTests/imported/w3c/resources/import-expectations.json        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -106,7 +106,7 @@
</span><span class="cx">     &quot;web-platform-tests/console&quot;: &quot;skip&quot;, 
</span><span class="cx">     &quot;web-platform-tests/content-security-policy&quot;: &quot;skip&quot;, 
</span><span class="cx">     &quot;web-platform-tests/cookies&quot;: &quot;skip&quot;, 
</span><del>-    &quot;web-platform-tests/cors&quot;: &quot;skip&quot;, 
</del><ins>+    &quot;web-platform-tests/cors&quot;: &quot;import&quot;, 
</ins><span class="cx">     &quot;web-platform-tests/css-typed-om&quot;: &quot;skip&quot;, 
</span><span class="cx">     &quot;web-platform-tests/css-values&quot;: &quot;skip&quot;, 
</span><span class="cx">     &quot;web-platform-tests/cssom&quot;: &quot;skip&quot;, 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscors304expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/304-expected.txt (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/304-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/304-expected.txt        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+Blocked access to external URL http://www1.localhost:8800/cors/resources/304.py?id=1&amp;r=%s1489438094491
+CONSOLE MESSAGE: line 27: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/304.py?id=1&amp;r=%s1489438094491 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/304.py?id=3&amp;r=%s1489438094498
+CONSOLE MESSAGE: line 27: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/304.py?id=3&amp;r=%s1489438094498 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/304.py?id=5&amp;r=%s1489438094500
+CONSOLE MESSAGE: line 27: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/304.py?id=5&amp;r=%s1489438094500 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/304.py?id=7&amp;r=%s1489438094501
+CONSOLE MESSAGE: line 27: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/304.py?id=7&amp;r=%s1489438094501 due to access control checks.
+CORS - 304 Responses
+
+
+FAIL A 304 response with no CORS headers inherits from the stored response assert_equals: didn't get successful 1st response; expected &quot;Success&quot; but got &quot;&quot;
+FAIL A 304 can expand Access-Control-Expose-Headers assert_equals: didn't get successful 1st response; expected &quot;Success&quot; but got &quot;&quot;
+FAIL A 304 can contract Access-Control-Expose-Headers assert_equals: didn't get successful 1st response; expected &quot;Success&quot; but got &quot;&quot;
+FAIL A 304 can change Access-Control-Allow-Origin assert_equals: didn't get successful 1st response; expected &quot;Success&quot; but got &quot;&quot;
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscors304htm"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/304.htm (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/304.htm                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/304.htm        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,97 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;title&gt;CORS - 304 Responses&lt;/title&gt;
+&lt;meta name=author title=&quot;Mark Nottingham&quot; href=&quot;mailto:mnot@mnot.net&quot;&gt;
+
+&lt;script src=/resources/testharness.js&gt;&lt;/script&gt;
+&lt;script src=/resources/testharnessreport.js&gt;&lt;/script&gt;
+&lt;script src=support.js?pipe=sub&gt;&lt;/script&gt;
+
+&lt;h1&gt;CORS - 304 Responses&lt;/h1&gt;
+&lt;div id=log&gt;&lt;/div&gt;
+&lt;script&gt;
+
+
+/*
+ * 304 Responses
+ */
+
+// A header used to correlate requests and responses
+var state_header = &quot;content-language&quot;
+
+/* Make a request; call ready(client) when done */
+function req(url, id, t, ready) {
+  var client = new XMLHttpRequest()
+  client.open('GET', url, true)
+  client.setRequestHeader(state_header, id)
+  client.send()
+  client.onreadystatechange = function() {
+    if (client.readyState == client.DONE) {
+      t.step(function() {
+        assert_true(client.status != 299, &quot;req &quot; + id + &quot; server says: &quot; + client.responseText)
+      })
+      ready(client)
+    }
+  }
+  return client
+}
+
+/*
+ * Make two requests to test cache behaviour.
+ * The second is made after the first is done and a delay, to make sure it gets into cache.
+ */
+function two_reqs(id1, id2, should_have_same_body, t, done) {
+  var rand = Date.now()
+  var url = CROSSDOMAIN + 'resources/304.py?id=' + id1 + '&amp;r=%s' + rand
+
+  var client1 = req(url, id1, t, function(client1) {
+    t.step(function() {
+      assert_equals(client1.response, &quot;Success&quot;, &quot;didn't get successful 1st response;&quot;)
+      assert_equals(client1.getResponseHeader(state_header), id1, &quot;1st response didn't come from server;&quot;)
+    })
+
+    t.step_timeout(function() {
+      req(url, id2, t, function(client2) {
+        t.step(function() {
+          if (should_have_same_body) {
+            assert_equals(client1.response, client2.response, &quot;response bodies were different;&quot;)
+//            var res_id2 = client2.getResponseHeader(state_header)
+//            assert_not_equals(res_id2, id1, &quot;2nd response doesn't appear to have updated cached headers;&quot;)
+//            assert_not_equals(res_id2, null, &quot;2nd response didn't expose request identifier;&quot;)
+//            assert_equals(res_id2, id2, &quot;2nd response is associated with a different request (!);&quot;)
+          }
+          done(client1, client2)
+        })
+        t.done()
+      })
+    }, 5000)
+  })
+}
+
+async_test(function(t) {
+  two_reqs('1', '2', true, t, function(client1, client2) {
+    assert_equals(client1.getResponseHeader(&quot;A&quot;), null, &quot;'A' header exposed without permission;&quot;)
+  })
+}, &quot;A 304 response with no CORS headers inherits from the stored response&quot;)
+
+async_test(function(t) {
+  two_reqs('3', '4', true, t, function(client1, client2) {
+    assert_equals(client2.getResponseHeader(&quot;A&quot;), &quot;4&quot;, &quot;304 didn't expose 'A' header, even though allowed;&quot;)
+    assert_equals(client2.getResponseHeader(&quot;B&quot;), &quot;4&quot;, &quot;304 didn't expose 'B' header even though allowed;&quot;)
+  })
+}, &quot;A 304 can expand Access-Control-Expose-Headers&quot;)
+
+async_test(function(t) {
+  two_reqs('5', '6', true, t, function(client1, client2) {
+    assert_equals(client2.getResponseHeader(&quot;B&quot;), null, &quot;2nd 304 exposed 'B' header;&quot;)
+  })
+}, &quot;A 304 can contract Access-Control-Expose-Headers&quot;)
+
+async_test(function(t) {
+  two_reqs('7', '8', false, t, function(client1, client2) {
+    assert_not_equals(client1.response, client2.response, &quot;Access granted even though 304 updated it to disallow;&quot;)
+  })
+}, &quot;A 304 can change Access-Control-Allow-Origin&quot;)
+
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsOWNERS"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/OWNERS (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/OWNERS                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/OWNERS        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+@zqzhang
+@odinho
+@hillbrad
+@jdm
+@annevk
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsREADMEmd"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/README.md (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/README.md                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/README.md        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+Tests for the [Fetch Standard](https://fetch.spec.whatwg.org/).
+
+These tests are located here as originally the CORS protocol was defined on its own.
+
+More CORS tests can be found in
+
+* /fetch
+* /XMLHttpRequest
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsallowheadersexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/allow-headers-expected.txt (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/allow-headers-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/allow-headers-expected.txt        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,92 @@
</span><ins>+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=*
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=%20*%20%20
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=%09*
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=%20http%3A%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=%20http%3A%2F%2Flocalhost%3A8800%20%20%20%09%20
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=%09http%3A%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Fwww1.localhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=%3A%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=ftp%3A%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%3A%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3Alocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=localhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Flocalhost%3A8800%3F
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Flocalhost%3A8800%2F
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Flocalhost%3A8800%20%2F
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Flocalhost%3A8800%23
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Flocalhost%3A8800%2523
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Flocalhost%3A8800%3A80
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Flocalhost%3A8800%2C%20*
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Flocalhost%3A8800%00
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=HTTP%3A%2F%2FLOCALHOST%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=HTTP%3A%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=-
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=**
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=%00*
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=*%00
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin='*'
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=%22*%22
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=*%20*
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=*http%3A%2F%2F*
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=*http%3A%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=*%20http%3A%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=*%2C%20http%3A%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=%00http%3A%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=null%20http%3A%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Fexample.net
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=null
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Flocalhost%3A8800%2Fcors%2Fallow-headers.htm
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Flocalhost%3A8800%2Fcors%2F
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2F
+Access-Control-Allow-Headers handling
+
+
+FAIL Allow origin: * The operation was aborted.
+FAIL Allow origin: _*__ The operation was aborted.
+FAIL Allow origin: [tab]* The operation was aborted.
+FAIL Allow origin: http://localhost:8800 The operation was aborted.
+FAIL Allow origin: _http://localhost:8800 The operation was aborted.
+FAIL Allow origin: _http://localhost:8800___[tab]_ The operation was aborted.
+FAIL Allow origin: [tab]http://localhost:8800 The operation was aborted.
+PASS Disallow origin: http://www1.localhost:8800 
+PASS Disallow origin: //localhost:8800 
+PASS Disallow origin: ://localhost:8800 
+PASS Disallow origin: ftp://localhost:8800 
+PASS Disallow origin: http:://localhost:8800 
+PASS Disallow origin: http:/localhost:8800 
+PASS Disallow origin: http:localhost:8800 
+PASS Disallow origin: localhost:8800 
+PASS Disallow origin: http://localhost:8800? 
+PASS Disallow origin: http://localhost:8800/ 
+PASS Disallow origin: http://localhost:8800 / 
+PASS Disallow origin: http://localhost:8800# 
+PASS Disallow origin: http://localhost:8800%23 
+PASS Disallow origin: http://localhost:8800:80 
+PASS Disallow origin: http://localhost:8800, * 
+PASS Disallow origin: http://localhost:8800\0 
+PASS Disallow origin: HTTP://LOCALHOST:8800 
+PASS Disallow origin: HTTP://localhost:8800 
+PASS Disallow origin: - 
+PASS Disallow origin: ** 
+PASS Disallow origin: \0* 
+PASS Disallow origin: *\0 
+PASS Disallow origin: '*' 
+PASS Disallow origin: &quot;*&quot; 
+PASS Disallow origin: * * 
+PASS Disallow origin: *http://* 
+PASS Disallow origin: *http://localhost:8800 
+PASS Disallow origin: * http://localhost:8800 
+PASS Disallow origin: *, http://localhost:8800 
+PASS Disallow origin: \0http://localhost:8800 
+PASS Disallow origin: null http://localhost:8800 
+PASS Disallow origin: http://example.net 
+PASS Disallow origin: null 
+PASS Disallow origin:  
+PASS Disallow origin: http://localhost:8800/cors/allow-headers.htm 
+PASS Disallow origin: http://localhost:8800/cors/ 
+PASS Disallow origin: http://www1.localhost:8800/cors/ 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsallowheadershtm"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/allow-headers.htm (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/allow-headers.htm                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/allow-headers.htm        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,89 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;title&gt;Access-Control-Allow-Headers handling&lt;/title&gt;
+&lt;script src=/resources/testharness.js&gt;&lt;/script&gt;
+&lt;script src=/resources/testharnessreport.js&gt;&lt;/script&gt;
+&lt;script src=support.js?pipe=sub&gt;&lt;/script&gt;
+
+&lt;h1&gt;Access-Control-Allow-Headers handling&lt;/h1&gt;
+
+&lt;div id=log&gt;&lt;/div&gt;
+
+&lt;script&gt;
+
+/*
+ * Origin header
+ */
+function shouldPass(origin) {
+    test(function () {
+        var client = new XMLHttpRequest()
+        client.open('GET', CROSSDOMAIN
+                            + '/resources/cors-makeheader.py?origin='
+                            + encodeURIComponent(origin),
+                    false)
+        client.send()
+        r = JSON.parse(client.response)
+        var host = location.protocol + &quot;//&quot; + location.host
+        assert_equals(r['origin'], host, 'Request Origin: should be ' + host)
+    }, 'Allow origin: ' + origin.replace(/\t/g, &quot;[tab]&quot;).replace(/ /g, '_'));
+}
+
+shouldPass('*');
+shouldPass(' *  ');
+shouldPass('        *');
+shouldPass(location.protocol + &quot;//&quot; + location.host);
+shouldPass(&quot; &quot;+location.protocol + &quot;//&quot; + location.host);
+shouldPass(&quot; &quot;+location.protocol + &quot;//&quot; + location.host + &quot;            &quot;);
+shouldPass(&quot;        &quot;+location.protocol + &quot;//&quot; + location.host);
+
+
+function shouldFail(origin) {
+    test(function () {
+        var client = new XMLHttpRequest()
+        client.open('GET', CROSSDOMAIN
+                            + '/resources/cors-makeheader.py?origin='
+                            + encodeURIComponent(origin),
+                    false)
+        assert_throws(null, function() { client.send() }, 'send')
+    }, 'Disallow origin: ' + origin.replace('\0', '\\0'));
+}
+
+shouldFail(location.protocol + &quot;//&quot; + SUBDOMAIN + &quot;.&quot; + location.host)
+shouldFail(&quot;//&quot; + location.host)
+shouldFail(&quot;://&quot; + location.host)
+shouldFail(&quot;ftp://&quot; + location.host)
+shouldFail(&quot;http:://&quot; + location.host)
+shouldFail(&quot;http:/&quot; + location.host)
+shouldFail(&quot;http:&quot; + location.host)
+shouldFail(location.host)
+shouldFail(location.protocol + &quot;//&quot; + location.host + &quot;?&quot;)
+shouldFail(location.protocol + &quot;//&quot; + location.host + &quot;/&quot;)
+shouldFail(location.protocol + &quot;//&quot; + location.host + &quot; /&quot;)
+shouldFail(location.protocol + &quot;//&quot; + location.host + &quot;#&quot;)
+shouldFail(location.protocol + &quot;//&quot; + location.host + &quot;%23&quot;)
+shouldFail(location.protocol + &quot;//&quot; + location.host + &quot;:80&quot;)
+shouldFail(location.protocol + &quot;//&quot; + location.host + &quot;, *&quot;)
+shouldFail(location.protocol + &quot;//&quot; + location.host + &quot;\0&quot;)
+shouldFail((location.protocol + &quot;//&quot; + location.host).toUpperCase())
+shouldFail(location.protocol.toUpperCase() + &quot;//&quot; + location.host)
+shouldFail(&quot;-&quot;)
+shouldFail(&quot;**&quot;)
+shouldFail(&quot;\0*&quot;)
+shouldFail(&quot;*\0&quot;)
+shouldFail(&quot;'*'&quot;)
+shouldFail('&quot;*&quot;')
+shouldFail(&quot;* *&quot;)
+shouldFail(&quot;*&quot; + location.protocol + &quot;//&quot; + &quot;*&quot;)
+shouldFail(&quot;*&quot; + location.protocol + &quot;//&quot; + location.host)
+shouldFail(&quot;* &quot; + location.protocol + &quot;//&quot; + location.host)
+shouldFail(&quot;*, &quot; + location.protocol + &quot;//&quot; + location.host)
+shouldFail(&quot;\0&quot; + location.protocol + &quot;//&quot; + location.host)
+shouldFail(&quot;null &quot; + location.protocol + &quot;//&quot; + location.host)
+shouldFail('http://example.net')
+shouldFail('null')
+shouldFail('')
+shouldFail(location.href)
+shouldFail(dirname(location.href))
+shouldFail(CROSSDOMAIN)
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsbasicexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/basic-expected.txt (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/basic-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/basic-expected.txt        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?get_value=hest_er_best&amp;origin=none&amp;1
+CONSOLE MESSAGE: line 49: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?get_value=hest_er_best&amp;origin=none&amp;1 due to access control checks.
+Blocked access to external URL http://www1.localhost:8801/cors/resources/cors-makeheader.py?get_value=hest_er_best&amp;origin=none&amp;3
+CONSOLE MESSAGE: line 49: XMLHttpRequest cannot load http://www1.localhost:8801/cors/resources/cors-makeheader.py?get_value=hest_er_best&amp;origin=none&amp;3 due to access control checks.
+Blocked access to external URL https://www1.localhost:9443/cors/resources/cors-makeheader.py?get_value=hest_er_best&amp;origin=none&amp;4
+CONSOLE MESSAGE: line 49: XMLHttpRequest cannot load https://www1.localhost:9443/cors/resources/cors-makeheader.py?get_value=hest_er_best&amp;origin=none&amp;4 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?get_value=hest_er_best&amp;1
+CONSOLE MESSAGE: line 47: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?get_value=hest_er_best&amp;1 due to access control checks.
+Blocked access to external URL http://www1.localhost:8801/cors/resources/cors-makeheader.py?get_value=hest_er_best&amp;3
+CONSOLE MESSAGE: line 47: XMLHttpRequest cannot load http://www1.localhost:8801/cors/resources/cors-makeheader.py?get_value=hest_er_best&amp;3 due to access control checks.
+Blocked access to external URL https://www1.localhost:9443/cors/resources/cors-makeheader.py?get_value=hest_er_best&amp;4
+CONSOLE MESSAGE: line 47: XMLHttpRequest cannot load https://www1.localhost:9443/cors/resources/cors-makeheader.py?get_value=hest_er_best&amp;4 due to access control checks.
+CONSOLE MESSAGE: Origin http://localhost:8800 is not allowed by Access-Control-Allow-Origin.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://localhost:8801/cors/resources/cors-makeheader.py?get_value=hest_er_best&amp;origin=none&amp;2 due to access control checks.
+
+PASS Same domain basic usage 
+FAIL Cross domain basic usage assert_true: Got CORS-allowed response expected true got false
+PASS Same domain different port 
+FAIL Cross domain different port assert_true: Got CORS-allowed response expected true got false
+FAIL Cross domain different protocol assert_true: Got CORS-allowed response expected true got false
+FAIL Same domain different protocol different port assert_true: Got CORS-allowed response expected true got false
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsbasichtm"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/basic.htm (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/basic.htm                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/basic.htm        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;title&gt;Basic CORS&lt;/title&gt;
+&lt;link rel=help href=https://fetch.spec.whatwg.org/&gt;
+&lt;meta name=author title=&quot;Odin Hørthe Omdal&quot; href=&quot;mailto:odiho@opera.com&quot;&gt;
+
+&lt;script src=/resources/testharness.js&gt;&lt;/script&gt;
+&lt;script src=/resources/testharnessreport.js&gt;&lt;/script&gt;
+&lt;script src=support.js?pipe=sub&gt;&lt;/script&gt;
+&lt;div id=log&gt;&lt;/div&gt;
+
+&lt;script&gt;
+
+var counter = 0;
+
+function cors(desc, scheme, subdomain, port) {
+    if (!scheme) {
+        var url = &quot;&quot;;
+    } else {
+        if (!port) {
+            port = location.port;
+        }
+        var url = scheme + &quot;://&quot; + (subdomain ? subdomain + &quot;.&quot; : &quot;&quot;) + location.hostname + &quot;:&quot; + port + dirname(location.pathname)
+    }
+    async_test(desc).step(function() {
+        var client = new XMLHttpRequest();
+        this.count = counter++;
+
+        client.open(&quot;GET&quot;, url + &quot;resources/cors-makeheader.py?get_value=hest_er_best&amp;origin=none&amp;&quot; + this.count);
+
+        client.onreadystatechange = this.step_func(function(e) {
+            // First request, test that it fails with no origin
+            if (client.readyState &lt; 4) return;
+            if (!url)
+                assert_true(client.response.indexOf(&quot;hest_er_best&quot;) != -1, &quot;Got response&quot;);
+            else
+                assert_false(!!client.response, &quot;Got CORS-disallowed response&quot;);
+
+            client = new XMLHttpRequest();
+            client.open(&quot;GET&quot;, url + &quot;resources/cors-makeheader.py?get_value=hest_er_best&amp;&quot; + this.count);
+            client.onreadystatechange = this.step_func(function(e) {
+                // Second request, test that it passes with the allowed-origin
+                if (client.readyState &lt; 4) return;
+                assert_true(client.response.indexOf(&quot;hest_er_best&quot;) != -1, &quot;Got CORS-allowed response&quot;);
+                this.done();
+            });
+            client.send();
+        });
+        client.send();
+    });
+}
+
+cors(&quot;Same domain basic usage&quot;);
+cors(&quot;Cross domain basic usage&quot;, &quot;http&quot;, &quot;www1&quot;);
+cors(&quot;Same domain different port&quot;, &quot;http&quot;, undefined, PORT);
+
+cors(&quot;Cross domain different port&quot;, &quot;http&quot;, &quot;www1&quot;, PORT);
+
+cors(&quot;Cross domain different protocol&quot;, &quot;https&quot;, &quot;www1&quot;, PORTS);
+
+cors(&quot;Same domain different protocol different port&quot;, &quot;https&quot;, undefined, PORTS);
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorscredentialsflagexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/credentials-flag-expected.txt (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/credentials-flag-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/credentials-flag-expected.txt        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-cookie.py?ident=1489438094875_1
+CONSOLE MESSAGE: line 40: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-cookie.py?ident=1489438094875_1 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-cookie.py?ident=1489438094877_2
+CONSOLE MESSAGE: line 70: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-cookie.py?ident=1489438094877_2 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-cookie.py?ident=1489438094879_3
+CONSOLE MESSAGE: line 100: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-cookie.py?ident=1489438094879_3 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?credentials=TRUE
+CONSOLE MESSAGE: line 118: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?credentials=TRUE due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?credentials=True
+CONSOLE MESSAGE: line 118: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?credentials=True due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?credentials=%22true%22
+CONSOLE MESSAGE: line 118: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?credentials=%22true%22 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?credentials=false
+CONSOLE MESSAGE: line 118: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?credentials=false due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?credentials=1
+CONSOLE MESSAGE: line 118: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?credentials=1 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?credentials=0
+CONSOLE MESSAGE: line 118: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?credentials=0 due to access control checks.
+CORS - Access-Control-Allow-Credentials
+
+
+Harness Error (TIMEOUT), message = null
+
+PASS Setting withCredentials on a sync XHR object should not throw 
+TIMEOUT Don't send cookie by default Test timed out
+TIMEOUT Don't send cookie part 2 Test timed out
+TIMEOUT Don't obey Set-Cookie when withCredentials=false Test timed out
+PASS Access-Control-Allow-Credentials: TRUE should be disallowed (async) 
+PASS Access-Control-Allow-Credentials: True should be disallowed (async) 
+PASS Access-Control-Allow-Credentials: &quot;true&quot; should be disallowed (async) 
+PASS Access-Control-Allow-Credentials: false should be disallowed (async) 
+PASS Access-Control-Allow-Credentials: 1 should be disallowed (async) 
+PASS Access-Control-Allow-Credentials: 0 should be disallowed (async) 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorscredentialsflaghtm"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/credentials-flag.htm (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/credentials-flag.htm                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/credentials-flag.htm        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,129 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;title&gt;CORS - Access-Control-Allow-Credentials&lt;/title&gt;
+&lt;meta name=author title=&quot;Odin Hørthe Omdal&quot; href=&quot;mailto:odiho@opera.com&quot;&gt;
+
+&lt;script src=/resources/testharness.js&gt;&lt;/script&gt;
+&lt;script src=/resources/testharnessreport.js&gt;&lt;/script&gt;
+&lt;script src=support.js?pipe=sub&gt;&lt;/script&gt;
+
+&lt;h1&gt;CORS - Access-Control-Allow-Credentials&lt;/h1&gt;
+&lt;div id=log&gt;&lt;/div&gt;
+&lt;script&gt;
+
+var url = CROSSDOMAIN + 'resources/cors-cookie.py?ident='
+
+
+/*
+ * widthCredentials
+ */
+// XXX Do some https tests here as well
+
+test(function () {
+    var client = new XMLHttpRequest()
+    client.open('GET', CROSSDOMAIN, false)
+    client.withCredentials = true;
+}, 'Setting withCredentials on a sync XHR object should not throw')
+
+async_test(function () {
+    var id = new Date().getTime() + '_1',
+        client = new XMLHttpRequest()
+    client.open(&quot;GET&quot;, url + id, true)
+    client.onload = this.step_func(function() {
+        assert_equals(client.response, &quot;NO_COOKIE&quot;)
+        client.open(&quot;GET&quot;, url + id, true)
+        client.onload = this.step_func(function() {
+            assert_equals(client.response, &quot;NO_COOKIE&quot;)
+            this.done()
+        })
+        client.send(null)
+    })
+    client.send(null)
+
+}, &quot;Don't send cookie by default&quot;);
+
+async_test(function () {
+    var id = new Date().getTime() + '_2',
+        client = new XMLHttpRequest()
+
+    client.open(&quot;GET&quot;, url + id, true)
+    client.withCredentials = true
+    client.onload = this.step_func(function() {
+        assert_equals(client.response, &quot;NO_COOKIE&quot;, &quot;No cookie in initial request&quot;);
+
+        /* We have cookie, but the browser shouldn't send */
+        client.open(&quot;GET&quot;, url + id, true)
+        client.withCredentials = false
+        client.onload = this.step_func(function() {
+            assert_equals(client.response, &quot;NO_COOKIE&quot;, &quot;No cookie after withCredentials=false sync request&quot;)
+
+            /* Reads and deletes the cookie */
+            client.open(&quot;GET&quot;, url + id, true)
+            client.withCredentials = true
+            client.onload = this.step_func(function() {
+                assert_equals(client.response, &quot;COOKIE&quot;, &quot;Cookie sent in withCredentials=true sync request&quot;)
+                this.done()
+            })
+            client.send(null)
+        })
+        client.send(null)
+    })
+    client.send(null)
+}, &quot;Don't send cookie part 2&quot;);
+
+async_test(function () {
+    var id = new Date().getTime() + '_3',
+        client = new XMLHttpRequest()
+
+    /* Shouldn't set the response cookie */
+    client.open(&quot;GET&quot;, url + id, true)
+    client.withCredentials = false
+    client.onload = this.step_func(function() {
+        assert_equals(client.response, &quot;NO_COOKIE&quot;, &quot;first&quot;);
+
+        /* Sets the cookie */
+        client.open(&quot;GET&quot;, url + id, true)
+        client.withCredentials = true
+        client.onload = this.step_func(function() {
+            assert_equals(client.response, &quot;NO_COOKIE&quot;, &quot;second&quot;)
+
+            /* Reads and deletes the cookie */
+            client.open(&quot;GET&quot;, url + id, true)
+            client.withCredentials = true
+            client.onload = this.step_func(function() {
+                assert_equals(client.response, &quot;COOKIE&quot;, &quot;third&quot;)
+                this.done()
+            })
+            client.send(null)
+        })
+        client.send(null)
+    })
+    client.send(null)
+}, &quot;Don't obey Set-Cookie when withCredentials=false&quot;);
+
+function test_response_header(allow) {
+    var resp_test = async_test('Access-Control-Allow-Credentials: ' + allow + ' should be disallowed (async)')
+    resp_test.step(function() {
+        var client = new XMLHttpRequest()
+        client.open('GET',
+            CROSSDOMAIN + 'resources/cors-makeheader.py?credentials=' + allow,
+            true)
+        client.withCredentials = true;
+        client.onload = resp_test.step_func(function() {
+            assert_unreached(&quot;onload&quot;)
+        })
+        client.onerror = resp_test.step_func(function () {
+            assert_equals(client.readyState, client.DONE, 'readyState')
+            resp_test.done()
+        })
+        client.send()
+    })
+}
+
+test_response_header('TRUE')
+test_response_header('True')
+test_response_header('&quot;true&quot;')
+test_response_header('false')
+test_response_header('1')
+test_response_header('0')
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorslateuploadeventsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/late-upload-events-expected.txt (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/late-upload-events-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/late-upload-events-expected.txt        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+Blocked access to external URL http://www1.localhost:8800/cors/resources/status.py?headers=custom-header
+CONSOLE MESSAGE: line 30: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?headers=custom-header due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?headers=custom-header due to access control checks.
+Adding upload event listeners after send()
+
+
+FAIL Late listeners: No preflight assert_equals: expected 200 but got 0
+FAIL Late listeners: Preflight assert_equals: expected 200 but got 0
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorslateuploadeventshtm"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/late-upload-events.htm (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/late-upload-events.htm                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/late-upload-events.htm        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;title&gt;Adding upload event listeners after send()&lt;/title&gt;
+&lt;script src=/resources/testharness.js&gt;&lt;/script&gt;
+&lt;script src=/resources/testharnessreport.js&gt;&lt;/script&gt;
+&lt;script src=support.js?pipe=sub&gt;&lt;/script&gt;
+
+&lt;h1&gt;Adding upload event listeners after send()&lt;/h1&gt;
+
+&lt;div id=log&gt;&lt;/div&gt;
+
+&lt;script&gt;
+function doTest(desc, headers) {
+    async_test(&quot;Late listeners: &quot; + desc).step(function() {
+        var client = new XMLHttpRequest();
+        var eventCounter = 0;
+        client.open(&quot;POST&quot;, CROSSDOMAIN + &quot;resources/status.py?headers=custom-header&quot;);
+
+        for (var name in headers) {
+            client.setRequestHeader(name, headers[name]);
+        }
+
+        client.onreadystatechange = this.step_func(function(e) {
+            // Irrelevant if request is not finished
+            if (client.readyState &lt; 4) return;
+            assert_equals(client.status, 200);
+            assert_equals(eventCounter, 0, 'Events fired, but should not have');
+            this.done();
+        });
+        client.send((new Array(3000)).join('xo'));
+        client.upload.onprogress = client.upload.onloadend = client.upload.onloadstart = client.upload.onload = this.step_func(function(e) {
+            eventCounter++;
+            assert_unreached(&quot;Upload events should not fire, but did: &quot; + e.type);
+        });
+    });
+}
+
+doTest(&quot;No preflight&quot;, {});
+doTest(&quot;Preflight&quot;, {&quot;custom-header&quot;:&quot;test&quot;});
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsoriginexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/origin-expected.txt (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/origin-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/origin-expected.txt        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,120 @@
</span><ins>+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=*
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=%20*%20%20
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=%09*
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=%20http%3A%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=%20http%3A%2F%2Flocalhost%3A8800%20%20%20%09%20
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=%09http%3A%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Fwww1.localhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=%3A%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=ftp%3A%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%3A%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3Alocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=localhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Flocalhost%3A8800%3F
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Flocalhost%3A8800%2F
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Flocalhost%3A8800%20%2F
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Flocalhost%3A8800%23
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Flocalhost%3A8800%2523
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Flocalhost%3A8800%3A80
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Flocalhost%3A8800%2C%20*
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Flocalhost%3A8800%00
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=HTTP%3A%2F%2FLOCALHOST%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=HTTP%3A%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=-
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=**
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=%00*
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=*%00
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin='*'
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=%22*%22
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=*%20*
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=*%20null
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=*http%3A%2F%2F*
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=*http%3A%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=*%20http%3A%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=*%2C%20http%3A%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=%00http%3A%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=null%20http%3A%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Fexample.net
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=null
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=null%20*
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Flocalhost%3A8800%2Fcors%2Forigin.htm
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Flocalhost%3A8800%2Fcors%2F
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2F
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=localhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=.localhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=*.localhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2F.localhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2F*.localhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=&amp;origin2=*
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=*&amp;origin2=
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=*&amp;origin2=*
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=&amp;origin2=http%3A%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=*&amp;origin2=http%3A%2F%2Flocalhost%3A8800
+Blocked access to external URL http://www1.localhost:8800/cors//resources/cors-makeheader.py?origin=http%3A%2F%2Flocalhost%3A8800&amp;origin2=http%3A%2F%2Flocalhost%3A8800
+Access-Control-Allow-Origin handling
+
+
+FAIL Allow origin: * The operation was aborted.
+FAIL Allow origin: _*__ The operation was aborted.
+FAIL Allow origin: [tab]* The operation was aborted.
+FAIL Allow origin: http://localhost:8800 The operation was aborted.
+FAIL Allow origin: _http://localhost:8800 The operation was aborted.
+FAIL Allow origin: _http://localhost:8800___[tab]_ The operation was aborted.
+FAIL Allow origin: [tab]http://localhost:8800 The operation was aborted.
+PASS Disallow origin: http://www1.localhost:8800 
+PASS Disallow origin: //localhost:8800 
+PASS Disallow origin: ://localhost:8800 
+PASS Disallow origin: ftp://localhost:8800 
+PASS Disallow origin: http:://localhost:8800 
+PASS Disallow origin: http:/localhost:8800 
+PASS Disallow origin: http:localhost:8800 
+PASS Disallow origin: localhost:8800 
+PASS Disallow origin: http://localhost:8800? 
+PASS Disallow origin: http://localhost:8800/ 
+PASS Disallow origin: http://localhost:8800 / 
+PASS Disallow origin: http://localhost:8800# 
+PASS Disallow origin: http://localhost:8800%23 
+PASS Disallow origin: http://localhost:8800:80 
+PASS Disallow origin: http://localhost:8800, * 
+PASS Disallow origin: http://localhost:8800\0 
+PASS Disallow origin: HTTP://LOCALHOST:8800 
+PASS Disallow origin: HTTP://localhost:8800 
+PASS Disallow origin: - 
+PASS Disallow origin: ** 
+PASS Disallow origin: \0* 
+PASS Disallow origin: *\0 
+PASS Disallow origin: '*' 
+PASS Disallow origin: &quot;*&quot; 
+PASS Disallow origin: * * 
+PASS Disallow origin: * null 
+PASS Disallow origin: *http://* 
+PASS Disallow origin: *http://localhost:8800 
+PASS Disallow origin: * http://localhost:8800 
+PASS Disallow origin: *, http://localhost:8800 
+PASS Disallow origin: \0http://localhost:8800 
+PASS Disallow origin: null http://localhost:8800 
+PASS Disallow origin: http://example.net 
+PASS Disallow origin: null 
+PASS Disallow origin: null * 
+PASS Disallow origin:  
+PASS Disallow origin: http://localhost:8800/cors/origin.htm 
+PASS Disallow origin: http://localhost:8800/cors/ 
+PASS Disallow origin: http://www1.localhost:8800/cors/ 
+PASS Disallow origin: localhost:8800 
+PASS Disallow origin: .localhost:8800 
+PASS Disallow origin: *.localhost:8800 
+PASS Disallow origin: http://localhost:8800 
+PASS Disallow origin: http://.localhost:8800 
+PASS Disallow origin: http://*.localhost:8800 
+PASS Disallow multiple headers (, *) 
+PASS Disallow multiple headers (*, ) 
+PASS Disallow multiple headers (*, *) 
+PASS Disallow multiple headers (, http://localhost:8800) 
+PASS Disallow multiple headers (*, http://localhost:8800) 
+PASS Disallow multiple headers (http://localhost:8800, http://localhost:8800) 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsoriginhtm"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/origin.htm (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/origin.htm                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/origin.htm        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,119 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;title&gt;Access-Control-Allow-Origin handling&lt;/title&gt;
+&lt;link rel=help href=https://fetch.spec.whatwg.org/&gt;
+&lt;meta name=author title=&quot;Odin Hørthe Omdal&quot; href=&quot;mailto:odiho@opera.com&quot;&gt;
+
+&lt;script src=/resources/testharness.js&gt;&lt;/script&gt;
+&lt;script src=/resources/testharnessreport.js&gt;&lt;/script&gt;
+&lt;script src=support.js?pipe=sub&gt;&lt;/script&gt;
+
+&lt;h1&gt;Access-Control-Allow-Origin handling&lt;/h1&gt;
+
+&lt;div id=log&gt;&lt;/div&gt;
+
+&lt;script&gt;
+
+/*
+ * Origin header
+ */
+function shouldPass(origin) {
+    test(function () {
+        var client = new XMLHttpRequest()
+        client.open('GET', CROSSDOMAIN
+                            + '/resources/cors-makeheader.py?origin='
+                            + encodeURIComponent(origin),
+                    false)
+        client.send()
+        r = JSON.parse(client.response)
+        var host = location.protocol + &quot;//&quot; + location.host
+        assert_equals(r['origin'], host, 'Request Origin: should be ' + host)
+    }, 'Allow origin: ' + origin.replace(/\t/g, &quot;[tab]&quot;).replace(/ /g, '_'));
+}
+
+shouldPass('*');
+shouldPass(' *  ');
+shouldPass('        *');
+shouldPass(location.protocol + &quot;//&quot; + location.host);
+shouldPass(&quot; &quot;+location.protocol + &quot;//&quot; + location.host);
+shouldPass(&quot; &quot;+location.protocol + &quot;//&quot; + location.host + &quot;            &quot;);
+shouldPass(&quot;        &quot;+location.protocol + &quot;//&quot; + location.host);
+
+
+function shouldFail(origin) {
+    test(function () {
+        var client = new XMLHttpRequest()
+        client.open('GET', CROSSDOMAIN
+                            + '/resources/cors-makeheader.py?origin='
+                            + encodeURIComponent(origin),
+                    false)
+        assert_throws(null, function() { client.send() }, 'send')
+    }, 'Disallow origin: ' + origin.replace(/\0/g, &quot;\\0&quot;));
+}
+
+shouldFail(location.protocol + &quot;//&quot; + SUBDOMAIN + &quot;.&quot; + location.host)
+shouldFail(&quot;//&quot; + location.host)
+shouldFail(&quot;://&quot; + location.host)
+shouldFail(&quot;ftp://&quot; + location.host)
+shouldFail(&quot;http:://&quot; + location.host)
+shouldFail(&quot;http:/&quot; + location.host)
+shouldFail(&quot;http:&quot; + location.host)
+shouldFail(location.host)
+shouldFail(location.protocol + &quot;//&quot; + location.host + &quot;?&quot;)
+shouldFail(location.protocol + &quot;//&quot; + location.host + &quot;/&quot;)
+shouldFail(location.protocol + &quot;//&quot; + location.host + &quot; /&quot;)
+shouldFail(location.protocol + &quot;//&quot; + location.host + &quot;#&quot;)
+shouldFail(location.protocol + &quot;//&quot; + location.host + &quot;%23&quot;)
+shouldFail(location.protocol + &quot;//&quot; + location.host + &quot;:80&quot;)
+shouldFail(location.protocol + &quot;//&quot; + location.host + &quot;, *&quot;)
+shouldFail(location.protocol + &quot;//&quot; + location.host + &quot;\0&quot;)
+shouldFail((location.protocol + &quot;//&quot; + location.host).toUpperCase())
+shouldFail(location.protocol.toUpperCase() + &quot;//&quot; + location.host)
+shouldFail(&quot;-&quot;)
+shouldFail(&quot;**&quot;)
+shouldFail(&quot;\0*&quot;)
+shouldFail(&quot;*\0&quot;)
+shouldFail(&quot;'*'&quot;)
+shouldFail('&quot;*&quot;')
+shouldFail(&quot;* *&quot;)
+shouldFail(&quot;* null&quot;)
+shouldFail(&quot;*&quot; + location.protocol + &quot;//&quot; + &quot;*&quot;)
+shouldFail(&quot;*&quot; + location.protocol + &quot;//&quot; + location.host)
+shouldFail(&quot;* &quot; + location.protocol + &quot;//&quot; + location.host)
+shouldFail(&quot;*, &quot; + location.protocol + &quot;//&quot; + location.host)
+shouldFail(&quot;\0&quot; + location.protocol + &quot;//&quot; + location.host)
+shouldFail(&quot;null &quot; + location.protocol + &quot;//&quot; + location.host)
+shouldFail('http://example.net')
+shouldFail('null')
+shouldFail('null *')
+shouldFail('')
+shouldFail(location.href)
+shouldFail(dirname(location.href))
+shouldFail(CROSSDOMAIN)
+shouldFail(location.host.replace(/^[^\.]+\./, &quot;&quot;))
+shouldFail(&quot;.&quot; + location.host.replace(/^[^\.]+\./, &quot;&quot;))
+shouldFail(&quot;*.&quot; + location.host.replace(/^[^\.]+\./, &quot;&quot;))
+shouldFail(&quot;http://&quot; + location.host.replace(/^[^\.]+\./, &quot;&quot;))
+shouldFail(&quot;http://.&quot; + location.host.replace(/^[^\.]+\./, &quot;&quot;))
+shouldFail(&quot;http://*.&quot; + location.host.replace(/^[^\.]+\./, &quot;&quot;))
+
+function doubleOrigin(origin, origin2) {
+    test(function () {
+        var client = new XMLHttpRequest()
+        client.open('GET', CROSSDOMAIN
+                            + '/resources/cors-makeheader.py?origin='
+                            + encodeURIComponent(origin)
+                            + '&amp;origin2=' + encodeURIComponent(origin2),
+                    false)
+        assert_throws(null, function() { client.send() }, 'send')
+    }, 'Disallow multiple headers (' + origin + ', ' + origin2 + ')');
+}
+
+doubleOrigin('', '*');
+doubleOrigin('*', '');
+doubleOrigin('*', '*');
+doubleOrigin('', location.protocol + &quot;//&quot; + location.host);
+doubleOrigin('*', location.protocol + &quot;//&quot; + location.host);
+doubleOrigin(location.protocol + &quot;//&quot; + location.host, location.protocol + &quot;//&quot; + location.host);
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorspreflightcacheexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/preflight-cache-expected.txt (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/preflight-cache-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/preflight-cache-expected.txt        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+Blocked access to external URL http://www1.localhost:8800/cors/resources/preflight.py?token=7ec9a471-9f36-47f4-8d2b-82be1a6ebd87
+CONSOLE MESSAGE: line 34: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/preflight.py?token=7ec9a471-9f36-47f4-8d2b-82be1a6ebd87 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/preflight.py?token=7875264a-b4e7-4ff5-b722-9d47a7b65d3d
+CONSOLE MESSAGE: line 34: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/preflight.py?token=7875264a-b4e7-4ff5-b722-9d47a7b65d3d due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/preflight.py?token=a1b8f4df-357b-4bc2-9167-f8e4b4acdc12&amp;max_age=0
+CONSOLE MESSAGE: line 34: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/preflight.py?token=a1b8f4df-357b-4bc2-9167-f8e4b4acdc12&amp;max_age=0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/preflight.py?token=0328e3a7-7b6e-41d4-9ad3-7229edf8fae2&amp;max_age=-1
+CONSOLE MESSAGE: line 34: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/preflight.py?token=0328e3a7-7b6e-41d4-9ad3-7229edf8fae2&amp;max_age=-1 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/preflight.py?max_age=1&amp;token=e9729b23-4089-4d28-8cee-6a3c547664ca due to access control checks.
+Preflight cache
+
+
+FAIL Test preflight  A network error occurred.
+FAIL preflight for x-print should be cached  A network error occurred.
+FAIL age = 0, should not be cached  A network error occurred.
+FAIL age = -1, should not be cached  A network error occurred.
+FAIL preflight first request, second from cache, wait, third should preflight again assert_unreached: Got unexpected error event on the XHR object Reached unreachable code
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorspreflightcachehtm"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/preflight-cache.htm (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/preflight-cache.htm                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/preflight-cache.htm        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,140 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;title&gt;CORS - preflight cache&lt;/title&gt;
+&lt;meta name=author title=&quot;Odin Hørthe Omdal&quot; href=&quot;mailto:odiho@opera.com&quot;&gt;
+
+&lt;script src=/resources/testharness.js&gt;&lt;/script&gt;
+&lt;script src=/resources/testharnessreport.js&gt;&lt;/script&gt;
+&lt;script src=/common/utils.js&gt;&lt;/script&gt;
+&lt;script src=support.js?pipe=sub&gt;&lt;/script&gt;
+
+&lt;h1&gt;Preflight cache&lt;/h1&gt;
+
+&lt;div id=log&gt;&lt;/div&gt;
+&lt;script&gt;
+
+/*
+ * Cache
+ */
+
+function did_preflight(expect, client, settings) {
+    var uuid_token = (settings &amp;&amp; settings.token) || token();
+    if(!settings)
+        settings = {}
+
+    set = {
+        method: 'method' in settings ? settings.method : 'GET',
+        extra: 'extra' in settings ? '&amp;' + settings.extra : ''
+    }
+
+    client.open(set.method,
+            CROSSDOMAIN + 'resources/preflight.py?token=' + uuid_token + set.extra,
+            false)
+    client.setRequestHeader('x-print', uuid_token)
+    client.send()
+
+    client.open('GET', 'resources/preflight.py?check&amp;token=' + uuid_token, false)
+    client.send()
+    assert_equals(client.response, expect === true ? '1' : '0', &quot;did preflight&quot;)
+    return uuid_token;
+}
+
+/*
+ * Should run preflight
+ */
+
+test(function() {
+    var time = new Date().getTime()
+    var client = new XMLHttpRequest()
+    did_preflight(true, client);
+},
+'Test preflight')
+
+test(function() {
+    var time = new Date().getTime()
+    var client = new XMLHttpRequest()
+
+    var id = did_preflight(true,  client)
+    did_preflight(false, client, {token: id})
+},
+'preflight for x-print should be cached')
+
+test(function() {
+    var time = new Date().getTime()
+    var client = new XMLHttpRequest()
+
+    var id = did_preflight(true, client, {extra:'max_age=0'})
+    did_preflight(true, client, {extra:'max_age=0', token: id})
+},
+'age = 0, should not be cached')
+
+test(function() {
+    var time = new Date().getTime()
+    var client = new XMLHttpRequest()
+
+    var id = did_preflight(true, client, {extra:'max_age=-1'})
+    did_preflight(true, client, {extra:'max_age=-1', token: id})
+},
+'age = -1, should not be cached');
+
+(function() {
+    var test = async_test(&quot;preflight first request, second from cache, wait, third should preflight again&quot;, { timeout: 6000 }),
+        time = new Date().getTime(),
+        dothing = function (url, msg, set_request, func) {
+            client = new XMLHttpRequest(),
+            client.open('GET', url, true)
+            if (set_request)
+                client.setRequestHeader('x-print', msg)
+            client.onload = test.step_func(function() {
+                assert_equals(client.response, msg, &quot;response &quot; + url)
+                if (func)
+                    test.step(func)
+            })
+            client.onerror = test.step_func(function(e) {
+                assert_unreached(&quot;Got unexpected error event on the XHR object&quot;)
+            })
+            client.send()
+        }
+
+    var token1 = token();
+    test.step(function() {
+        /* First cycle, gets x-print into the cache, with timeout 1 */
+        var request_url = CROSSDOMAIN + 'resources/preflight.py?max_age=1&amp;token=' + token1;
+        dothing(request_url,
+        'first', true, function() {
+            test = test;
+
+            /* Check if we did a preflight like we expected */
+            dothing('resources/preflight.py?check&amp;1&amp;token=' + token1,
+            '1', false, function() {
+                test = test;
+                dothing(request_url,
+                'second', true, function() {
+                    test = test;
+
+                    /* Check that we didn't do a preflight (hasn't gone 1 second yet) */
+                    dothing('resources/preflight.py?check&amp;2&amp;token=' + token1,
+                    '0', false, function() {
+                        test = test;
+
+                        /* Wait until the preflight cache age is old (and thus cleared) */
+                        test.step_timeout(() =&gt; {
+                            dothing(request_url,
+                            'third', true, function() {
+                                test = test;
+
+                                /* Expect that we did indeed do a preflight */
+                                dothing('resources/preflight.py?check&amp;3&amp;token=' + token1,
+                                '1', false, function() {
+                                    test.done()
+                                })
+                            })
+                        }, 1500)
+                    })
+                })
+            })
+        })
+    })
+})();
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorspreflightfailureexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/preflight-failure-expected.txt (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/preflight-failure-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/preflight-failure-expected.txt        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,74 @@
</span><ins>+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%260&amp;code=100&amp;preflight=100&amp;1 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%262&amp;code=101&amp;preflight=101&amp;3 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%264&amp;code=300&amp;preflight=300&amp;5 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%266&amp;code=301&amp;preflight=301&amp;7 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%268&amp;code=302&amp;preflight=302&amp;9 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2610&amp;code=303&amp;preflight=303&amp;11 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2612&amp;code=304&amp;preflight=304&amp;13 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2614&amp;code=305&amp;preflight=305&amp;15 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2616&amp;code=306&amp;preflight=306&amp;17 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2618&amp;code=307&amp;preflight=307&amp;19 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2620&amp;code=308&amp;preflight=308&amp;21 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2622&amp;code=400&amp;preflight=400&amp;23 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2624&amp;code=401&amp;preflight=401&amp;25 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2626&amp;code=402&amp;preflight=402&amp;27 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2628&amp;code=403&amp;preflight=403&amp;29 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2630&amp;code=404&amp;preflight=404&amp;31 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2632&amp;code=405&amp;preflight=405&amp;33 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2634&amp;code=406&amp;preflight=406&amp;35 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2636&amp;code=407&amp;preflight=407&amp;37 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2638&amp;code=408&amp;preflight=408&amp;39 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2640&amp;code=409&amp;preflight=409&amp;41 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2642&amp;code=410&amp;preflight=410&amp;43 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2644&amp;code=411&amp;preflight=411&amp;45 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2646&amp;code=412&amp;preflight=412&amp;47 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2648&amp;code=413&amp;preflight=413&amp;49 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2650&amp;code=414&amp;preflight=414&amp;51 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2652&amp;code=415&amp;preflight=415&amp;53 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2654&amp;code=416&amp;preflight=416&amp;55 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2656&amp;code=417&amp;preflight=417&amp;57 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2658&amp;code=500&amp;preflight=500&amp;59 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2660&amp;code=501&amp;preflight=501&amp;61 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2662&amp;code=502&amp;preflight=502&amp;63 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2664&amp;code=503&amp;preflight=503&amp;65 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2666&amp;code=504&amp;preflight=504&amp;67 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%2668&amp;code=505&amp;preflight=505&amp;69 due to access control checks.
+Preflight responds with non-2XX status code
+
+
+PASS Should throw error if preflight respond with 100 
+PASS Should throw error if preflight respond with 101 
+PASS Should throw error if preflight respond with 300 
+PASS Should throw error if preflight respond with 301 
+PASS Should throw error if preflight respond with 302 
+PASS Should throw error if preflight respond with 303 
+PASS Should throw error if preflight respond with 304 
+PASS Should throw error if preflight respond with 305 
+PASS Should throw error if preflight respond with 306 
+PASS Should throw error if preflight respond with 307 
+PASS Should throw error if preflight respond with 308 
+PASS Should throw error if preflight respond with 400 
+PASS Should throw error if preflight respond with 401 
+PASS Should throw error if preflight respond with 402 
+PASS Should throw error if preflight respond with 403 
+PASS Should throw error if preflight respond with 404 
+PASS Should throw error if preflight respond with 405 
+PASS Should throw error if preflight respond with 406 
+PASS Should throw error if preflight respond with 407 
+PASS Should throw error if preflight respond with 408 
+PASS Should throw error if preflight respond with 409 
+PASS Should throw error if preflight respond with 410 
+PASS Should throw error if preflight respond with 411 
+PASS Should throw error if preflight respond with 412 
+PASS Should throw error if preflight respond with 413 
+PASS Should throw error if preflight respond with 414 
+PASS Should throw error if preflight respond with 415 
+PASS Should throw error if preflight respond with 416 
+PASS Should throw error if preflight respond with 417 
+PASS Should throw error if preflight respond with 500 
+PASS Should throw error if preflight respond with 501 
+PASS Should throw error if preflight respond with 502 
+PASS Should throw error if preflight respond with 503 
+PASS Should throw error if preflight respond with 504 
+PASS Should throw error if preflight respond with 505 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorspreflightfailurehtm"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/preflight-failure.htm (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/preflight-failure.htm                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/preflight-failure.htm        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;title&gt;CORS - Preflight responds with non-2XX status code&lt;/title&gt;
+&lt;meta name=author title=&quot;Fernando Jiménez Moreno&quot; href=&quot;mailto:ferjmoreno@gmail.com&quot;&gt;
+
+&lt;script src=/resources/testharness.js&gt;&lt;/script&gt;
+&lt;script src=/resources/testharnessreport.js&gt;&lt;/script&gt;
+&lt;script src=support.js?pipe=sub&gt;&lt;/script&gt;
+
+&lt;h1&gt;Preflight responds with non-2XX status code&lt;/h1&gt;
+
+&lt;div id=log&gt;&lt;/div&gt;
+&lt;script&gt;
+
+// Request count for cache busting and easy identifying of request in traffic
+// analyzer.
+var req_c = 0;
+
+var CROSSDOMAIN_URL = CROSSDOMAIN + 'resources/cors-makeheader.py?';
+
+/*
+ * Redirection with preflights.
+ */
+function preflight_failure(code) {
+  var desc = 'Should throw error if preflight respond with ' + code;
+  async_test(desc).step(function() {
+    var client = new XMLHttpRequest();
+    var redirect =
+      encodeURIComponent(CROSSDOMAIN_URL + 'headers=x-test&amp;' + req_c++);
+
+    client.open('GET',
+        CROSSDOMAIN_URL + 'headers=x-test&amp;location=' + redirect
+        + '&amp;code=' + code + '&amp;preflight=' + code
+        + '&amp;' + req_c++,
+        true /* async */);
+    client.setRequestHeader('x-test', 'test');
+    client.onerror = this.step_func(function() {
+      this.done();
+    });
+    client.onreadystatechange = this.step_func(function() {
+      assert_equals(client.status, 0);
+    });
+    client.onload = this.step_func(function() {
+      assert_unreached('Unexpected onload');
+    });
+    client.send(null);
+  });
+}
+[100, 101,
+ 300, 301, 302, 303, 304, 305, 306, 307, 308,
+ 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417,
+ 500, 501, 502, 503, 504, 505].forEach(preflight_failure);
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsredirectoriginexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-origin-expected.txt (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-origin-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-origin-expected.txt        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,133 @@
</span><ins>+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Flocalhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3D*%26get_value%3Dlast%2610_1&amp;10_0
+CONSOLE MESSAGE: line 144: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Flocalhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3D*%26get_value%3Dlast%2610_1&amp;10_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Flocalhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dhttp%3A%2F%2Flocalhost%3A8800%26get_value%3Dlast%2611_1&amp;11_0
+CONSOLE MESSAGE: line 168: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Flocalhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dhttp%3A%2F%2Flocalhost%3A8800%26get_value%3Dlast%2611_1&amp;11_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Flocalhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dnull%26get_value%3Dlast%2612_1&amp;12_0
+CONSOLE MESSAGE: line 144: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Flocalhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dnull%26get_value%3Dlast%2612_1&amp;12_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Flocalhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dnone%26get_value%3Dlast%2613_1&amp;13_0
+CONSOLE MESSAGE: line 168: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Flocalhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dnone%26get_value%3Dlast%2613_1&amp;13_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;location=http%3A%2F%2Flocalhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3D*%26get_value%3Dlast%2614_1&amp;14_0
+CONSOLE MESSAGE: line 144: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;location=http%3A%2F%2Flocalhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3D*%26get_value%3Dlast%2614_1&amp;14_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;location=http%3A%2F%2Flocalhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dhttp%3A%2F%2Flocalhost%3A8800%26get_value%3Dlast%2615_1&amp;15_0
+CONSOLE MESSAGE: line 168: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;location=http%3A%2F%2Flocalhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dhttp%3A%2F%2Flocalhost%3A8800%26get_value%3Dlast%2615_1&amp;15_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;location=http%3A%2F%2Flocalhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dnull%26get_value%3Dlast%2616_1&amp;16_0
+CONSOLE MESSAGE: line 144: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;location=http%3A%2F%2Flocalhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dnull%26get_value%3Dlast%2616_1&amp;16_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;location=http%3A%2F%2Flocalhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dnone%26get_value%3Dlast%2617_1&amp;17_0
+CONSOLE MESSAGE: line 168: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;location=http%3A%2F%2Flocalhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dnone%26get_value%3Dlast%2617_1&amp;17_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=null&amp;location=http%3A%2F%2Flocalhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3D*%26get_value%3Dlast%2618_1&amp;18_0
+CONSOLE MESSAGE: line 168: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=null&amp;location=http%3A%2F%2Flocalhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3D*%26get_value%3Dlast%2618_1&amp;18_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=none&amp;location=http%3A%2F%2Flocalhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3D*%26get_value%3Dlast%2619_1&amp;19_0
+CONSOLE MESSAGE: line 168: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=none&amp;location=http%3A%2F%2Flocalhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3D*%26get_value%3Dlast%2619_1&amp;19_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3D*%26get_value%3Dlast%2620_1&amp;20_0
+CONSOLE MESSAGE: line 144: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3D*%26get_value%3Dlast%2620_1&amp;20_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dhttp%3A%2F%2Flocalhost%3A8800%26get_value%3Dlast%2621_1&amp;21_0
+CONSOLE MESSAGE: line 144: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dhttp%3A%2F%2Flocalhost%3A8800%26get_value%3Dlast%2621_1&amp;21_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dnull%26get_value%3Dlast%2622_1&amp;22_0
+CONSOLE MESSAGE: line 168: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dnull%26get_value%3Dlast%2622_1&amp;22_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dnone%26get_value%3Dlast%2623_1&amp;23_0
+CONSOLE MESSAGE: line 168: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dnone%26get_value%3Dlast%2623_1&amp;23_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3D*%26get_value%3Dlast%2624_1&amp;24_0
+CONSOLE MESSAGE: line 144: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3D*%26get_value%3Dlast%2624_1&amp;24_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dhttp%3A%2F%2Flocalhost%3A8800%26get_value%3Dlast%2625_1&amp;25_0
+CONSOLE MESSAGE: line 144: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dhttp%3A%2F%2Flocalhost%3A8800%26get_value%3Dlast%2625_1&amp;25_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dnull%26get_value%3Dlast%2626_1&amp;26_0
+CONSOLE MESSAGE: line 168: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dnull%26get_value%3Dlast%2626_1&amp;26_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dnone%26get_value%3Dlast%2627_1&amp;27_0
+CONSOLE MESSAGE: line 168: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dnone%26get_value%3Dlast%2627_1&amp;27_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=null&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3D*%26get_value%3Dlast%2628_1&amp;28_0
+CONSOLE MESSAGE: line 168: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=null&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3D*%26get_value%3Dlast%2628_1&amp;28_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=none&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3D*%26get_value%3Dlast%2629_1&amp;29_0
+CONSOLE MESSAGE: line 168: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=none&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3D*%26get_value%3Dlast%2629_1&amp;29_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Fwww2.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3D*%26get_value%3Dlast%2630_1&amp;30_0
+CONSOLE MESSAGE: line 144: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Fwww2.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3D*%26get_value%3Dlast%2630_1&amp;30_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Fwww2.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dhttp%3A%2F%2Flocalhost%3A8800%26get_value%3Dlast%2631_1&amp;31_0
+CONSOLE MESSAGE: line 168: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Fwww2.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dhttp%3A%2F%2Flocalhost%3A8800%26get_value%3Dlast%2631_1&amp;31_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Fwww2.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dnull%26get_value%3Dlast%2632_1&amp;32_0
+CONSOLE MESSAGE: line 144: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Fwww2.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dnull%26get_value%3Dlast%2632_1&amp;32_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Fwww2.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dnone%26get_value%3Dlast%2633_1&amp;33_0
+CONSOLE MESSAGE: line 168: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Fwww2.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dnone%26get_value%3Dlast%2633_1&amp;33_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;location=http%3A%2F%2Fwww2.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3D*%26get_value%3Dlast%2634_1&amp;34_0
+CONSOLE MESSAGE: line 144: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;location=http%3A%2F%2Fwww2.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3D*%26get_value%3Dlast%2634_1&amp;34_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;location=http%3A%2F%2Fwww2.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dhttp%3A%2F%2Flocalhost%3A8800%26get_value%3Dlast%2635_1&amp;35_0
+CONSOLE MESSAGE: line 168: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;location=http%3A%2F%2Fwww2.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dhttp%3A%2F%2Flocalhost%3A8800%26get_value%3Dlast%2635_1&amp;35_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;location=http%3A%2F%2Fwww2.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dnull%26get_value%3Dlast%2636_1&amp;36_0
+CONSOLE MESSAGE: line 144: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;location=http%3A%2F%2Fwww2.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dnull%26get_value%3Dlast%2636_1&amp;36_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;location=http%3A%2F%2Fwww2.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dnone%26get_value%3Dlast%2637_1&amp;37_0
+CONSOLE MESSAGE: line 168: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;location=http%3A%2F%2Fwww2.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dnone%26get_value%3Dlast%2637_1&amp;37_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=null&amp;location=http%3A%2F%2Fwww2.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3D*%26get_value%3Dlast%2638_1&amp;38_0
+CONSOLE MESSAGE: line 168: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=null&amp;location=http%3A%2F%2Fwww2.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3D*%26get_value%3Dlast%2638_1&amp;38_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=none&amp;location=http%3A%2F%2Fwww2.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3D*%26get_value%3Dlast%2639_1&amp;39_0
+CONSOLE MESSAGE: line 168: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=none&amp;location=http%3A%2F%2Fwww2.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3D*%26get_value%3Dlast%2639_1&amp;39_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dhttp%3A%2F%2Fwww1.localhost%3A8800%26get_value%3Dlast%2640_1&amp;40_0
+CONSOLE MESSAGE: line 168: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dhttp%3A%2F%2Fwww1.localhost%3A8800%26get_value%3Dlast%2640_1&amp;40_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Fwww2.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dhttp%3A%2F%2Fwww1.localhost%3A8800%26get_value%3Dlast%2641_1&amp;41_0
+CONSOLE MESSAGE: line 168: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;location=http%3A%2F%2Fwww2.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3Dhttp%3A%2F%2Fwww1.localhost%3A8800%26get_value%3Dlast%2641_1&amp;41_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://www1.localhost:8800&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3D*%26get_value%3Dlast%2642_1&amp;42_0
+CONSOLE MESSAGE: line 168: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://www1.localhost:8800&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Forigin%3D*%26get_value%3Dlast%2642_1&amp;42_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;get_value=last&amp;0_1
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;get_value=last&amp;0_1 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;get_value=last&amp;1_1
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;get_value=last&amp;1_1 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=null&amp;get_value=last&amp;2_1
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=null&amp;get_value=last&amp;2_1 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=none&amp;get_value=last&amp;3_1
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=none&amp;get_value=last&amp;3_1 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;get_value=last&amp;4_1
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;get_value=last&amp;4_1 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=null&amp;get_value=last&amp;6_1
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=null&amp;get_value=last&amp;6_1 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;get_value=last&amp;5_1
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=http://localhost:8800&amp;get_value=last&amp;5_1 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;get_value=last&amp;8_1
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;get_value=last&amp;8_1 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;get_value=last&amp;9_1
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;get_value=last&amp;9_1 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=none&amp;get_value=last&amp;7_1
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=none&amp;get_value=last&amp;7_1 due to access control checks.
+CORS redirect handling
+
+
+FAIL local (*) to remote (*), expect origin=http://localhost:8800 assert_true: Got response expected true got false
+FAIL local (*) to remote (http://localhost:8800), expect origin=http://localhost:8800 assert_true: Got response expected true got false
+PASS local (*) to remote (null), expect to fail 
+PASS local (*) to remote (none), expect to fail 
+FAIL local (http://localhost:8800) to remote (*), expect origin=http://localhost:8800 assert_true: Got response expected true got false
+FAIL local (http://localhost:8800) to remote (http://localhost:8800), expect origin=http://localhost:8800 assert_true: Got response expected true got false
+PASS local (http://localhost:8800) to remote (null), expect to fail 
+PASS local (http://localhost:8800) to remote (none), expect to fail 
+FAIL local (null) to remote (*), expect origin=http://localhost:8800 assert_true: Got response expected true got false
+FAIL local (none) to remote (*), expect origin=http://localhost:8800 assert_true: Got response expected true got false
+FAIL remote (*) to local (*), expect origin=null assert_true: Got response expected true got false
+PASS remote (*) to local (http://localhost:8800), expect to fail 
+FAIL remote (*) to local (null), expect origin=null assert_true: Got response expected true got false
+PASS remote (*) to local (none), expect to fail 
+FAIL remote (http://localhost:8800) to local (*), expect origin=null assert_true: Got response expected true got false
+PASS remote (http://localhost:8800) to local (http://localhost:8800), expect to fail 
+FAIL remote (http://localhost:8800) to local (null), expect origin=null assert_true: Got response expected true got false
+PASS remote (http://localhost:8800) to local (none), expect to fail 
+PASS remote (null) to local (*), expect to fail 
+PASS remote (none) to local (*), expect to fail 
+FAIL remote (*) to remote (*), expect origin=http://localhost:8800 assert_true: Got response expected true got false
+FAIL remote (*) to remote (http://localhost:8800), expect origin=http://localhost:8800 assert_true: Got response expected true got false
+PASS remote (*) to remote (null), expect to fail 
+PASS remote (*) to remote (none), expect to fail 
+FAIL remote (http://localhost:8800) to remote (*), expect origin=http://localhost:8800 assert_true: Got response expected true got false
+FAIL remote (http://localhost:8800) to remote (http://localhost:8800), expect origin=http://localhost:8800 assert_true: Got response expected true got false
+PASS remote (http://localhost:8800) to remote (null), expect to fail 
+PASS remote (http://localhost:8800) to remote (none), expect to fail 
+PASS remote (null) to remote (*), expect to fail 
+PASS remote (none) to remote (*), expect to fail 
+FAIL remote (*) to remote2 (*), expect origin=null assert_true: Got response expected true got false
+PASS remote (*) to remote2 (http://localhost:8800), expect to fail 
+FAIL remote (*) to remote2 (null), expect origin=null assert_true: Got response expected true got false
+PASS remote (*) to remote2 (none), expect to fail 
+FAIL remote (http://localhost:8800) to remote2 (*), expect origin=null assert_true: Got response expected true got false
+PASS remote (http://localhost:8800) to remote2 (http://localhost:8800), expect to fail 
+FAIL remote (http://localhost:8800) to remote2 (null), expect origin=null assert_true: Got response expected true got false
+PASS remote (http://localhost:8800) to remote2 (none), expect to fail 
+PASS remote (null) to remote2 (*), expect to fail 
+PASS remote (none) to remote2 (*), expect to fail 
+PASS remote (*) to remote (http://www1.localhost:8800), expect to fail 
+PASS remote (*) to remote2 (http://www1.localhost:8800), expect to fail 
+PASS remote (http://www1.localhost:8800) to remote (*), expect to fail 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsredirectoriginhtm"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-origin.htm (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-origin.htm                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-origin.htm        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,195 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;title&gt;CORS - redirect&lt;/title&gt;
+&lt;meta name=author title=&quot;Odin Hørthe Omdal&quot; href=&quot;mailto:odiho@opera.com&quot;&gt;
+
+&lt;script src=/resources/testharness.js&gt;&lt;/script&gt;
+&lt;script src=/resources/testharnessreport.js&gt;&lt;/script&gt;
+&lt;script src=support.js?pipe=sub&gt;&lt;/script&gt;
+
+&lt;h1&gt;CORS redirect handling&lt;/h1&gt;
+
+&lt;div id=log&gt;&lt;/div&gt;
+
+&lt;script&gt;
+
+    // Test count for cache busting and easy identifying of request in traffic analyzer
+    var num_test = 0,
+
+        origin         = location.protocol + &quot;//&quot; + location.host,
+        remote_origin  = origin.replace('://', '://' + SUBDOMAIN + '.'),
+
+        local   = dirname(location.href) + 'resources/cors-makeheader.py',
+        remote  = local.replace('://', '://' + SUBDOMAIN + '.'),
+        remote2 = local.replace('://', '://' + SUBDOMAIN2 + '.');
+
+
+    /*           First page           Redirect to          Expect what  */
+
+    // local -&gt; remote
+
+    redir_test([ 'local',  '*'    ], [ 'remote', '*'    ], origin    );
+    redir_test([ 'local',  '*'    ], [ 'remote', origin ], origin    );
+    redir_test([ 'local',  '*'    ], [ 'remote', 'null' ], 'disallow');
+    redir_test([ 'local',  '*'    ], [ 'remote', 'none' ], 'disallow');
+
+    redir_test([ 'local',  origin ], [ 'remote', '*'    ], origin    );
+    redir_test([ 'local',  origin ], [ 'remote', origin ], origin    );
+    redir_test([ 'local',  origin ], [ 'remote', 'null' ], 'disallow');
+    redir_test([ 'local',  origin ], [ 'remote', 'none' ], 'disallow');
+
+    redir_test([ 'local',  'null' ], [ 'remote', '*'    ], origin    );
+    redir_test([ 'local',  'none' ], [ 'remote', '*'    ], origin    );
+
+
+    // remote -&gt; local
+
+    redir_test([ 'remote',  '*'    ], [ 'local', '*'    ], 'null'    );
+    redir_test([ 'remote',  '*'    ], [ 'local', origin ], 'disallow');
+    redir_test([ 'remote',  '*'    ], [ 'local', 'null' ], 'null'    );
+    redir_test([ 'remote',  '*'    ], [ 'local', 'none' ], 'disallow');
+
+    redir_test([ 'remote',  origin ], [ 'local', '*'    ], 'null'    );
+    redir_test([ 'remote',  origin ], [ 'local', origin ], 'disallow');
+    redir_test([ 'remote',  origin ], [ 'local', 'null' ], 'null'    );
+    redir_test([ 'remote',  origin ], [ 'local', 'none' ], 'disallow');
+
+    redir_test([ 'remote',  'null' ], [ 'local', '*'    ], 'disallow');
+    redir_test([ 'remote',  'none' ], [ 'local', '*'    ], 'disallow');
+
+
+    // remote -&gt; remote
+
+    redir_test([ 'remote',  '*'    ], [ 'remote', '*'    ], origin    );
+    redir_test([ 'remote',  '*'    ], [ 'remote', origin ], origin    );
+    redir_test([ 'remote',  '*'    ], [ 'remote', 'null' ], 'disallow');
+    redir_test([ 'remote',  '*'    ], [ 'remote', 'none' ], 'disallow');
+
+    redir_test([ 'remote',  origin ], [ 'remote', '*'    ], origin    );
+    redir_test([ 'remote',  origin ], [ 'remote', origin ], origin    );
+    redir_test([ 'remote',  origin ], [ 'remote', 'null' ], 'disallow');
+    redir_test([ 'remote',  origin ], [ 'remote', 'none' ], 'disallow');
+
+    redir_test([ 'remote',  'null' ], [ 'remote', '*'    ], 'disallow');
+    redir_test([ 'remote',  'none' ], [ 'remote', '*'    ], 'disallow');
+
+
+    // remote -&gt; remote2
+
+    redir_test([ 'remote',  '*'    ], [ 'remote2', '*'    ], 'null'    );
+    redir_test([ 'remote',  '*'    ], [ 'remote2', origin ], 'disallow');
+    redir_test([ 'remote',  '*'    ], [ 'remote2', 'null' ], 'null'    );
+    redir_test([ 'remote',  '*'    ], [ 'remote2', 'none' ], 'disallow');
+
+    redir_test([ 'remote',  origin ], [ 'remote2', '*'    ], 'null'    );
+    redir_test([ 'remote',  origin ], [ 'remote2', origin ], 'disallow');
+    redir_test([ 'remote',  origin ], [ 'remote2', 'null' ], 'null');
+    redir_test([ 'remote',  origin ], [ 'remote2', 'none' ], 'disallow');
+
+    redir_test([ 'remote',  'null' ], [ 'remote2', '*'    ], 'disallow');
+    redir_test([ 'remote',  'none' ], [ 'remote2', '*'    ], 'disallow');
+
+
+    // Bonus weird edge checks
+
+    redir_test([ 'remote', '*'           ], [ 'remote',  remote_origin ], 'disallow');
+    redir_test([ 'remote', '*'           ], [ 'remote2', remote_origin ], 'disallow');
+    redir_test([ 'remote', remote_origin ], [ 'remote',  &quot;*&quot;           ], 'disallow');
+
+
+
+    /*
+     * The helpers
+     */
+
+    function redir_test(first, second, expect_origin) {
+        var first_url, second_url,
+            urls = { &quot;remote&quot;: remote, &quot;local&quot;: local, &quot;remote2&quot;: remote2 };
+
+        first_url = urls[first[0]] + &quot;?origin=&quot; + first[1];
+        second_url = urls[second[0]] + &quot;?origin=&quot; + second[1];
+
+        if (expect_origin==&quot;disallow&quot;) {
+            shouldFail(first[0]+&quot; (&quot;+first[1]+&quot;) to &quot;
+                + second[0]+&quot; (&quot;+second[1]+&quot;), expect to fail&quot;, [ first_url, second_url ]);
+        }
+        else {
+            shouldPass(first[0]+&quot; (&quot;+first[1]+&quot;) to &quot;
+                + second[0]+&quot; (&quot;+second[1]+&quot;), expect origin=&quot;+expect_origin, expect_origin, [ first_url, second_url ]);
+        }
+
+    }
+
+    function shouldPass(desc, expected_origin, urls) {
+        var test_id = num_test,
+            t = async_test(desc);
+
+        num_test++;
+
+        t.step(function() {
+            var final_url,
+                client = new XMLHttpRequest();
+
+            client.open('GET', buildURL(urls, test_id));
+
+            client.onreadystatechange = t.step_func(function() {
+                if (client.readyState != client.DONE)
+                    return;
+                assert_true(!!client.response, &quot;Got response&quot;);
+                r = JSON.parse(client.response)
+                assert_equals(r['origin'], expected_origin, 'Origin Header')
+                assert_equals(r['get_value'], 'last', 'get_value')
+                t.done();
+            });
+            client.send(null)
+        });
+    }
+
+    function shouldFail(desc, urls) {
+        var test_id = num_test,
+            t = async_test(desc);
+
+        num_test++;
+
+        t.step(function() {
+            var client = new XMLHttpRequest();
+
+            client.open('GET', buildURL(urls, test_id));
+
+            client.onreadystatechange = t.step_func(function() {
+                if (client.readyState != client.DONE)
+                    return;
+                assert_false(!!client.response, &quot;Got response&quot;);
+            });
+            client.onerror = t.step_func(function(e) {
+                t.done();
+            });
+
+            client.send(null)
+        });
+    }
+
+
+    function buildURL(urls, id) {
+        var tmp_url;
+
+        if (typeof(urls) == &quot;string&quot;) {
+            return urls + &quot;&amp;&quot; + id + &quot;_0&quot;;
+        }
+
+        for (var i = urls.length; i--; ) {
+            if (!tmp_url)
+            {
+                tmp_url = urls[i] + &quot;&amp;get_value=last&amp;&quot; + id + &quot;_&quot; + i;
+                continue;
+            }
+            tmp_url = urls[i]
+                        + &quot;&amp;location=&quot;
+                        + encodeURIComponent(tmp_url)
+                        + &quot;&amp;&quot; + id + &quot;_&quot; + i;
+        }
+
+        return tmp_url;
+    }
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsredirectpreflight2expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-preflight-2-expected.txt (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-preflight-2-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-preflight-2-expected.txt        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?origin=*&amp;ident=fail_1489438122639 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=custom-header&amp;origin=*&amp;token=6de9061c-4017-44fc-a211-22e46653293f due to access control checks.
+Preflight after redirect
+
+
+PASS Same-origin custom-header request, redirect to cross-origin fails after doing a non-successful preflight 
+FAIL Same-origin custom-header request, redirect to cross-origin succeeds after doing a preflight assert_unreached: Error during request Reached unreachable code
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsredirectpreflight2htm"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-preflight-2.htm (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-preflight-2.htm                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-preflight-2.htm        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;title&gt;CORS - preflight after a redirect&lt;/title&gt;
+&lt;meta name=author title=&quot;Odin Hørthe Omdal&quot; href=&quot;mailto:odiho@opera.com&quot;&gt;
+
+&lt;script src=/resources/testharness.js&gt;&lt;/script&gt;
+&lt;script src=/resources/testharnessreport.js&gt;&lt;/script&gt;
+&lt;script src=support.js?pipe=sub&gt;&lt;/script&gt;
+&lt;script src=/common/utils.js&gt;&lt;/script&gt;
+
+&lt;h1&gt;Preflight after redirect&lt;/h1&gt;
+
+&lt;div id=log&gt;&lt;/div&gt;
+&lt;script&gt;
+
+async_test(function() {
+    var test_id = &quot;fail_&quot; +  new Date().getTime()
+    var client = new XMLHttpRequest()
+    var last_url = CROSSDOMAIN + 'resources/cors-makeheader.py?origin=*&amp;ident=' + test_id
+
+    client.open('GET', 'resources/cors-makeheader.py?origin=*&amp;location=' + encodeURIComponent(last_url))
+    client.setRequestHeader('custom-header', 'admin')
+    client.onerror = this.step_func(function() {
+        this.done()
+    })
+    client.onload = this.step_func(function(e) { assert_unreached(&quot;Request should not succeed!&quot;) })
+    client.send()
+}, &quot;Same-origin custom-header request, redirect to cross-origin fails after doing a non-successful preflight&quot;)
+
+
+async_test(function() {
+    var client = new XMLHttpRequest()
+    var uuid_token = token();
+    var last_url = CROSSDOMAIN + 'resources/cors-makeheader.py?headers=custom-header&amp;origin=*&amp;token=' + uuid_token;
+
+    client.open('GET', 'resources/cors-makeheader.py?origin=*&amp;location=' + encodeURIComponent(last_url))
+    client.setRequestHeader('custom-header', 'admin')
+    client.onload = this.step_func(function() {
+        // Test that I got custom-header
+
+        /* To check whether we did a preflight */
+        client.open('GET', 'resources/cors-makeheader.py?check&amp;token=' + uuid_token)
+        client.onload = this.step_func(function() {
+            assert_equals(client.response, &quot;1&quot;, &quot;did preflight&quot;)
+            this.done()
+        })
+        client.onerror = this.step_func(function(e) { assert_unreached(&quot;Error on getting preflight data&quot;) })
+        client.send()
+    })
+    client.onerror = this.step_func(function(e) { assert_unreached(&quot;Error during request&quot;, e) })
+    client.send()
+}, &quot;Same-origin custom-header request, redirect to cross-origin succeeds after doing a preflight&quot;)
+
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsredirectpreflightexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-preflight-expected.txt (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-preflight-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-preflight-expected.txt        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?preflight=200&amp;headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%260&amp;code=301&amp;1 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?preflight=200&amp;headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%262&amp;code=302&amp;3 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?preflight=200&amp;headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%264&amp;code=303&amp;5 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?preflight=200&amp;headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%266&amp;code=307&amp;7 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?preflight=200&amp;headers=x-test&amp;location=http%3A%2F%2Fwww1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3Fheaders%3Dx-test%268&amp;code=308&amp;9 due to access control checks.
+Redirect with preflight
+
+
+FAIL Should allow redirect 301 after succesful (200) preflight assert_equals: Successfull redirect expected 200 but got 0
+FAIL Should allow redirect 302 after succesful (200) preflight assert_equals: Successfull redirect expected 200 but got 0
+FAIL Should allow redirect 303 after succesful (200) preflight assert_equals: Successfull redirect expected 200 but got 0
+FAIL Should allow redirect 307 after succesful (200) preflight assert_equals: Successfull redirect expected 200 but got 0
+FAIL Should allow redirect 308 after succesful (200) preflight assert_equals: Successfull redirect expected 200 but got 0
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsredirectpreflighthtm"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-preflight.htm (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-preflight.htm                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-preflight.htm        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;title&gt;CORS - redirect with preflight&lt;/title&gt;
+&lt;meta name=author title=&quot;Odin Hørthe Omdal&quot; href=&quot;mailto:odiho@opera.com&quot;&gt;
+&lt;meta name=author title=&quot;Fernando Jiménez Moreno&quot; href=&quot;mailto:ferjmoreno@gmail.com&quot;&gt;
+
+&lt;script src=/resources/testharness.js&gt;&lt;/script&gt;
+&lt;script src=/resources/testharnessreport.js&gt;&lt;/script&gt;
+&lt;script src=support.js?pipe=sub&gt;&lt;/script&gt;
+
+&lt;h1&gt;Redirect with preflight&lt;/h1&gt;
+
+&lt;div id=log&gt;&lt;/div&gt;
+&lt;script&gt;
+
+// Request count for cache busting and easy identifying of request in traffic
+// analyzer.
+var req_c = 0;
+
+var CROSSDOMAIN_URL = CROSSDOMAIN + 'resources/cors-makeheader.py?';
+
+/*
+ * Redirection after successfull (200) preflight.
+ */
+function redir_after_successfull_preflight(code) {
+  var desc = 'Should allow redirect ' + code + ' after succesful (200) preflight';
+  async_test(desc).step(function() {
+    var client = new XMLHttpRequest();
+    var redirect = encodeURIComponent(
+      CROSSDOMAIN + 'resources/cors-makeheader.py?headers=x-test&amp;' + req_c++
+    );
+
+    client.open('GET', CROSSDOMAIN + 'resources/cors-makeheader.py?'
+        + 'preflight=200&amp;headers=x-test&amp;location='
+        + redirect + '&amp;code=' + code + '&amp;' + req_c++,
+        true /* async */);
+    client.setRequestHeader('x-test', 'test');
+    client.onreadystatechange = this.step_func(function() {
+      assert_equals(client.status, 200, 'Successfull redirect');
+      this.done();
+    });
+    client.send(null);
+  });
+}
+[301, 302, 303, 307, 308].forEach(redir_after_successfull_preflight);
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsredirectuserinfoexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-userinfo-expected.txt (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-userinfo-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-userinfo-expected.txt        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?&amp;location=http%3A%2F%2Ftest%3Atest%40www1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3F%26get_value%3Dlast%260_1&amp;0_0
+CONSOLE MESSAGE: line 61: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?&amp;location=http%3A%2F%2Ftest%3Atest%40www1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3F%26get_value%3Dlast%260_1&amp;0_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?&amp;location=http%3A%2F%2Fuser%3A%40www1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3F%26get_value%3Dlast%261_1&amp;1_0
+CONSOLE MESSAGE: line 61: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?&amp;location=http%3A%2F%2Fuser%3A%40www1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3F%26get_value%3Dlast%261_1&amp;1_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?&amp;location=http%3A%2F%2Fuser%3A%40www1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3F%26get_value%3Dlast%262_1&amp;2_0
+CONSOLE MESSAGE: line 61: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?&amp;location=http%3A%2F%2Fuser%3A%40www1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3F%26get_value%3Dlast%262_1&amp;2_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?&amp;location=http%3A%2F%2F%3A%40www1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3F%26get_value%3Dlast%263_1&amp;3_0
+CONSOLE MESSAGE: line 61: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?&amp;location=http%3A%2F%2F%3A%40www1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3F%26get_value%3Dlast%263_1&amp;3_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?&amp;location=http%3A%2F%2F%3Apass%40www1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3F%26get_value%3Dlast%264_1&amp;4_0
+CONSOLE MESSAGE: line 61: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?&amp;location=http%3A%2F%2F%3Apass%40www1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3F%26get_value%3Dlast%264_1&amp;4_0 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?&amp;location=http%3A%2F%2F%40www1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3F%26get_value%3Dlast%265_1&amp;5_0
+CONSOLE MESSAGE: line 84: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?&amp;location=http%3A%2F%2F%40www1.localhost%3A8800%2Fcors%2Fresources%2Fcors-makeheader.py%3F%26get_value%3Dlast%265_1&amp;5_0 due to access control checks.
+CORS userinfo redirect handling
+
+
+PASS Disallow redirect with userinfo (//user:pass@) 
+PASS Disallow redirect with userinfo (//user:@) 
+PASS Disallow redirect with userinfo (//user@) 
+PASS Disallow redirect with userinfo (//:@) 
+PASS Disallow redirect with userinfo (//:pass@) 
+FAIL Allow redirect with userinfo (//@) assert_true: Got response expected true got false
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsredirectuserinfohtm"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-userinfo.htm (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-userinfo.htm                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-userinfo.htm        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,110 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;title&gt;CORS - redirect with userinfo&lt;/title&gt;
+&lt;meta name=author title=&quot;Odin Hørthe Omdal&quot; href=&quot;mailto:odinho@opera.com&quot;&gt;
+
+&lt;script src=/resources/testharness.js&gt;&lt;/script&gt;
+&lt;script src=/resources/testharnessreport.js&gt;&lt;/script&gt;
+&lt;script src=support.js?pipe=sub&gt;&lt;/script&gt;
+
+&lt;h1&gt;CORS userinfo redirect handling&lt;/h1&gt;
+
+&lt;div id=log&gt;&lt;/div&gt;
+
+&lt;script&gt;
+
+    // Test count for cache busting and easy identifying of request in traffic analyzer
+    var num_test = 0
+
+    shouldFail(&quot;Disallow redirect with userinfo (//user:pass@)&quot;, [
+                    CROSSDOMAIN + &quot;resources/cors-makeheader.py?&quot;,
+                    CROSSDOMAIN.replace(&quot;http://&quot;, &quot;http://test:test@&quot;) + &quot;resources/cors-makeheader.py?&quot;]);
+
+    shouldFail(&quot;Disallow redirect with userinfo (//user:@)&quot;, [
+                    CROSSDOMAIN + &quot;resources/cors-makeheader.py?&quot;,
+                    CROSSDOMAIN.replace(&quot;http://&quot;, &quot;http://user:@&quot;) + &quot;resources/cors-makeheader.py?&quot;]);
+
+    shouldFail(&quot;Disallow redirect with userinfo (//user@)&quot;, [
+                    CROSSDOMAIN + &quot;resources/cors-makeheader.py?&quot;,
+                    CROSSDOMAIN.replace(&quot;http://&quot;, &quot;http://user:@&quot;) + &quot;resources/cors-makeheader.py?&quot;]);
+
+    shouldFail(&quot;Disallow redirect with userinfo (//:@)&quot;, [
+                    CROSSDOMAIN + &quot;resources/cors-makeheader.py?&quot;,
+                    CROSSDOMAIN.replace(&quot;http://&quot;, &quot;http://:@&quot;) + &quot;resources/cors-makeheader.py?&quot;]);
+
+    shouldFail(&quot;Disallow redirect with userinfo (//:pass@)&quot;, [
+                    CROSSDOMAIN + &quot;resources/cors-makeheader.py?&quot;,
+                    CROSSDOMAIN.replace(&quot;http://&quot;, &quot;http://:pass@&quot;) + &quot;resources/cors-makeheader.py?&quot;]);
+
+    shouldPass(&quot;Allow redirect with userinfo (//@)&quot;, [
+                    CROSSDOMAIN + &quot;resources/cors-makeheader.py?&quot;,
+                    CROSSDOMAIN.replace(&quot;http://&quot;, &quot;http://@&quot;) + &quot;resources/cors-makeheader.py?&quot;]);
+
+    function shouldFail(desc, urls) {
+        var test_id = num_test,
+            t = async_test(desc);
+
+        num_test++;
+
+        t.step(function() {
+            var client = new XMLHttpRequest();
+
+            client.open('GET', buildURL(urls, test_id));
+
+            client.onload = t.step_func(function() {
+                assert_false(!!client.response, &quot;Got response&quot;);
+            });
+            client.onerror = t.step_func(function(e) {
+                t.done();
+            });
+
+            client.send(null)
+        });
+    }
+
+    function shouldPass(desc, urls) {
+        var test_id = num_test,
+            t = async_test(desc);
+
+        num_test++;
+
+        t.step(function() {
+            var client = new XMLHttpRequest();
+
+            client.open('GET', buildURL(urls, test_id));
+
+            client.onreadystatechange = t.step_func(function() {
+                if (client.readyState != client.DONE)
+                    return;
+                assert_true(!!client.response, &quot;Got response&quot;);
+                r = JSON.parse(client.response)
+                assert_equals(r['get_value'], 'last', 'get_value')
+                t.done();
+            });
+            client.send(null)
+        });
+    }
+
+    function buildURL(urls, id) {
+        var tmp_url;
+
+        if (typeof(urls) == &quot;string&quot;) {
+            return urls + &quot;&amp;&quot; + id + &quot;_0&quot;;
+        }
+
+        for (var i = urls.length; i--; ) {
+            if (!tmp_url)
+            {
+                tmp_url = urls[i] + &quot;&amp;get_value=last&amp;&quot; + id + &quot;_&quot; + i;
+                continue;
+            }
+            tmp_url = urls[i]
+                        + &quot;&amp;location=&quot;
+                        + encodeURIComponent(tmp_url)
+                        + &quot;&amp;&quot; + id + &quot;_&quot; + i;
+        }
+
+        return tmp_url;
+    }
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsremoteoriginexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/remote-origin-expected.txt (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/remote-origin-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/remote-origin-expected.txt        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+Blocked access to external URL http://www1.localhost:8800/cors/resources/remote-xhrer.html
+Access-Control-Allow-Origin handling
+
+
+Harness Error (TIMEOUT), message = null
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsremoteoriginhtm"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/remote-origin.htm (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/remote-origin.htm                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/remote-origin.htm        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,121 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;title&gt;Access-Control-Allow-Origin handling&lt;/title&gt;
+&lt;script src=/resources/testharness.js&gt;&lt;/script&gt;
+&lt;script src=/resources/testharnessreport.js&gt;&lt;/script&gt;
+&lt;script src=support.js?pipe=sub&gt;&lt;/script&gt;
+
+&lt;h1&gt;Access-Control-Allow-Origin handling&lt;/h1&gt;
+
+&lt;div id=log&gt;&lt;/div&gt;
+
+&lt;script&gt;
+
+var remote_tests = [];
+var iframe = document.createElement(&quot;iframe&quot;)
+iframe.src = CROSSDOMAIN + 'resources/remote-xhrer.html';
+document.body.appendChild(iframe);
+
+function reverseOrigin(expect_pass, origin)
+{
+    var real_origin = origin.replace(&quot;&lt;host&gt;&quot;, REMOTE_HOST)
+                        .replace(&quot;&lt;remote_origin&gt;&quot;, location.protocol + &quot;//&quot; + location.host)
+                        .replace(&quot;&lt;origin&gt;&quot;, REMOTE_ORIGIN)
+                        .replace(&quot;&lt;protocol&gt;&quot;, REMOTE_PROTOCOL)
+                        .replace(&quot;&lt;HOST&gt;&quot;, REMOTE_HOST.toUpperCase())
+                        .replace(&quot;&lt;ORIGIN&gt;&quot;, REMOTE_ORIGIN.toUpperCase())
+                        .replace(&quot;&lt;PROTOCOL&gt;&quot;, REMOTE_PROTOCOL.toUpperCase());
+
+    var t = async_test((expect_pass ? 'Allow origin: ' : 'Disallow origin: ') + real_origin
+                            .replace(/\0/g, &quot;\\0&quot;)
+                            .replace(/\t/g, &quot;[tab]&quot;)
+                            .replace(/ /g, '_'));
+    t.step(function() {
+        this.test_url = dirname(location.href)
+                            + 'resources/cors-makeheader.py?origin='
+                            + encodeURIComponent(real_origin);
+        iframe.contentWindow.postMessage({ url: this.test_url, origin: origin }, &quot;*&quot;);
+    });
+
+    if (expect_pass)
+    {
+        t.callback = t.step_func(function(e) {
+            assert_equals(e.state, &quot;load&quot;);
+            r = JSON.parse(e.response)
+            assert_equals(r['origin'], REMOTE_ORIGIN, 'Request Origin: should be ' + REMOTE_ORIGIN)
+            this.done();
+        });
+    }
+    else
+    {
+        t.callback = t.step_func(function(e) {
+            assert_equals(e.state, &quot;error&quot;);
+            assert_equals(e.response, &quot;&quot;);
+            this.done();
+        });
+    }
+
+    remote_tests[origin] = t;
+}
+
+function shouldPass(origin) { reverseOrigin(true, origin); }
+function shouldFail(origin) { reverseOrigin(false, origin); }
+
+
+iframe.onload = function() {
+    shouldPass('*');
+    shouldPass(' *  ');
+    shouldPass('        *');
+    shouldPass(&quot;&lt;origin&gt;&quot;);
+    shouldPass(&quot; &lt;origin&gt;&quot;);
+    shouldPass(&quot; &lt;origin&gt;            &quot;);
+    shouldPass(&quot;        &lt;origin&gt;&quot;);
+
+    shouldFail(&quot;&lt;remote_origin&gt;&quot;)
+    shouldFail(&quot;//&quot; + &quot;&lt;host&gt;&quot;)
+    shouldFail(&quot;://&quot; + &quot;&lt;host&gt;&quot;)
+    shouldFail(&quot;ftp://&quot; + &quot;&lt;host&gt;&quot;)
+    shouldFail(&quot;http:://&quot; + &quot;&lt;host&gt;&quot;)
+    shouldFail(&quot;http:/&quot; + &quot;&lt;host&gt;&quot;)
+    shouldFail(&quot;http:&quot; + &quot;&lt;host&gt;&quot;)
+    shouldFail(&quot;&lt;host&gt;&quot;)
+    shouldFail(&quot;&lt;origin&gt;&quot; + &quot;?&quot;)
+    shouldFail(&quot;&lt;origin&gt;&quot; + &quot;/&quot;)
+    shouldFail(&quot;&lt;origin&gt;&quot; + &quot; /&quot;)
+    shouldFail(&quot;&lt;origin&gt;&quot; + &quot;#&quot;)
+    shouldFail(&quot;&lt;origin&gt;&quot; + &quot;%23&quot;)
+    shouldFail(&quot;&lt;origin&gt;&quot; + &quot;:80&quot;)
+    shouldFail(&quot;&lt;origin&gt;&quot; + &quot;, *&quot;)
+    shouldFail(&quot;&lt;origin&gt;&quot; + &quot;\0&quot;)
+    shouldFail((&quot;&lt;ORIGIN&gt;&quot;))
+    shouldFail(&quot;&lt;PROTOCOL&gt;//&lt;host&gt;&quot;)
+    shouldFail(&quot;&lt;protocol&gt;//&lt;HOST&gt;&quot;)
+    shouldFail(&quot;-&quot;)
+    shouldFail(&quot;**&quot;)
+    shouldFail(&quot;\0*&quot;)
+    shouldFail(&quot;*\0&quot;)
+    shouldFail(&quot;'*'&quot;)
+    shouldFail('&quot;*&quot;')
+    shouldFail(&quot;* *&quot;)
+    shouldFail(&quot;*&quot; + &quot;&lt;protocol&gt;&quot; + &quot;//&quot; + &quot;*&quot;)
+    shouldFail(&quot;*&quot; + &quot;&lt;origin&gt;&quot;)
+    shouldFail(&quot;* &quot; + &quot;&lt;origin&gt;&quot;)
+    shouldFail(&quot;*, &quot; + &quot;&lt;origin&gt;&quot;)
+    shouldFail(&quot;\0&quot; + &quot;&lt;origin&gt;&quot;)
+    shouldFail(&quot;null &quot; + &quot;&lt;origin&gt;&quot;)
+    shouldFail('http://example.net')
+    shouldFail('null')
+    shouldFail('')
+    shouldFail(location.href)
+    shouldFail(dirname(location.href))
+    shouldFail(CROSSDOMAIN)
+}
+
+window.addEventListener(&quot;message&quot;, function(e) {
+    remote_tests[e.data.origin].callback(e.data);
+});
+
+add_completion_callback(function() {
+    iframe.parentElement.removeChild(iframe);
+});
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsrequestheadersexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/request-headers-expected.txt (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/request-headers-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/request-headers-expected.txt        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-print
+CONSOLE MESSAGE: line 22: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-print due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-print,
+CONSOLE MESSAGE: line 36: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-print, due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-print
+CONSOLE MESSAGE: line 51: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=x-print due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=,y-lol,x-PriNT,%20,,,Y-PRINT
+CONSOLE MESSAGE: line 59: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=,y-lol,x-PriNT,%20,,,Y-PRINT due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?headers=,y-lol,x-PriNT,%20,,,Y-PRINT
+Request headers
+
+
+FAIL basic request header  A network error occurred.
+FAIL Simple request headers need not be in allow-headers  A network error occurred.
+PASS Unspecified request headers are disallowed 
+FAIL Strange allowheaders (case insensitive)  A network error occurred.
+PASS INVALID_STATE_ERR on setRequestHeader before open() 
+FAIL INVALID_STATE_ERR on setRequestHeader after send() The operation was aborted.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsrequestheadershtm"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/request-headers.htm (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/request-headers.htm                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/request-headers.htm        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,80 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;title&gt;CORS - request headers - Access-Control-Allow-Headers&lt;/title&gt;
+&lt;meta name=author title=&quot;Odin Hørthe Omdal&quot; href=&quot;mailto:odiho@opera.com&quot;&gt;
+
+&lt;script src=/resources/testharness.js&gt;&lt;/script&gt;
+&lt;script src=/resources/testharnessreport.js&gt;&lt;/script&gt;
+&lt;script src=support.js?pipe=sub&gt;&lt;/script&gt;
+
+&lt;h1&gt;Request headers&lt;/h1&gt;
+&lt;div id=log&gt;&lt;/div&gt;
+&lt;script&gt;
+
+/*
+ * Request Headers
+ */
+
+test(function() {
+    var client = new XMLHttpRequest()
+    client.open('GET', CROSSDOMAIN + 'resources/cors-makeheader.py?headers=x-print', false)
+    client.setRequestHeader('x-print', 'unicorn')
+    client.send(null)
+
+    res = JSON.parse(client.response)
+    assert_equals(res['x-print'], 'unicorn')
+}, 'basic request header')
+
+test(function() {
+    var client = new XMLHttpRequest()
+    client.open('GET', CROSSDOMAIN + 'resources/cors-makeheader.py?headers=x-print,', false)
+    client.setRequestHeader('x-print', 'unicorn')
+    client.setRequestHeader('content-type', 'text/plain')
+    client.setRequestHeader('accept', 'test')
+    client.setRequestHeader('accept-language', 'nn')
+    client.setRequestHeader('content-language', 'nn')
+    client.send(null)
+
+    res = JSON.parse(client.response)
+    assert_equals(res['x-print'], 'unicorn')
+    assert_equals(res['content-type'], 'text/plain')
+    assert_equals(res['accept'], 'test')
+    assert_equals(res['accept-language'], 'nn')
+    assert_equals(res['content-language'], 'nn')
+}, 'Simple request headers need not be in allow-headers')
+
+test(function() {
+    var client = new XMLHttpRequest()
+    client.open('GET', CROSSDOMAIN + 'resources/cors-makeheader.py?headers=x-print', false)
+    client.setRequestHeader('x-print', 'unicorn')
+    client.setRequestHeader('y-print', 'unicorn')
+    assert_throws(null, function() { client.send(null) })
+}, 'Unspecified request headers are disallowed')
+
+test(function() {
+    var client = new XMLHttpRequest()
+    client.open('GET', CROSSDOMAIN + 'resources/cors-makeheader.py?headers=,y-lol,x-PriNT,%20,,,Y-PRINT', false)
+    client.setRequestHeader('x-print', 'unicorn')
+    client.setRequestHeader('y-print', 'narwhal')
+    client.send(null)
+
+    res = JSON.parse(client.response)
+    assert_equals(res['x-print'], 'unicorn')
+    assert_equals(res['y-print'], 'narwhal')
+}, 'Strange allowheaders (case insensitive)')
+
+test(function() {
+    var client = new XMLHttpRequest()
+    assert_throws('INVALID_STATE_ERR', function() { client.setRequestHeader('x-print', 'unicorn') })
+},
+'INVALID_STATE_ERR on setRequestHeader before open()')
+
+test(function() {
+    var client = new XMLHttpRequest()
+    client.open('GET', CROSSDOMAIN + 'resources/cors-makeheader.py?headers=,y-lol,x-PriNT,%20,,,Y-PRINT', false)
+    client.send()
+    assert_throws('INVALID_STATE_ERR', function() { client.setRequestHeader('x-print', 'unicorn') })
+},
+'INVALID_STATE_ERR on setRequestHeader after send()')
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsresources304py"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/304.py (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/304.py                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/304.py        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,62 @@
</span><ins>+#!/usr/bin/env python
+
+# A header used to correlate requests and responses
+state_header = &quot;content-language&quot;
+
+# Static ETag to use (and expect)
+etag = &quot;abcdef&quot;
+
+def error(msg):
+    return (299, &quot;Client Error&quot;), [
+        ('content-type', 'text/plain'),
+        ('access-control-allow-origin', &quot;*&quot;),
+        ('access-control-expose-headers', state_header),
+        ('cache-control', 'no-store')
+    ], msg
+
+def main(request, response):
+    headers = []
+
+    inm = request.headers.get('if-none-match', None)
+    raw_req_num = request.headers.get(state_header, None)
+    if raw_req_num == None:
+        return error(&quot;no req_num header in request&quot;)
+    else:
+        req_num = int(raw_req_num)
+        if req_num &gt; 8:
+            return error(&quot;req_num %s out of range&quot; % req_num)
+
+    headers.append((&quot;Access-Control-Expose-Headers&quot;, state_header))
+    headers.append((state_header, req_num))
+    headers.append((&quot;A&quot;, req_num))
+    headers.append((&quot;B&quot;, req_num))
+
+    if req_num % 2:  # odd requests are the first in a test pair
+        if inm:
+            # what are you doing here? This should be a fresh request.
+            return error(&quot;If-None-Match on first request&quot;)
+        else:
+            status = 200, &quot;OK&quot;
+            headers.append((&quot;Access-Control-Allow-Origin&quot;, &quot;*&quot;))
+            headers.append((&quot;Content-Type&quot;, &quot;text/plain&quot;))
+            headers.append((&quot;Cache-Control&quot;, &quot;private, max-age=3, must-revalidate&quot;))
+            headers.append((&quot;ETag&quot;, etag))
+            return status, headers, &quot;Success&quot;
+    else:  # even requests are the second in a pair, and should have a good INM.
+        if inm != etag:
+            # Bad browser.
+            if inm == None:
+                return error(&quot;If-None-Match missing&quot;)
+            else:
+                return error(&quot;If-None-Match '%s' mismatches&quot;)
+        else:
+            if req_num == 2:
+                pass  # basic, vanilla check
+            elif req_num == 4:
+                headers.append((&quot;Access-Control-Expose-Headers&quot;, &quot;a, b&quot;))
+            elif req_num == 6:
+                headers.append((&quot;Access-Control-Expose-Headers&quot;, &quot;a&quot;))
+            elif req_num == 8:
+                headers.append((&quot;Access-Control-Allow-Origin&quot;, &quot;other.origin.example:80&quot;))
+            status = 304, &quot;Not Modified&quot;
+            return status, headers, &quot;&quot;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsresourcescheckandremovepy"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/checkandremove.py (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/checkandremove.py                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/checkandremove.py        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+def main(request, response):
+    token = request.GET.first(&quot;token&quot;)
+    if request.server.stash.remove(token) is not None:
+        return &quot;1&quot;
+    else:
+        return &quot;0&quot;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsresourcescorscookiepy"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/cors-cookie.py (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/cors-cookie.py                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/cors-cookie.py        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+
+def main(request, response):
+    origin = request.GET.first(&quot;origin&quot;, request.headers[&quot;origin&quot;])
+    credentials = request.GET.first(&quot;credentials&quot;, &quot;true&quot;)
+
+    headers = [(&quot;Content-Type&quot;, &quot;text/plain&quot;)]
+    if origin != 'none':
+        headers.append((&quot;Access-Control-Allow-Origin&quot;, origin))
+    if credentials != 'none':
+        headers.append((&quot;Access-Control-Allow-Credentials&quot;, credentials))
+
+    ident = request.GET.first('ident', 'test')
+
+    if ident in request.cookies:
+        body = request.cookies[ident].value
+        response.delete_cookie(ident)
+    else:
+        response.set_cookie(ident, &quot;COOKIE&quot;);
+        body = &quot;NO_COOKIE&quot;
+
+    return headers, body
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsresourcescorsheadersasis"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/cors-headers.asis (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/cors-headers.asis                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/cors-headers.asis        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+HTTP/1.1 200 OK
+Access-Control-Allow-Origin: *
+Access-Control-Expose-Headers: X-Custom-Header, X-Custom-Header-Empty, X-Custom-Header-Comma, X-Custom-Header-Bytes
+Access-Control-Expose-Headers: X-Second-Expose
+Access-Control-Expose-Headers: Date
+Content-Type: text/plain
+X-Custom-Header: test
+X-Custom-Header: test
+Set-Cookie: test1=t1;max-age=2
+Set-Cookie2: test2=t2;Max-Age=2
+X-Custom-Header-Empty: 
+X-Custom-Header-Comma: 1
+X-Custom-Header-Comma: 2
+X-Custom-Header-Bytes: …
+X-Nonexposed: unicorn
+X-Second-Expose: flyingpig
+Cache-Control: no-cache
+Content-Language: nn
+Expires: Thu, 01 Dec 1994 16:00:00 GMT
+Last-Modified: Thu, 01 Dec 1994 10:00:00 GMT
+Pragma: no-cache
+Date: Wed, 22 Oct 2013 10:00:00 GMT
+
+TEST
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsresourcescorsmakeheaderpy"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/cors-makeheader.py (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/cors-makeheader.py                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/cors-makeheader.py        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,67 @@
</span><ins>+import json
+
+def main(request, response):
+    origin = request.GET.first(&quot;origin&quot;, request.headers.get('origin'))
+
+    if &quot;check&quot; in request.GET:
+        token = request.GET.first(&quot;token&quot;)
+        value = request.server.stash.take(token)
+        if value is not None:
+            if request.GET.first(&quot;check&quot;, None) == &quot;keep&quot;:
+                request.server.stash.put(token, value)
+            body = &quot;1&quot;
+        else:
+            body = &quot;0&quot;
+        return [(&quot;Content-Type&quot;, &quot;text/plain&quot;)], body
+
+
+    if origin != 'none':
+        response.headers.set(&quot;Access-Control-Allow-Origin&quot;, origin)
+    if 'origin2' in request.GET:
+        response.headers.append(&quot;Access-Control-Allow-Origin&quot;, request.GET.first('origin2'))
+
+    #Preflight
+    if 'headers' in request.GET:
+        response.headers.set(&quot;Access-Control-Allow-Headers&quot;, request.GET.first('headers'))
+    if 'credentials' in request.GET:
+        response.headers.set(&quot;Access-Control-Allow-Credentials&quot;, request.GET.first('credentials'))
+    if 'methods' in request.GET:
+        response.headers.set(&quot;Access-Control-Allow-Methods&quot;, request.GET.first('methods'))
+
+    code_raw = request.GET.first('code', None)
+    if code_raw:
+        code = int(code_raw)
+    else:
+        code = None
+    if request.method == 'OPTIONS':
+        #Override the response code if we're in a preflight and it's asked
+        if 'preflight' in request.GET:
+            code = int(request.GET.first('preflight'))
+
+        #Log that the preflight actually happened if we have an ident
+        if 'token' in request.GET:
+            request.server.stash.put(request.GET['token'], True)
+
+    if 'location' in request.GET:
+        if code is None:
+            code = 302
+
+        if code &gt;= 300 and code &lt; 400:
+            response.headers.set(&quot;Location&quot;, request.GET.first('location'))
+
+    headers = {}
+    for name, values in request.headers.iteritems():
+        if len(values) == 1:
+            headers[name] = values[0]
+        else:
+            #I have no idea, really
+            headers[name] = values
+
+    headers['get_value'] = request.GET.first('get_value', '')
+
+    body = json.dumps(headers)
+
+    if code:
+        return (code, &quot;StatusText&quot;), [], body
+    else:
+        return body
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsresourcespreflightpy"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/preflight.py (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/preflight.py                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/preflight.py        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+def main(request, response):
+    headers = [(&quot;Content-Type&quot;, &quot;text/plain&quot;)]
+
+    if &quot;check&quot; in request.GET:
+        token = request.GET.first(&quot;token&quot;)
+        value = request.server.stash.take(token)
+        if value == None:
+            body = &quot;0&quot;
+        else:
+            if request.GET.first(&quot;check&quot;, None) == &quot;keep&quot;:
+                request.server.stash.put(token, value)
+            body = &quot;1&quot;
+
+        return headers, body
+
+    if request.method == &quot;OPTIONS&quot;:
+        if not &quot;Access-Control-Request-Method&quot; in request.headers:
+            response.set_error(400, &quot;No Access-Control-Request-Method header&quot;)
+            return &quot;ERROR: No access-control-request-method in preflight!&quot;
+
+        headers.append((&quot;Access-Control-Allow-Methods&quot;,
+                        request.headers['Access-Control-Request-Method']))
+
+        if &quot;max_age&quot; in request.GET:
+            headers.append((&quot;Access-Control-Max-Age&quot;, request.GET['max_age']))
+
+        if &quot;token&quot; in request.GET:
+            request.server.stash.put(request.GET.first(&quot;token&quot;), 1)
+
+    headers.append((&quot;Access-Control-Allow-Origin&quot;, &quot;*&quot;))
+    headers.append((&quot;Access-Control-Allow-Headers&quot;, &quot;x-print&quot;))
+
+    body = request.headers.get(&quot;x-print&quot;, &quot;NO&quot;)
+
+    return headers, body
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsresourcesremotexhrerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/remote-xhrer.html (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/remote-xhrer.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/remote-xhrer.html        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;title&gt;Child helper&lt;/title&gt;
+
+&lt;script&gt;
+window.addEventListener(&quot;message&quot;, function(e) {
+//    e.source.postMessage(e.data, e.origin);
+
+    var client = new XMLHttpRequest();
+    var localurl = e.data.url
+                    .replace(&quot;&lt;host&gt;&quot;, location.host)
+                    .replace(&quot;&lt;protocol&gt;&quot;, location.protocol);
+
+    client.open('GET', localurl, true);
+    client.onload = function() {
+        e.data.state = &quot;load&quot;;
+        e.data.response = client.response;
+        e.source.postMessage(e.data, e.origin);
+    }
+    client.onerror = function() {
+        e.data.state = &quot;error&quot;;
+        e.data.response = client.response;
+        e.source.postMessage(e.data, e.origin);
+    }
+    client.send();
+});
+&lt;/script&gt;
+
+The remote window
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsresourcesstatuspy"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/status.py (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/status.py                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/status.py        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+def main(request, response):
+    response.headers.set(&quot;Access-Control-Allow-Origin&quot;, request.headers.get(&quot;origin&quot;) )
+    response.headers.set(&quot;Access-Control-Expose-Headers&quot;, &quot;X-Request-Method&quot;)
+
+    if request.method == 'OPTIONS':
+        response.headers.set(&quot;Access-Control-Allow-Methods&quot;,  &quot;GET, CHICKEN, HEAD, POST, PUT&quot;)
+
+    if 'headers' in request.GET:
+        response.headers.set(&quot;Access-Control-Allow-Headers&quot;,  request.GET.first('headers'))
+
+    response.headers.set(&quot;X-Request-Method&quot;, request.method)
+
+    response.headers.set(&quot;X-A-C-Request-Method&quot;, request.headers.get(&quot;Access-Control-Request-Method&quot;, &quot;&quot;));
+
+
+    #This should reasonably work for most response codes.
+    try:
+        code = int(request.GET.first(&quot;code&quot;, 200))
+    except ValueError:
+        code = 200
+
+    text = request.GET.first(&quot;text&quot;, &quot;OMG&quot;)
+
+    if request.method == &quot;OPTIONS&quot; and &quot;preflight&quot; in request.GET:
+        try:
+            code = int(request.GET.first('preflight'))
+        except KeyError, ValueError:
+            pass
+
+    status = code, text
+
+    if &quot;type&quot; in request.GET:
+        response.headers.set(&quot;Content-Type&quot;, request.GET.first('type'))
+
+    body = request.GET.first('content', &quot;&quot;)
+
+    return status, [], body
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsresourcesw3cimportlog"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/w3c-import.log (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/w3c-import.log                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/resources/w3c-import.log        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the W3C CSS or WPT github:
+        https://github.com/w3c/csswg-test
+        https://github.com/w3c/web-platform-tests
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/cors/resources/304.py
+/LayoutTests/imported/w3c/web-platform-tests/cors/resources/checkandremove.py
+/LayoutTests/imported/w3c/web-platform-tests/cors/resources/cors-cookie.py
+/LayoutTests/imported/w3c/web-platform-tests/cors/resources/cors-headers.asis
+/LayoutTests/imported/w3c/web-platform-tests/cors/resources/cors-makeheader.py
+/LayoutTests/imported/w3c/web-platform-tests/cors/resources/preflight.py
+/LayoutTests/imported/w3c/web-platform-tests/cors/resources/remote-xhrer.html
+/LayoutTests/imported/w3c/web-platform-tests/cors/resources/status.py
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsresponseheadersexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/response-headers-expected.txt (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/response-headers-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/response-headers-expected.txt        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-headers.asis
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-headers.asis
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-headers.asis
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-headers.asis
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-headers.asis
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-headers.asis
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-headers.asis
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-headers.asis
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-headers.asis
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-headers.asis
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-headers.asis
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-headers.asis
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-headers.asis
+CONSOLE MESSAGE: line 82: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-headers.asis due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-headers.asis
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-headers.asis
+Response headers
+
+
+FAIL getResponseHeader: Expose Access-Control-Expose-Headers (x-custom-header-comma) The operation was aborted.
+FAIL getResponseHeader: Expose second Access-Control-Expose-Headers (x-second-expose) The operation was aborted.
+FAIL getResponseHeader: Don't trim whitespace The operation was aborted.
+FAIL getResponseHeader: x-custom-header bytes The operation was aborted.
+FAIL getResponseHeader: Exposed server field readable (Date) The operation was aborted.
+FAIL getResponseHeader: Cache-Control: readable by default The operation was aborted.
+FAIL getResponseHeader: Content-Language: readable by default The operation was aborted.
+FAIL getResponseHeader: Expires: readable by default The operation was aborted.
+FAIL getResponseHeader: Last-Modified: readable by default The operation was aborted.
+FAIL getResponseHeader: Pragma: readable by default The operation was aborted.
+FAIL getResponseHeader: Server: unreadable by default The operation was aborted.
+FAIL getResponseHeader: X-Powered-By: unreadable by default The operation was aborted.
+FAIL getResponseHeader: Combined testing of cors response headers assert_equals: x-custom-header expected (string) &quot;test, test&quot; but got (object) null
+FAIL getResponse: don't expose x-nonexposed The operation was aborted.
+FAIL getAllResponseHeaders: don't expose x-nonexposed The operation was aborted.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsresponseheadershtm"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/response-headers.htm (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/response-headers.htm                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/response-headers.htm        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,103 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;title&gt;CORS - Response headers&lt;/title&gt;
+&lt;meta name=author title=&quot;Odin Hørthe Omdal&quot; href=&quot;mailto:odiho@opera.com&quot;&gt;
+
+&lt;script src=/resources/testharness.js&gt;&lt;/script&gt;
+&lt;script src=/resources/testharnessreport.js&gt;&lt;/script&gt;
+&lt;script src=support.js?pipe=sub&gt;&lt;/script&gt;
+
+&lt;h1&gt;Response headers&lt;/h1&gt;
+&lt;div id=log&gt;&lt;/div&gt;
+&lt;script&gt;
+
+/*
+ * Response Headers
+ */
+
+function check_response_header(head, value, desc) {
+    test(function() {
+        var client = new XMLHttpRequest()
+        client.open('GET', CROSSDOMAIN + 'resources/cors-headers.asis', false)
+        client.send(null)
+
+        if (typeof value === 'function')
+            value(client, head)
+        else
+            assert_equals(client.getResponseHeader(head), value, head)
+    },
+    desc)
+}
+check_response_header('X-Custom-Header-Comma', '1, 2', 'getResponseHeader: Expose Access-Control-Expose-Headers (x-custom-header-comma)')
+check_response_header('X-Second-Expose', 'flyingpig', 'getResponseHeader: Expose second Access-Control-Expose-Headers (x-second-expose)')
+check_response_header(' x-custom-header', null, 'getResponseHeader: Don\'t trim whitespace')
+check_response_header('x-custom-header-bytes', &quot;\xE2\x80\xA6&quot;, 'getResponseHeader: x-custom-header bytes')
+check_response_header('Date',
+    function(client, head) { assert_true(client.getResponseHeader(head).length &gt; 2) },
+    'getResponseHeader: Exposed server field readable (Date)')
+
+function default_readable(head, value) {
+    check_response_header(head, value, 'getResponseHeader: '+head+': readable by default')
+}
+default_readable(&quot;Cache-Control&quot;, &quot;no-cache&quot;);
+default_readable(&quot;Content-Language&quot;, &quot;nn&quot;);
+default_readable(&quot;Expires&quot;, &quot;Thu, 01 Dec 1994 16:00:00 GMT&quot;);
+default_readable(&quot;Last-Modified&quot;, &quot;Thu, 01 Dec 1994 10:00:00 GMT&quot;);
+default_readable(&quot;Pragma&quot;, &quot;no-cache&quot;);
+
+
+function default_unreadable(head) {
+    check_response_header(head, null, 'getResponseHeader: '+head+': unreadable by default')
+}
+default_unreadable(&quot;Server&quot;)
+default_unreadable(&quot;X-Powered-By&quot;)
+
+
+async_test(&quot;getResponseHeader: Combined testing of cors response headers&quot;)
+.step(function()
+{
+    var client = new XMLHttpRequest();
+    client.open(&quot;GET&quot;, CROSSDOMAIN + 'resources/cors-headers.asis')
+    window.c=client;
+    client.onreadystatechange = this.step_func(function()
+    {
+        if (client.readyState == 1)
+        {
+            assert_equals(client.getResponseHeader(&quot;x-custom-header&quot;), null, 'x-custom-header')
+        }
+        if (client.readyState &gt; 1)
+        {
+            assert_equals(client.getResponseHeader(&quot;x-custom-header&quot;), &quot;test, test&quot;, 'x-custom-header')
+            assert_equals(client.getResponseHeader(&quot;x-custom-header-empty&quot;), &quot;&quot;, 'x-custom-header-empty')
+            assert_equals(client.getResponseHeader(&quot;set-cookie&quot;), null)
+            assert_equals(client.getResponseHeader(&quot;set-cookie2&quot;), null)
+            assert_equals(client.getResponseHeader(&quot;x-non-existent-header&quot;), null)
+            assert_equals(client.getResponseHeader(&quot;x-nonexposed&quot;), null)
+        }
+        if (client.readyState == 4)
+        {
+            this.done()
+        }
+    })
+    client.send()
+})
+
+test(function() {
+    var client = new XMLHttpRequest()
+    client.open('GET', CROSSDOMAIN + 'resources/cors-headers.asis', false)
+    client.send(null)
+    assert_equals(client.getResponseHeader(&quot;x-custom-header&quot;), &quot;test, test&quot;, 'x-custom-header')
+    assert_equals(client.getResponseHeader(&quot;x-nonexposed&quot;), null, 'x-nonexposed')
+}, &quot;getResponse: don't expose x-nonexposed&quot;)
+
+test(function() {
+    var client = new XMLHttpRequest()
+    client.open('GET', CROSSDOMAIN + 'resources/cors-headers.asis', false)
+    client.send(null)
+
+    h = client.getAllResponseHeaders().toLowerCase()
+    assert_true( h.indexOf('x-custom-header') &gt;= 0, 'x-custom-header present')
+    assert_true( h.indexOf('x-nonexposed') === -1, 'x-nonexposed not present')
+}, &quot;getAllResponseHeaders: don't expose x-nonexposed&quot;)
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorssimplerequestsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/simple-requests-expected.txt (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/simple-requests-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/simple-requests-expected.txt        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+Blocked access to external URL http://www1.localhost:8800/cors/resources/preflight.py?token=392a30cd-ce3d-4663-85f4-5b95816600b8
+Blocked access to external URL http://www1.localhost:8800/cors/resources/preflight.py?token=bdc783ee-bc1a-4a80-8206-9ff503a2335f
+Blocked access to external URL http://www1.localhost:8800/cors/resources/preflight.py?token=7f937523-74aa-4ba0-8fe6-8a39fb111f47
+Blocked access to external URL http://www1.localhost:8800/cors/resources/preflight.py?token=35ba3c52-65b8-4b34-b2cb-553765266f57
+Blocked access to external URL http://www1.localhost:8800/cors/resources/preflight.py?token=5cb24269-d166-4abd-8347-c0337cc6ca47
+Blocked access to external URL http://www1.localhost:8800/cors/resources/preflight.py?token=7bf64789-3840-4b6b-96e4-2d2e27587619
+Blocked access to external URL http://www1.localhost:8800/cors/resources/preflight.py?token=c44f6790-53b8-4993-b0b1-e21a3cc3d245
+Blocked access to external URL http://www1.localhost:8800/cors/resources/preflight.py?token=a56a5860-7f84-4aa5-8e89-9caabc49b7ad
+Blocked access to external URL http://www1.localhost:8800/cors/resources/preflight.py?token=bfef417e-6a08-4467-ae21-d093b0b72d43
+Blocked access to external URL http://www1.localhost:8800/cors/resources/preflight.py?token=4d2914db-3e65-4004-8aa2-5b416d3bd139
+Blocked access to external URL http://www1.localhost:8800/cors/resources/preflight.py?token=545e6e0a-ab91-425c-9fee-d7c76bda8f77
+Blocked access to external URL http://www1.localhost:8800/cors/resources/preflight.py?token=b95b5f11-7b56-4283-85c0-af71766d239b
+Blocked access to external URL http://www1.localhost:8800/cors/resources/preflight.py?token=9c6e28cf-2e5a-41c8-8ba0-e353ab96d8b4
+Blocked access to external URL http://www1.localhost:8800/cors/resources/preflight.py?token=10a72420-e8c1-4284-911a-2f66e7959016
+Blocked access to external URL http://www1.localhost:8800/cors/resources/preflight.py?token=2fc8911b-9594-4abd-83af-7c8caeb58e17
+Blocked access to external URL http://www1.localhost:8800/cors/resources/preflight.py?token=0bde01ea-410c-45e1-9d25-2a59714db8f8
+Blocked access to external URL http://www1.localhost:8800/cors/resources/preflight.py?token=0272d215-0f1c-4517-8069-ac8135e2f905
+Blocked access to external URL http://www1.localhost:8800/cors/resources/preflight.py?token=098da67a-9610-4892-8e70-db38ab79afce
+Blocked access to external URL http://www1.localhost:8800/cors/resources/preflight.py?token=f2d525c1-f373-47af-a6fe-6a1b62658356
+Blocked access to external URL http://www1.localhost:8800/cors/resources/preflight.py?token=f967e5a3-7df3-4ad2-9d38-0f8064fad2d2
+Blocked access to external URL http://www1.localhost:8800/cors/resources/preflight.py?token=b6010190-0f35-4998-a0c1-331119a76a0e
+Blocked access to external URL http://www1.localhost:8800/cors/resources/preflight.py?token=ae19d0d4-657d-4333-97be-2332eb0a683a
+Blocked access to external URL http://www1.localhost:8800/cors/resources/preflight.py?token=350fc654-7f4c-4a0d-94fe-c02f3e9b953d
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/preflight.py?token=e3ceb821-d17d-404e-91ef-705b61832c7e due to access control checks.
+Simple requests
+
+Simple requests shouldn't trigger preflight
+
+
+FAIL No preflight GET and {&quot;Accept&quot;:&quot;test&quot;} The operation was aborted.
+FAIL No preflight HEAD and {&quot;Accept&quot;:&quot;test&quot;} The operation was aborted.
+FAIL No preflight POST and {&quot;Accept&quot;:&quot;test&quot;} The operation was aborted.
+FAIL No preflight GET and {&quot;accept-language&quot;:&quot;test&quot;} The operation was aborted.
+FAIL No preflight HEAD and {&quot;accept-language&quot;:&quot;test&quot;} The operation was aborted.
+FAIL No preflight POST and {&quot;accept-language&quot;:&quot;test&quot;} The operation was aborted.
+FAIL No preflight GET and {&quot;CONTENT-language&quot;:&quot;test&quot;} The operation was aborted.
+FAIL No preflight HEAD and {&quot;CONTENT-language&quot;:&quot;test&quot;} The operation was aborted.
+FAIL No preflight POST and {&quot;CONTENT-language&quot;:&quot;test&quot;} The operation was aborted.
+FAIL No preflight GET and {&quot;Content-Type&quot;:&quot;application/x-www-form-urlencoded&quot;} The operation was aborted.
+FAIL No preflight HEAD and {&quot;Content-Type&quot;:&quot;application/x-www-form-urlencoded&quot;} The operation was aborted.
+FAIL No preflight POST and {&quot;Content-Type&quot;:&quot;application/x-www-form-urlencoded&quot;} The operation was aborted.
+FAIL No preflight GET and {&quot;content-type&quot;:&quot;multipart/form-data&quot;} The operation was aborted.
+FAIL No preflight HEAD and {&quot;content-type&quot;:&quot;multipart/form-data&quot;} The operation was aborted.
+FAIL No preflight POST and {&quot;content-type&quot;:&quot;multipart/form-data&quot;} The operation was aborted.
+FAIL No preflight GET and {&quot;content-type&quot;:&quot;text/plain&quot;} The operation was aborted.
+FAIL No preflight HEAD and {&quot;content-type&quot;:&quot;text/plain&quot;} The operation was aborted.
+FAIL No preflight POST and {&quot;content-type&quot;:&quot;text/plain&quot;} The operation was aborted.
+FAIL No preflight GET and {&quot;accept&quot;:&quot;test&quot;,&quot;accept-language&quot;:&quot;test&quot;,&quot;content-language&quot;:&quot;test&quot;,&quot;content-type&quot;:&quot;text/plain; parameter=whatever&quot;} The operation was aborted.
+FAIL No preflight HEAD and {&quot;accept&quot;:&quot;test&quot;,&quot;accept-language&quot;:&quot;test&quot;,&quot;content-language&quot;:&quot;test&quot;,&quot;content-type&quot;:&quot;text/plain; parameter=whatever&quot;} The operation was aborted.
+FAIL No preflight POST and {&quot;accept&quot;:&quot;test&quot;,&quot;accept-language&quot;:&quot;test&quot;,&quot;content-language&quot;:&quot;test&quot;,&quot;content-type&quot;:&quot;text/plain; parameter=whatever&quot;} The operation was aborted.
+FAIL No preflight Get and {&quot;content-type&quot;:&quot;text/plain; parameter=extra_bonus&quot;} The operation was aborted.
+FAIL No preflight post and {&quot;content-type&quot;:&quot;text/plain&quot;} The operation was aborted.
+FAIL Check simple headers (async) assert_unreached: onerror Reached unreachable code
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorssimplerequestshtm"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/simple-requests.htm (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/simple-requests.htm                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/simple-requests.htm        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,91 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;title&gt;CORS - simple requests&lt;/title&gt;
+&lt;meta name=author title=&quot;Odin Hørthe Omdal&quot; href=&quot;mailto:odiho@opera.com&quot;&gt;
+
+&lt;script src=/resources/testharness.js&gt;&lt;/script&gt;
+&lt;script src=/resources/testharnessreport.js&gt;&lt;/script&gt;
+&lt;script src=support.js?pipe=sub&gt;&lt;/script&gt;
+&lt;script src=/common/utils.js&gt;&lt;/script&gt;
+
+&lt;h1&gt;Simple requests&lt;/h1&gt;
+&lt;p&gt;Simple requests shouldn't trigger preflight&lt;/p&gt;
+
+&lt;div id=log&gt;&lt;/div&gt;
+&lt;script&gt;
+
+var test_c = 0;
+
+function check_simple(method, headers)
+{
+    test(function() {
+        var client = new XMLHttpRequest()
+        var uuid_token = token();
+        client.open(method, CROSSDOMAIN + 'resources/preflight.py?token='
+                            + uuid_token, false)
+        for (head in headers)
+            client.setRequestHeader(head, headers[head])
+        client.send(&quot;data&quot;)
+        assert_equals(client.getResponseHeader('content-type'), &quot;text/plain&quot;)
+        if (method == 'HEAD')
+            assert_equals(client.response, '', 'response')
+        else
+            assert_equals(client.response, 'NO', 'response')
+
+        client.open('GET', 'resources/preflight.py?check&amp;token='
+                          + uuid_token, false)
+        client.send(&quot;data&quot;)
+        assert_equals(client.response, &quot;0&quot;, &quot;Found preflight log&quot;)
+    },
+    'No preflight ' + method + ' and ' + JSON.stringify(headers))
+}
+
+function check_simple_headers(headers) {
+    check_simple('GET', headers)
+    check_simple('HEAD', headers)
+    check_simple('POST', headers)
+}
+
+check_simple_headers({'Accept': 'test'})
+check_simple_headers({'accept-language': 'test'})
+check_simple_headers({'CONTENT-language': 'test'})
+
+check_simple_headers({'Content-Type': 'application/x-www-form-urlencoded'})
+check_simple_headers({'content-type': 'multipart/form-data'})
+check_simple_headers({'content-type': 'text/plain'})
+
+check_simple_headers({
+                        'accept': 'test',
+                        'accept-language': 'test',
+                        'content-language': 'test',
+                        'content-type': 'text/plain; parameter=whatever'
+                     })
+
+check_simple('Get', {'content-type': 'text/plain; parameter=extra_bonus'})
+check_simple('post', {'content-type': 'text/plain'})
+
+
+/* Extra async test */
+
+var simple_async = async_test(&quot;Check simple headers (async)&quot;)
+simple_async.step(function (){
+    var time = new Date().getTime(),
+        client = new XMLHttpRequest()
+    var uuid_token = token();
+    client.open('POST', CROSSDOMAIN + 'resources/preflight.py?token='
+                        + uuid_token, true)
+
+    client.setRequestHeader('Accept', 'jewelry')
+    client.setRequestHeader('accept-language', 'nn_NO,nn,en')
+    client.setRequestHeader('content-type', 'text/plain; parameter=extra')
+    client.setRequestHeader('content-Language', 'nn_NO')
+
+    client.onload = simple_async.step_func(function() {
+        assert_equals(client.getResponseHeader('content-type'), &quot;text/plain&quot;, 'content-type response header')
+        assert_equals(client.response, 'NO', 'response')
+        simple_async.done()
+    })
+    client.onerror = simple_async.step_func(function () { assert_unreached('onerror') })
+    client.send()
+})
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsstatusasyncexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/status-async-expected.txt (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/status-async-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/status-async-expected.txt        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,67 @@
</span><ins>+Blocked access to external URL http://www1.localhost:8800/cors/resources/status.py?code=200&amp;text=OK&amp;content=Not%20today.&amp;type=
+CONSOLE MESSAGE: line 39: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?code=200&amp;text=OK&amp;content=Not%20today.&amp;type= due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/status.py?code=201&amp;text=OK/Created&amp;content=Not%20today%2001.&amp;type=
+CONSOLE MESSAGE: line 39: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?code=201&amp;text=OK/Created&amp;content=Not%20today%2001.&amp;type= due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/status.py?code=202&amp;text=OK/Accepted&amp;content=Not%20today%2002.&amp;type=
+CONSOLE MESSAGE: line 39: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?code=202&amp;text=OK/Accepted&amp;content=Not%20today%2002.&amp;type= due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/status.py?code=203&amp;text=OK/Non-Authoritative%20Information&amp;content=Not%20today%2003.&amp;type=
+CONSOLE MESSAGE: line 39: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?code=203&amp;text=OK/Non-Authoritative%20Information&amp;content=Not%20today%2003.&amp;type= due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/status.py?code=204&amp;text=OK/No%20Content&amp;content=&amp;type=
+CONSOLE MESSAGE: line 39: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?code=204&amp;text=OK/No%20Content&amp;content=&amp;type= due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/status.py?code=205&amp;text=OK/Reset%20Content&amp;content=&amp;type=
+CONSOLE MESSAGE: line 39: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?code=205&amp;text=OK/Reset%20Content&amp;content=&amp;type= due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/status.py?code=206&amp;text=OK/Partial%20Content&amp;content=Not%20today%2006.&amp;type=
+CONSOLE MESSAGE: line 39: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?code=206&amp;text=OK/Partial%20Content&amp;content=Not%20today%2006.&amp;type= due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/status.py?code=209&amp;text=OK&amp;content=Not%20today%2009.&amp;type=
+CONSOLE MESSAGE: line 39: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?code=209&amp;text=OK&amp;content=Not%20today%2009.&amp;type= due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/status.py?code=299&amp;text=OK&amp;content=Not%20today%2099.&amp;type=
+CONSOLE MESSAGE: line 39: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?code=299&amp;text=OK&amp;content=Not%20today%2099.&amp;type= due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/status.py?code=200&amp;text=OK&amp;content=%3Cx%3E402%3C/x%3E&amp;type=text/xml
+CONSOLE MESSAGE: line 39: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?code=200&amp;text=OK&amp;content=%3Cx%3E402%3C/x%3E&amp;type=text/xml due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/status.py?code=200&amp;text=OK&amp;content=Nice!&amp;type=text/doesnotmatter
+CONSOLE MESSAGE: line 39: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?code=200&amp;text=OK&amp;content=Nice!&amp;type=text/doesnotmatter due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/status.py?code=400&amp;headers=x-nonsimple&amp;text=OHAI
+CONSOLE MESSAGE: line 91: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?code=400&amp;headers=x-nonsimple&amp;text=OHAI due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/status.py?code=401&amp;headers=x-nonsimple&amp;text=OHAI
+CONSOLE MESSAGE: line 91: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?code=401&amp;headers=x-nonsimple&amp;text=OHAI due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/status.py?code=404&amp;headers=x-nonsimple&amp;text=OHAI
+CONSOLE MESSAGE: line 91: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?code=404&amp;headers=x-nonsimple&amp;text=OHAI due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/status.py?code=500&amp;headers=x-nonsimple&amp;text=OHAI
+CONSOLE MESSAGE: line 91: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?code=500&amp;headers=x-nonsimple&amp;text=OHAI due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?code=200&amp;text=OK&amp;content=400&amp;type=text/plain due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?code=200&amp;text=OK&amp;content=bah&amp;type= due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?code=699&amp;headers=x-nonsimple&amp;text=OHAI due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?code=501&amp;headers=x-nonsimple&amp;text=OHAI due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?code=400&amp;headers=x-nonsimple&amp;text=OHAI due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?code=401&amp;headers=x-nonsimple&amp;text=OHAI due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?code=404&amp;headers=x-nonsimple&amp;text=OHAI due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?code=699&amp;headers=x-nonsimple&amp;text=OHAI due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?code=501&amp;headers=x-nonsimple&amp;text=OHAI due to access control checks.
+Status returned
+
+
+FAIL Status on GET 200 assert_equals: response status expected 200 but got 0
+FAIL Status on GET 201 assert_equals: response status expected 201 but got 0
+FAIL Status on GET 202 assert_equals: response status expected 202 but got 0
+FAIL Status on GET 203 assert_equals: response status expected 203 but got 0
+FAIL Status on GET 204 assert_equals: response status expected 204 but got 0
+FAIL Status on GET 205 assert_equals: response status expected 205 but got 0
+FAIL Status on GET 206 assert_equals: response status expected 206 but got 0
+FAIL Status on GET 209 assert_equals: response status expected 209 but got 0
+FAIL Status on GET 299 assert_equals: response status expected 299 but got 0
+FAIL Status on POST 200 assert_equals: response status expected 200 but got 0
+FAIL Status on HEAD 200 assert_equals: response status expected 200 but got 0
+FAIL Status on PUT 200 assert_equals: response status expected 200 but got 0
+FAIL Status on CHICKEN 200 assert_equals: response status expected 200 but got 0
+FAIL Status on GET 400 assert_equals: response status expected 400 but got 0
+FAIL Status on HEAD 401 assert_equals: response status expected 401 but got 0
+FAIL Status on POST 404 assert_equals: response status expected 404 but got 0
+FAIL Status on POST 500 assert_equals: response status expected 500 but got 0
+PASS Status on PUT 699 
+PASS Status on CHICKEN 501 
+PASS Status on GET 400 (nonsimple) 
+PASS Status on HEAD 401 (nonsimple) 
+PASS Status on POST 404 (nonsimple) 
+PASS Status on PUT 699 (nonsimple) 
+PASS Status on CHICKEN 501 (nonsimple) 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsstatusasynchtm"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/status-async.htm (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/status-async.htm                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/status-async.htm        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,114 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;title&gt;CORS - status&lt;/title&gt;
+&lt;meta name=author title=&quot;Odin Hørthe Omdal&quot; href=&quot;mailto:odiho@opera.com&quot;&gt;
+&lt;meta name=timeout content=long&gt;
+
+&lt;script src=/resources/testharness.js&gt;&lt;/script&gt;
+&lt;script src=/resources/testharnessreport.js&gt;&lt;/script&gt;
+&lt;script src=support.js?pipe=sub&gt;&lt;/script&gt;
+
+&lt;h1&gt;Status returned&lt;/h1&gt;
+
+&lt;div id=log&gt;&lt;/div&gt;
+&lt;script&gt;
+
+function statusRequest(method, code, text, content, type) {
+    async_test(&quot;Status on &quot; + method + &quot; &quot; + code, { timeout: 15000 })
+    .step(function() {
+        var client = new XMLHttpRequest()
+        client.open(method, CROSSDOMAIN + &quot;resources/status.py?code=&quot;
+            + code + &quot;&amp;text=&quot; + text + &quot;&amp;content=&quot; + content + &quot;&amp;type=&quot; + type, true)
+        client.onreadystatechange = this.step_func(function() {
+            if (client.readyState != client.DONE)
+                return
+
+            assert_equals(client.status, code, 'response status')
+            assert_equals(client.statusText, text, 'response status text')
+            assert_equals(client.getResponseHeader(&quot;X-Request-Method&quot;), method, 'method')
+            if(method != &quot;HEAD&quot;) {
+                if(type == &quot;text/xml&quot;) {
+                    assert_equals(client.responseXML.documentElement.localName,
+                                &quot;x&quot;, 'responseXML')
+                }
+                assert_equals(client.response, content, 'response content')
+            }
+            this.done()
+        })
+
+        client.send(null)
+    })
+}
+
+  /*            method     code text  content        type */
+  statusRequest(&quot;GET&quot;,     200, 'OK', 'Not today.',  '')
+  statusRequest(&quot;GET&quot;,     201, 'OK/Created', 'Not today 01.',  '')
+  statusRequest(&quot;GET&quot;,     202, 'OK/Accepted', 'Not today 02.',  '')
+  statusRequest(&quot;GET&quot;,     203, 'OK/Non-Authoritative Information', 'Not today 03.',  '')
+  statusRequest(&quot;GET&quot;,     204, 'OK/No Content', '',  '') // specifically no-content
+  statusRequest(&quot;GET&quot;,     205, 'OK/Reset Content', '',  '') // specifically no-content
+  statusRequest(&quot;GET&quot;,     206, 'OK/Partial Content', 'Not today 06.',  '')
+  statusRequest(&quot;GET&quot;,     209, 'OK', 'Not today 09.',  '')
+  statusRequest(&quot;GET&quot;,     299, 'OK', 'Not today 99.',  '')
+  statusRequest(&quot;POST&quot;,    200, 'OK', '&lt;x&gt;402&lt;\/x&gt;', 'text/xml')
+  statusRequest(&quot;HEAD&quot;,    200, 'OK', 'Nice!',       'text/doesnotmatter')
+  statusRequest(&quot;PUT&quot;,     200, 'OK', '400',         'text/plain')
+  statusRequest(&quot;CHICKEN&quot;, 200, 'OK', 'bah',         '')
+
+
+function statusRequestFail(method, code, expect_code, nonsimple) {
+    if (expect_code === undefined)
+        expect_code = code
+
+    async_test(&quot;Status on &quot; + method + &quot; &quot; + code + (nonsimple?' (nonsimple)':''), { timeout: 15000 })
+    .step(function() {
+        var client = new XMLHttpRequest()
+
+        client.open(method, CROSSDOMAIN + &quot;resources/status.py?code=&quot;
+          + code + '&amp;headers=x-nonsimple&amp;text=OHAI', true)
+
+        if (nonsimple)
+            client.setRequestHeader('x-nonsimple', true)
+
+        client.onreadystatechange = this.step_func(function() {
+            if (client.readyState &lt; client.HEADERS_RECEIVED)
+                return
+            assert_equals(client.response, &quot;&quot;, &quot;response data&quot;)
+            assert_equals(client.status, expect_code, &quot;response status&quot;)
+            /* Response code 200 forces webserver to send OK(?) */
+            if(expect_code == 200)
+                assert_equals(client.statusText, &quot;OK&quot;, &quot;response statusText&quot;)
+            else
+                assert_equals(client.statusText, (expect_code == 0 ? &quot;&quot; : &quot;OHAI&quot;), &quot;response statusText&quot;)
+            if (client.readyState == client.DONE)
+                this.done()
+        })
+
+        client.onerror = this.step_func(function(e) {
+            assert_unreached(&quot;Got error event.&quot;)
+        })
+
+        client.send()
+    })
+}
+
+  /*                                 expect
+                    method     code  status */
+  statusRequestFail(&quot;GET&quot;,     400)
+  statusRequestFail(&quot;HEAD&quot;,    401)
+  statusRequestFail(&quot;POST&quot;,    404)
+  statusRequestFail(&quot;POST&quot;,    500)
+
+  /* Preflight response status is not 200, so the algorithm set status to 0. */
+  statusRequestFail(&quot;PUT&quot;,     699,  0)
+  statusRequestFail(&quot;CHICKEN&quot;, 501,  0)
+
+  /*                                    &quot;forced&quot;
+                                        preflight */
+  statusRequestFail(&quot;GET&quot;,     400,  0, true)
+  statusRequestFail(&quot;HEAD&quot;,    401,  0, true)
+  statusRequestFail(&quot;POST&quot;,    404,  0, true)
+  statusRequestFail(&quot;PUT&quot;,     699,  0, true)
+  statusRequestFail(&quot;CHICKEN&quot;, 501,  0, true)
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsstatusexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/status-expected.txt (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/status-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/status-expected.txt        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?1&amp;origin=none&amp;code=400
+CONSOLE MESSAGE: line 55: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?1&amp;origin=none&amp;code=400 due to access control checks.
+Blocked access to external URL http://www1.localhost:8800/cors/resources/cors-makeheader.py?3&amp;headers=x-custom&amp;code=400
+CONSOLE MESSAGE: line 55: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?3&amp;headers=x-custom&amp;code=400 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?2&amp;origin=none&amp;preflight=200 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?4&amp;headers=x-custom&amp;code=400&amp;preflight=200 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/cors-makeheader.py?5&amp;headers=x-custom&amp;preflight=400 due to access control checks.
+The returned status code in different scenarios
+
+   allowed  preflight  response  | status |
+   -------  ---------  --------  | ------ |
+ 1      no          x       400  |      0 |
+ 2      no        200         x  |      0 |
+ 3     yes          x       400  |    400 |
+ 4     yes        200       400  |    400 |
+ 5     yes        400         x  |      0 |
+
+PASS 1. CORS disallowed, response status 400. 
+PASS 2. CORS disallowed, preflight status 200. 
+FAIL 3. CORS allowed, response status 400. assert_unreached: error event Reached unreachable code
+FAIL 4. CORS allowed, preflight status 200, response status 400. assert_unreached: error event Reached unreachable code
+PASS 5. CORS allowed, preflight status 400. 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsstatuspreflightexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/status-preflight-expected.txt (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/status-preflight-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/status-preflight-expected.txt        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?1&amp;code=200&amp;headers=x-nonsimple&amp;preflight=200 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?2&amp;code=204&amp;headers=x-nonsimple&amp;preflight=200 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?3&amp;code=400&amp;headers=x-nonsimple&amp;preflight=200 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?4&amp;code=401&amp;headers=x-nonsimple&amp;preflight=200 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?5&amp;code=200&amp;headers=x-nonsimple&amp;preflight=200 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?6&amp;code=204&amp;headers=x-nonsimple&amp;preflight=200 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?7&amp;code=400&amp;headers=x-nonsimple&amp;preflight=200 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?8&amp;code=401&amp;headers=x-nonsimple&amp;preflight=200 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?9&amp;code=501&amp;headers=x-nonsimple&amp;preflight=200 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?10&amp;code=699&amp;headers=x-nonsimple&amp;preflight=200 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?11&amp;code=204&amp;headers=x-nonsimple&amp;preflight=200 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?12&amp;code=400&amp;headers=x-nonsimple&amp;preflight=200 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?13&amp;code=401&amp;headers=x-nonsimple&amp;preflight=200 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?14&amp;code=404&amp;headers=x-nonsimple&amp;preflight=200 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?15&amp;code=699&amp;headers=x-nonsimple&amp;preflight=200 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://www1.localhost:8800/cors/resources/status.py?16&amp;code=501&amp;headers=x-nonsimple&amp;preflight=200 due to access control checks.
+Status after preflight
+
+
+FAIL CORS - status after preflight on GET 200 assert_equals: response status expected 200 but got 0
+FAIL CORS - status after preflight on GET 204 assert_equals: response status expected 204 but got 0
+FAIL CORS - status after preflight on GET 400 assert_equals: response status expected 400 but got 0
+FAIL CORS - status after preflight on GET 401 assert_equals: response status expected 401 but got 0
+FAIL CORS - status after preflight on HEAD 200 assert_equals: response status expected 200 but got 0
+FAIL CORS - status after preflight on HEAD 204 assert_equals: response status expected 204 but got 0
+FAIL CORS - status after preflight on HEAD 400 assert_equals: response status expected 400 but got 0
+FAIL CORS - status after preflight on HEAD 401 assert_equals: response status expected 401 but got 0
+FAIL CORS - status after preflight on HEAD 501 assert_equals: response status expected 501 but got 0
+FAIL CORS - status after preflight on HEAD 699 assert_equals: response status expected 699 but got 0
+FAIL CORS - status after preflight on POST 204 assert_equals: response status expected 204 but got 0
+FAIL CORS - status after preflight on POST 400 assert_equals: response status expected 400 but got 0
+FAIL CORS - status after preflight on POST 401 assert_equals: response status expected 401 but got 0
+FAIL CORS - status after preflight on POST 404 assert_equals: response status expected 404 but got 0
+FAIL CORS - status after preflight on PUT 699 assert_equals: response status expected 699 but got 0
+FAIL CORS - status after preflight on CHICKEN 501 assert_equals: response status expected 501 but got 0
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsstatuspreflighthtm"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/status-preflight.htm (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/status-preflight.htm                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/status-preflight.htm        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,65 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;title&gt;CORS - status after preflight&lt;/title&gt;
+&lt;meta name=author title=&quot;Odin Hørthe Omdal&quot; href=&quot;mailto:odiho@opera.com&quot;&gt;
+
+&lt;script src=/resources/testharness.js&gt;&lt;/script&gt;
+&lt;script src=/resources/testharnessreport.js&gt;&lt;/script&gt;
+&lt;script src=support.js?pipe=sub&gt;&lt;/script&gt;
+
+&lt;h1&gt;Status after preflight&lt;/h1&gt;
+
+&lt;div id=log&gt;&lt;/div&gt;
+&lt;script&gt;
+var counter = 0
+
+function statusAfterPreflight(method, code) {
+    counter++
+
+    async_test(document.title + &quot; on &quot; + method + &quot; &quot; + code).step(function() {
+        var client = new XMLHttpRequest()
+        client.open(method, CROSSDOMAIN + &quot;resources/status.py?&quot; + counter
+            +&quot;&amp;code=&quot; + code + '&amp;headers=x-nonsimple&amp;preflight=200', true)
+
+        client.setRequestHeader('x-nonsimple', true)
+        client.onreadystatechange = this.step_func(function() {
+            if (client.readyState &lt; client.HEADERS_RECEIVED)
+                return
+            assert_equals(client.response, &quot;&quot;, &quot;response data&quot;)
+            assert_equals(client.status, code, &quot;response status&quot;)
+            if (client.readyState == client.DONE) {
+                /* Wait for spurious error events */
+                this.step_timeout(() =&gt; { this.done() }, 10)
+            }
+        })
+
+        client.onerror = this.step_func(function() {
+            assert_unreached(&quot;Shouldn't throw no error event!&quot;)
+        })
+
+        client.send()
+    })
+}
+
+/*                   method     code */
+statusAfterPreflight(&quot;GET&quot;,     200)
+statusAfterPreflight(&quot;GET&quot;,     204)
+statusAfterPreflight(&quot;GET&quot;,     400)
+statusAfterPreflight(&quot;GET&quot;,     401)
+
+statusAfterPreflight(&quot;HEAD&quot;,    200)
+statusAfterPreflight(&quot;HEAD&quot;,    204)
+statusAfterPreflight(&quot;HEAD&quot;,    400)
+statusAfterPreflight(&quot;HEAD&quot;,    401)
+statusAfterPreflight(&quot;HEAD&quot;,    501)
+statusAfterPreflight(&quot;HEAD&quot;,    699)
+
+statusAfterPreflight(&quot;POST&quot;,    204)
+statusAfterPreflight(&quot;POST&quot;,    400)
+statusAfterPreflight(&quot;POST&quot;,    401)
+statusAfterPreflight(&quot;POST&quot;,    404)
+
+statusAfterPreflight(&quot;PUT&quot;,     699)
+statusAfterPreflight(&quot;CHICKEN&quot;, 501)
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsstatushtm"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/status.htm (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/status.htm                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/status.htm        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,80 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;title&gt;CORS status&lt;/title&gt;
+&lt;link rel=help href=https://fetch.spec.whatwg.org/&gt;
+&lt;meta name=author title=&quot;Odin Hørthe Omdal&quot; href=&quot;mailto:odiho@opera.com&quot;&gt;
+
+&lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;support.js?pipe=sub&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;The returned status code in different scenarios&lt;/h1&gt;
+
+&lt;script&gt;
+
+    var counter = 0
+
+    function testit(allow, preflight, response, status) {
+        async_test(
+            (++counter) + '. ' +
+            (allow ? 'CORS allowed' : 'CORS disallowed') +
+            (preflight ? ', preflight status '+preflight : '') +
+            (response ? ', response status '+response : '') +
+            '.'
+        ).step(function() {
+            var client = new XMLHttpRequest()
+            client.open('GET', CROSSDOMAIN + 'resources/cors-makeheader.py?' + counter +
+                (allow ? '&amp;headers=x-custom': '&amp;origin=none') +
+                (response ? '&amp;code='+response : '') +
+                (preflight ? '&amp;preflight='+preflight : '')
+            )
+
+            if (preflight)
+                client.setRequestHeader('X-Custom', 'preflight')
+
+            client.onload = this.step_func(function() {
+                if (!status)
+                    assert_unreached(&quot;load event&quot;)
+
+                /* Allow spurious error events to fire */
+                this.step_timeout(() =&gt; {
+                    assert_equals(client.status, status, &quot;status&quot;)
+                    this.done()
+                }, 10)
+            })
+
+            client.onerror = this.step_func(function() {
+                if (status)
+                    assert_unreached(&quot;error event&quot;)
+
+                assert_equals(client.readyState, client.DONE, 'readyState')
+                assert_equals(client.status, 0, 'status')
+                this.done()
+            })
+
+            client.send()
+
+        })
+    }
+
+    /*     allow  pref  resp  status */
+    testit(false, null, 400,  0)
+    testit(false, 200,  null, 0)
+    testit(true,  null, 400,  400)
+    testit(true,  200,  400,  400)
+    testit(true,  400,  null, 0)
+
+&lt;/script&gt;
+
+&lt;pre&gt;
+   allowed  preflight  response  | status |
+   -------  ---------  --------  | ------ |
+ 1      no          x       400  |      0 |
+ 2      no        200         x  |      0 |
+ 3     yes          x       400  |    400 |
+ 4     yes        200       400  |    400 |
+ 5     yes        400         x  |      0 |
+&lt;/pre&gt;
+
+&lt;div id=log&gt;&lt;/div&gt;
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorssupportjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/support.js (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/support.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/support.js        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+// For ignoring exception names (just for testing)
+/*
+_real_assert_throws = assert_throws;
+function assert_throws(d, func, desc) {
+    try {
+        func();
+    } catch(e) {
+        return true;
+    }
+    assert_unreached(&quot;Didn't throw!&quot;);
+}
+*/
+
+function dirname(path) {
+    return path.replace(/\/[^\/]*$/, '/')
+}
+
+/* This subdomain should point to this same location */
+var SUBDOMAIN = 'www1'
+var SUBDOMAIN2 = 'www2'
+var PORT = {{ports[http][1]}}
+//XXX HTTPS
+var PORTS = {{ports[https][0]}}
+
+/* Changes http://example.com/abc/def/cool.htm to http://www1.example.com/abc/def/ */
+var CROSSDOMAIN     = dirname(location.href)
+                        .replace('://', '://' + SUBDOMAIN + '.')
+var REMOTE_HOST     = SUBDOMAIN + '.' + location.host
+var REMOTE_PROTOCOL = location.protocol
+var REMOTE_ORIGIN   = REMOTE_PROTOCOL + '//' + REMOTE_HOST
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscorsw3cimportlog"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/cors/w3c-import.log (0 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/cors/w3c-import.log                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cors/w3c-import.log        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the W3C CSS or WPT github:
+        https://github.com/w3c/csswg-test
+        https://github.com/w3c/web-platform-tests
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/cors/304.htm
+/LayoutTests/imported/w3c/web-platform-tests/cors/OWNERS
+/LayoutTests/imported/w3c/web-platform-tests/cors/README.md
+/LayoutTests/imported/w3c/web-platform-tests/cors/allow-headers.htm
+/LayoutTests/imported/w3c/web-platform-tests/cors/basic.htm
+/LayoutTests/imported/w3c/web-platform-tests/cors/credentials-flag.htm
+/LayoutTests/imported/w3c/web-platform-tests/cors/late-upload-events.htm
+/LayoutTests/imported/w3c/web-platform-tests/cors/origin.htm
+/LayoutTests/imported/w3c/web-platform-tests/cors/preflight-cache.htm
+/LayoutTests/imported/w3c/web-platform-tests/cors/preflight-failure.htm
+/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-origin.htm
+/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-preflight-2.htm
+/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-preflight.htm
+/LayoutTests/imported/w3c/web-platform-tests/cors/redirect-userinfo.htm
+/LayoutTests/imported/w3c/web-platform-tests/cors/remote-origin.htm
+/LayoutTests/imported/w3c/web-platform-tests/cors/request-headers.htm
+/LayoutTests/imported/w3c/web-platform-tests/cors/response-headers.htm
+/LayoutTests/imported/w3c/web-platform-tests/cors/simple-requests.htm
+/LayoutTests/imported/w3c/web-platform-tests/cors/status-async.htm
+/LayoutTests/imported/w3c/web-platform-tests/cors/status-preflight.htm
+/LayoutTests/imported/w3c/web-platform-tests/cors/status.htm
+/LayoutTests/imported/w3c/web-platform-tests/cors/support.js
</ins></span></pre></div>
<a id="trunkLayoutTeststestsoptionsjson"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/tests-options.json (213913 => 213914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/tests-options.json        2017-03-14 17:21:17 UTC (rev 213913)
+++ trunk/LayoutTests/tests-options.json        2017-03-14 17:30:19 UTC (rev 213914)
</span><span class="lines">@@ -209,6 +209,9 @@
</span><span class="cx">     &quot;imported/w3c/web-platform-tests/XMLHttpRequest/xmlhttprequest-timeout-worker-twice.html&quot;: [
</span><span class="cx">         &quot;slow&quot;
</span><span class="cx">     ],
</span><ins>+    &quot;imported/w3c/web-platform-tests/cors/status-async.htm&quot;: [
+        &quot;slow&quot;
+    ],
</ins><span class="cx">     &quot;imported/w3c/web-platform-tests/dom/nodes/Document-characterSet-normalization.html&quot;: [
</span><span class="cx">         &quot;slow&quot;
</span><span class="cx">     ],
</span></span></pre>
</div>
</div>

</body>
</html>