<!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>[200195] 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/200195">200195</a></dd>
<dt>Author</dt> <dd>youenn.fablet@crf.canon.fr</dd>
<dt>Date</dt> <dd>2016-04-28 10:12:42 -0700 (Thu, 28 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Fetch API] Import remaining fetch tests
https://bugs.webkit.org/show_bug.cgi?id=156914

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* resources/ImportExpectations:
* web-platform-tests/fetch/api/cors/cors-basic-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-basic-worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-basic-worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-basic.html: Added.
* web-platform-tests/fetch/api/cors/cors-basic.js: Added.
* web-platform-tests/fetch/api/cors/cors-cookies-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-cookies-worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-cookies-worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-cookies.html: Added.
* web-platform-tests/fetch/api/cors/cors-cookies.js: Added.
* web-platform-tests/fetch/api/cors/cors-filtering-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-filtering-worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-filtering-worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-filtering.html: Added.
* web-platform-tests/fetch/api/cors/cors-filtering.js: Added.
* web-platform-tests/fetch/api/cors/cors-multiple-origins-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-multiple-origins-worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-multiple-origins-worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-multiple-origins.html: Added.
* web-platform-tests/fetch/api/cors/cors-multiple-origins.js: Added.
* web-platform-tests/fetch/api/cors/cors-no-preflight-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-no-preflight-worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-no-preflight-worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-no-preflight.html: Added.
* web-platform-tests/fetch/api/cors/cors-no-preflight.js: Added.
* web-platform-tests/fetch/api/cors/cors-origin-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-origin-worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-origin-worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-origin.html: Added.
* web-platform-tests/fetch/api/cors/cors-origin.js: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-redirect-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-redirect-worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-redirect-worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-redirect.html: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-redirect.js: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-referrer-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-referrer.html: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-referrer.js: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-status-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-status-worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-status.html: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-status.js: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-preflight.html: Added.
* web-platform-tests/fetch/api/cors/cors-preflight.js: Added.
* web-platform-tests/fetch/api/cors/cors-redirect-credentials-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-redirect-credentials-worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-redirect-credentials-worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-redirect-credentials.html: Added.
* web-platform-tests/fetch/api/cors/cors-redirect-credentials.js: Added.
* web-platform-tests/fetch/api/cors/cors-redirect-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-redirect-worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-redirect-worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-redirect.html: Added.
* web-platform-tests/fetch/api/cors/cors-redirect.js: Added.
* web-platform-tests/fetch/api/cors/w3c-import.log: Added.
* web-platform-tests/fetch/api/credentials/authentication-basic-expected.txt: Added.
* web-platform-tests/fetch/api/credentials/authentication-basic-worker-expected.txt: Added.
* web-platform-tests/fetch/api/credentials/authentication-basic-worker.html: Added.
* web-platform-tests/fetch/api/credentials/authentication-basic.html: Added.
* web-platform-tests/fetch/api/credentials/authentication-basic.js: Added.
* web-platform-tests/fetch/api/credentials/cookies-expected.txt: Added.
* web-platform-tests/fetch/api/credentials/cookies-worker-expected.txt: Added.
* web-platform-tests/fetch/api/credentials/cookies-worker.html: Added.
* web-platform-tests/fetch/api/credentials/cookies.html: Added.
* web-platform-tests/fetch/api/credentials/cookies.js: Added.
* web-platform-tests/fetch/api/credentials/w3c-import.log: Added.
* web-platform-tests/fetch/api/policies/csp-blocked-expected.txt: Added.
* web-platform-tests/fetch/api/policies/csp-blocked-worker-expected.txt: Added.
* web-platform-tests/fetch/api/policies/csp-blocked-worker.html: Added.
* web-platform-tests/fetch/api/policies/csp-blocked.html: Added.
* web-platform-tests/fetch/api/policies/csp-blocked.html.headers: Added.
* web-platform-tests/fetch/api/policies/csp-blocked.js: Added.
* web-platform-tests/fetch/api/policies/csp-blocked.js.headers: Added.
* web-platform-tests/fetch/api/policies/referrer-no-referrer-expected.txt: Added.
* web-platform-tests/fetch/api/policies/referrer-no-referrer-worker-expected.txt: Added.
* web-platform-tests/fetch/api/policies/referrer-no-referrer-worker.html: Added.
* web-platform-tests/fetch/api/policies/referrer-no-referrer.html: Added.
* web-platform-tests/fetch/api/policies/referrer-no-referrer.html.headers: Added.
* web-platform-tests/fetch/api/policies/referrer-no-referrer.js: Added.
* web-platform-tests/fetch/api/policies/referrer-no-referrer.js.headers: Added.
* web-platform-tests/fetch/api/policies/referrer-origin-expected.txt: Added.
* web-platform-tests/fetch/api/policies/referrer-origin-worker-expected.txt: Added.
* web-platform-tests/fetch/api/policies/referrer-origin-worker.html: Added.
* web-platform-tests/fetch/api/policies/referrer-origin.html: Added.
* web-platform-tests/fetch/api/policies/referrer-origin.html.headers: Added.
* web-platform-tests/fetch/api/policies/referrer-origin.js: Added.
* web-platform-tests/fetch/api/policies/referrer-origin.js.headers: Added.
* web-platform-tests/fetch/api/policies/referrer-unsafe-url-expected.txt: Added.
* web-platform-tests/fetch/api/policies/referrer-unsafe-url-worker-expected.txt: Added.
* web-platform-tests/fetch/api/policies/referrer-unsafe-url-worker.html: Added.
* web-platform-tests/fetch/api/policies/referrer-unsafe-url.html: Added.
* web-platform-tests/fetch/api/policies/referrer-unsafe-url.html.headers: Added.
* web-platform-tests/fetch/api/policies/referrer-unsafe-url.js: Added.
* web-platform-tests/fetch/api/policies/referrer-unsafe-url.js.headers: Added.
* web-platform-tests/fetch/api/policies/w3c-import.log: Added.
* web-platform-tests/fetch/api/redirect/redirect-count-expected.txt: Added.
* web-platform-tests/fetch/api/redirect/redirect-count-worker-expected.txt: Added.
* web-platform-tests/fetch/api/redirect/redirect-count-worker.html: Added.
* web-platform-tests/fetch/api/redirect/redirect-count.html: Added.
* web-platform-tests/fetch/api/redirect/redirect-count.js: Added.
* web-platform-tests/fetch/api/redirect/redirect-location-expected.txt: Added.
* web-platform-tests/fetch/api/redirect/redirect-location-worker-expected.txt: Added.
* web-platform-tests/fetch/api/redirect/redirect-location-worker.html: Added.
* web-platform-tests/fetch/api/redirect/redirect-location.html: Added.
* web-platform-tests/fetch/api/redirect/redirect-location.js: Added.
* web-platform-tests/fetch/api/redirect/redirect-method-expected.txt: Added.
* web-platform-tests/fetch/api/redirect/redirect-method-worker-expected.txt: Added.
* web-platform-tests/fetch/api/redirect/redirect-method-worker.html: Added.
* web-platform-tests/fetch/api/redirect/redirect-method.html: Added.
* web-platform-tests/fetch/api/redirect/redirect-method.js: Added.
* web-platform-tests/fetch/api/redirect/redirect-mode-expected.txt: Added.
* web-platform-tests/fetch/api/redirect/redirect-mode-worker-expected.txt: Added.
* web-platform-tests/fetch/api/redirect/redirect-mode-worker.html: Added.
* web-platform-tests/fetch/api/redirect/redirect-mode.html: Added.
* web-platform-tests/fetch/api/redirect/redirect-mode.js: Added.
* web-platform-tests/fetch/api/redirect/w3c-import.log: Added.
* web-platform-tests/fetch/nosniff/image-expected.txt: Added.
* web-platform-tests/fetch/nosniff/image.html: Added.
* web-platform-tests/fetch/nosniff/importscripts-expected.txt: Added.
* web-platform-tests/fetch/nosniff/importscripts.html: Added.
* web-platform-tests/fetch/nosniff/importscripts.js: Added.
* web-platform-tests/fetch/nosniff/parsing-nosniff-expected.txt: Added.
* web-platform-tests/fetch/nosniff/parsing-nosniff.html: Added.
* web-platform-tests/fetch/nosniff/resources/css.py: Added.
* web-platform-tests/fetch/nosniff/resources/image.py: Added.
* web-platform-tests/fetch/nosniff/resources/js.py: Added.
* web-platform-tests/fetch/nosniff/resources/nosniff-first.asis: Added.
* web-platform-tests/fetch/nosniff/resources/nosniff-last.asis: Added.
* web-platform-tests/fetch/nosniff/resources/nosniff-no-x.asis: Added.
* web-platform-tests/fetch/nosniff/resources/nosniff-quoted-single.asis: Added.
* web-platform-tests/fetch/nosniff/resources/nosniff-quoted.asis: Added.
* web-platform-tests/fetch/nosniff/resources/nosniff-uppercase.asis: Added.
* web-platform-tests/fetch/nosniff/resources/w3c-import.log: Added.
* web-platform-tests/fetch/nosniff/resources/worker.py: Added.
* web-platform-tests/fetch/nosniff/script-expected.txt: Added.
* web-platform-tests/fetch/nosniff/script.html: Added.
* web-platform-tests/fetch/nosniff/stylesheet-expected.txt: Added.
* web-platform-tests/fetch/nosniff/stylesheet.html: Added.
* web-platform-tests/fetch/nosniff/w3c-import.log: Added.
* web-platform-tests/fetch/nosniff/worker.html: Added.

LayoutTests:

* TestExpectations: Skipping new fetch worker tests as they are
causing other tests to crash (see bug 156737 and bug 157068).
* platform/gtk/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/fetch/nosniff/stylesheet-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic-expected.txt: Added.</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="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cresourcesImportExpectations">trunk/LayoutTests/imported/w3c/resources/ImportExpectations</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/</li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsbasicexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsbasicworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsbasicworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsbasichtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsbasicjs">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorscookiesexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorscookiesworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorscookiesworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorscookieshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorscookiesjs">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsfilteringexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-filtering-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsfilteringworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-filtering-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsfilteringworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-filtering-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsfilteringhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-filtering.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsfilteringjs">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-filtering.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsmultipleoriginsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-multiple-origins-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsmultipleoriginsworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-multiple-origins-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsmultipleoriginsworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-multiple-origins-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsmultipleoriginshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-multiple-origins.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsmultipleoriginsjs">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-multiple-origins.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsnopreflightexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsnopreflightworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsnopreflightworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsnopreflighthtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsnopreflightjs">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsoriginexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsoriginworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsoriginworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsoriginhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsoriginjs">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightredirectexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightredirectworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightredirectworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightredirecthtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightredirectjs">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightreferrerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightreferrerworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightreferrerworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightreferrerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightreferrerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightstatusexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightstatusworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightstatusworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightstatushtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightstatusjs">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflighthtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightjs">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsredirectcredentialsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsredirectcredentialsworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsredirectcredentialsworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsredirectcredentialshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsredirectcredentialsjs">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsredirectexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsredirectworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsredirectworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsredirecthtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsredirectjs">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorsw3cimportlog">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/w3c-import.log</a></li>
<li>trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/</li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicredentialsauthenticationbasicexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicredentialsauthenticationbasicworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicredentialsauthenticationbasicworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicredentialsauthenticationbasichtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicredentialsauthenticationbasicjs">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicredentialscookiesexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicredentialscookiesworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicredentialscookiesworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicredentialscookieshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicredentialscookiesjs">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapicredentialsw3cimportlog">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/w3c-import.log</a></li>
<li>trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/</li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciescspblockedexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciescspblockedworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciescspblockedworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciescspblockedhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciescspblockedhtmlheaders">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked.html.headers</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciescspblockedjs">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciescspblockedjsheaders">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked.js.headers</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrernoreferrerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrernoreferrerworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrernoreferrerworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrernoreferrerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrernoreferrerhtmlheaders">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer.html.headers</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrernoreferrerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrernoreferrerjsheaders">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer.js.headers</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferreroriginexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferreroriginworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferreroriginworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferreroriginhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferreroriginhtmlheaders">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin.html.headers</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferreroriginjs">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferreroriginjsheaders">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin.js.headers</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrerunsafeurlexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrerunsafeurlworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrerunsafeurlworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrerunsafeurlhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrerunsafeurlhtmlheaders">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url.html.headers</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrerunsafeurljs">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrerunsafeurljsheaders">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url.js.headers</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesw3cimportlog">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/w3c-import.log</a></li>
<li>trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/</li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectcountexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectcountworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectcountworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectcounthtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectcountjs">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectlocationexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectlocationworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectlocationworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectlocationhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectlocationjs">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectmethodexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectmethodworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectmethodworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectmethodhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectmethodjs">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectmodeexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectmodeworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectmodeworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectmodehtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectmodejs">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectw3cimportlog">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/w3c-import.log</a></li>
<li>trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/</li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffimageexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/image-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffimagehtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/image.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffimportscriptsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/importscripts-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffimportscriptshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/importscripts.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffimportscriptsjs">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/importscripts.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffparsingnosniffexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/parsing-nosniff-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffparsingnosniffhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/parsing-nosniff.html</a></li>
<li>trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/</li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffresourcescsspy">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/css.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffresourcesimagepy">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/image.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffresourcesjspy">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/js.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffresourcesnosnifffirstasis">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-first.asis</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffresourcesnosnifflastasis">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-last.asis</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffresourcesnosniffnoxasis">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-no-x.asis</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffresourcesnosniffquotedsingleasis">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-quoted-single.asis</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffresourcesnosniffquotedasis">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-quoted.asis</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffresourcesnosniffuppercaseasis">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-uppercase.asis</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffresourcesw3cimportlog">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/w3c-import.log</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffresourcesworkerpy">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/worker.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffscriptexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/script-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffscripthtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/script.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffstylesheetexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/stylesheet-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffstylesheethtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/stylesheet.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffw3cimportlog">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/w3c-import.log</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/worker.html</a></li>
<li>trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/fetch/api/redirect/</li>
<li><a href="#trunkLayoutTestsplatformgtkimportedw3cwebplatformtestsfetchapiredirectredirectlocationexpectedtxt">trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformgtkimportedw3cwebplatformtestsfetchapiredirectredirectmethodexpectedtxt">trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-expected.txt</a></li>
<li>trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/fetch/nosniff/</li>
<li><a href="#trunkLayoutTestsplatformgtkimportedw3cwebplatformtestsfetchnosniffstylesheetexpectedtxt">trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/fetch/nosniff/stylesheet-expected.txt</a></li>
<li>trunk/LayoutTests/platform/mac-wk1/imported/</li>
<li>trunk/LayoutTests/platform/mac-wk1/imported/w3c/</li>
<li>trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/</li>
<li>trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/fetch/</li>
<li>trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/fetch/api/</li>
<li>trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/fetch/api/credentials/</li>
<li><a href="#trunkLayoutTestsplatformmacwk1importedw3cwebplatformtestsfetchapicredentialsauthenticationbasicexpectedtxt">trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic-expected.txt</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (200194 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-04-28 17:05:17 UTC (rev 200194)
+++ trunk/LayoutTests/ChangeLog        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2016-04-28  Youenn Fablet  &lt;youenn.fablet@crf.canon.fr&gt;
+
+        [Fetch API] Import remaining fetch tests
+        https://bugs.webkit.org/show_bug.cgi?id=156914
+
+        Reviewed by Darin Adler.
+
+        * TestExpectations: Skipping new fetch worker tests as they are
+        causing other tests to crash (see bug 156737 and bug 157068).
+        * platform/gtk/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-expected.txt: Added.
+        * platform/gtk/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-expected.txt: Added.
+        * platform/gtk/imported/w3c/web-platform-tests/fetch/nosniff/stylesheet-expected.txt: Added.
+        * platform/mac-wk1/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic-expected.txt: Added.
+
</ins><span class="cx"> 2016-04-28  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Web IDL] Specify default values for optional parameters of type 'DOMString'
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (200194 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations        2016-04-28 17:05:17 UTC (rev 200194)
+++ trunk/LayoutTests/TestExpectations        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -319,6 +319,33 @@
</span><span class="cx"> imported/w3c/web-platform-tests/XMLHttpRequest/send-redirect-to-cors.htm [ Skip ]
</span><span class="cx"> imported/w3c/web-platform-tests/XMLHttpRequest/send-redirect-to-non-cors.htm [ Skip ]
</span><span class="cx"> 
</span><ins>+# Fetch Worker tests skipped until bug 156737 is resolved
+imported/w3c/web-platform-tests/fetch/api/cors/cors-basic-worker.html [ Skip ]
+imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-worker.html [ Skip ]
+imported/w3c/web-platform-tests/fetch/api/cors/cors-filtering-worker.html [ Skip ]
+imported/w3c/web-platform-tests/fetch/api/cors/cors-multiple-origins-worker.html [ Skip ]
+imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight-worker.html [ Skip ]
+imported/w3c/web-platform-tests/fetch/api/cors/cors-origin-worker.html [ Skip ]
+imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect-worker.html [ Skip ]
+imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker.html [ Skip ]
+imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html [ Skip ]
+imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-worker.html [ Skip ]
+imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials-worker.html [ Skip ]
+imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-worker.html [ Skip ]
+imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic-worker.html [ Skip ]
+imported/w3c/web-platform-tests/fetch/api/credentials/cookies-worker.html [ Skip ]
+imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked-worker.html [ Skip ]
+imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer-worker.html [ Skip ]
+imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin-worker.html [ Skip ]
+imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url-worker.html [ Skip ]
+imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count-worker.html [ Skip ]
+imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-worker.html [ Skip ]
+imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-worker.html [ Skip ]
+imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode-worker.html [ Skip ]
+imported/w3c/web-platform-tests/fetch/nosniff/worker.html [ Skip ]
+
+webkit.org/b/157068 imported/w3c/web-platform-tests/fetch/nosniff/importscripts.html [ Skip ]
+
</ins><span class="cx"> # New W3C ref tests that are failing.
</span><span class="cx"> webkit.org/b/148856 imported/w3c/web-platform-tests/html/semantics/embedded-content/the-video-element/video_initially_paused.html [ ImageOnlyFailure ]
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (200194 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-04-28 17:05:17 UTC (rev 200194)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -1,3 +1,158 @@
</span><ins>+2016-04-28  Youenn Fablet  &lt;youenn.fablet@crf.canon.fr&gt;
+
+        [Fetch API] Import remaining fetch tests
+        https://bugs.webkit.org/show_bug.cgi?id=156914
+
+        Reviewed by Darin Adler.
+
+        * resources/ImportExpectations:
+        * web-platform-tests/fetch/api/cors/cors-basic-expected.txt: Added.
+        * web-platform-tests/fetch/api/cors/cors-basic-worker-expected.txt: Added.
+        * web-platform-tests/fetch/api/cors/cors-basic-worker.html: Added.
+        * web-platform-tests/fetch/api/cors/cors-basic.html: Added.
+        * web-platform-tests/fetch/api/cors/cors-basic.js: Added.
+        * web-platform-tests/fetch/api/cors/cors-cookies-expected.txt: Added.
+        * web-platform-tests/fetch/api/cors/cors-cookies-worker-expected.txt: Added.
+        * web-platform-tests/fetch/api/cors/cors-cookies-worker.html: Added.
+        * web-platform-tests/fetch/api/cors/cors-cookies.html: Added.
+        * web-platform-tests/fetch/api/cors/cors-cookies.js: Added.
+        * web-platform-tests/fetch/api/cors/cors-filtering-expected.txt: Added.
+        * web-platform-tests/fetch/api/cors/cors-filtering-worker-expected.txt: Added.
+        * web-platform-tests/fetch/api/cors/cors-filtering-worker.html: Added.
+        * web-platform-tests/fetch/api/cors/cors-filtering.html: Added.
+        * web-platform-tests/fetch/api/cors/cors-filtering.js: Added.
+        * web-platform-tests/fetch/api/cors/cors-multiple-origins-expected.txt: Added.
+        * web-platform-tests/fetch/api/cors/cors-multiple-origins-worker-expected.txt: Added.
+        * web-platform-tests/fetch/api/cors/cors-multiple-origins-worker.html: Added.
+        * web-platform-tests/fetch/api/cors/cors-multiple-origins.html: Added.
+        * web-platform-tests/fetch/api/cors/cors-multiple-origins.js: Added.
+        * web-platform-tests/fetch/api/cors/cors-no-preflight-expected.txt: Added.
+        * web-platform-tests/fetch/api/cors/cors-no-preflight-worker-expected.txt: Added.
+        * web-platform-tests/fetch/api/cors/cors-no-preflight-worker.html: Added.
+        * web-platform-tests/fetch/api/cors/cors-no-preflight.html: Added.
+        * web-platform-tests/fetch/api/cors/cors-no-preflight.js: Added.
+        * web-platform-tests/fetch/api/cors/cors-origin-expected.txt: Added.
+        * web-platform-tests/fetch/api/cors/cors-origin-worker-expected.txt: Added.
+        * web-platform-tests/fetch/api/cors/cors-origin-worker.html: Added.
+        * web-platform-tests/fetch/api/cors/cors-origin.html: Added.
+        * web-platform-tests/fetch/api/cors/cors-origin.js: Added.
+        * web-platform-tests/fetch/api/cors/cors-preflight-expected.txt: Added.
+        * web-platform-tests/fetch/api/cors/cors-preflight-redirect-expected.txt: Added.
+        * web-platform-tests/fetch/api/cors/cors-preflight-redirect-worker-expected.txt: Added.
+        * web-platform-tests/fetch/api/cors/cors-preflight-redirect-worker.html: Added.
+        * web-platform-tests/fetch/api/cors/cors-preflight-redirect.html: Added.
+        * web-platform-tests/fetch/api/cors/cors-preflight-redirect.js: Added.
+        * web-platform-tests/fetch/api/cors/cors-preflight-referrer-expected.txt: Added.
+        * web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker-expected.txt: Added.
+        * web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker.html: Added.
+        * web-platform-tests/fetch/api/cors/cors-preflight-referrer.html: Added.
+        * web-platform-tests/fetch/api/cors/cors-preflight-referrer.js: Added.
+        * web-platform-tests/fetch/api/cors/cors-preflight-status-expected.txt: Added.
+        * web-platform-tests/fetch/api/cors/cors-preflight-status-worker-expected.txt: Added.
+        * web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html: Added.
+        * web-platform-tests/fetch/api/cors/cors-preflight-status.html: Added.
+        * web-platform-tests/fetch/api/cors/cors-preflight-status.js: Added.
+        * web-platform-tests/fetch/api/cors/cors-preflight-worker-expected.txt: Added.
+        * web-platform-tests/fetch/api/cors/cors-preflight-worker.html: Added.
+        * web-platform-tests/fetch/api/cors/cors-preflight.html: Added.
+        * web-platform-tests/fetch/api/cors/cors-preflight.js: Added.
+        * web-platform-tests/fetch/api/cors/cors-redirect-credentials-expected.txt: Added.
+        * web-platform-tests/fetch/api/cors/cors-redirect-credentials-worker-expected.txt: Added.
+        * web-platform-tests/fetch/api/cors/cors-redirect-credentials-worker.html: Added.
+        * web-platform-tests/fetch/api/cors/cors-redirect-credentials.html: Added.
+        * web-platform-tests/fetch/api/cors/cors-redirect-credentials.js: Added.
+        * web-platform-tests/fetch/api/cors/cors-redirect-expected.txt: Added.
+        * web-platform-tests/fetch/api/cors/cors-redirect-worker-expected.txt: Added.
+        * web-platform-tests/fetch/api/cors/cors-redirect-worker.html: Added.
+        * web-platform-tests/fetch/api/cors/cors-redirect.html: Added.
+        * web-platform-tests/fetch/api/cors/cors-redirect.js: Added.
+        * web-platform-tests/fetch/api/cors/w3c-import.log: Added.
+        * web-platform-tests/fetch/api/credentials/authentication-basic-expected.txt: Added.
+        * web-platform-tests/fetch/api/credentials/authentication-basic-worker-expected.txt: Added.
+        * web-platform-tests/fetch/api/credentials/authentication-basic-worker.html: Added.
+        * web-platform-tests/fetch/api/credentials/authentication-basic.html: Added.
+        * web-platform-tests/fetch/api/credentials/authentication-basic.js: Added.
+        * web-platform-tests/fetch/api/credentials/cookies-expected.txt: Added.
+        * web-platform-tests/fetch/api/credentials/cookies-worker-expected.txt: Added.
+        * web-platform-tests/fetch/api/credentials/cookies-worker.html: Added.
+        * web-platform-tests/fetch/api/credentials/cookies.html: Added.
+        * web-platform-tests/fetch/api/credentials/cookies.js: Added.
+        * web-platform-tests/fetch/api/credentials/w3c-import.log: Added.
+        * web-platform-tests/fetch/api/policies/csp-blocked-expected.txt: Added.
+        * web-platform-tests/fetch/api/policies/csp-blocked-worker-expected.txt: Added.
+        * web-platform-tests/fetch/api/policies/csp-blocked-worker.html: Added.
+        * web-platform-tests/fetch/api/policies/csp-blocked.html: Added.
+        * web-platform-tests/fetch/api/policies/csp-blocked.html.headers: Added.
+        * web-platform-tests/fetch/api/policies/csp-blocked.js: Added.
+        * web-platform-tests/fetch/api/policies/csp-blocked.js.headers: Added.
+        * web-platform-tests/fetch/api/policies/referrer-no-referrer-expected.txt: Added.
+        * web-platform-tests/fetch/api/policies/referrer-no-referrer-worker-expected.txt: Added.
+        * web-platform-tests/fetch/api/policies/referrer-no-referrer-worker.html: Added.
+        * web-platform-tests/fetch/api/policies/referrer-no-referrer.html: Added.
+        * web-platform-tests/fetch/api/policies/referrer-no-referrer.html.headers: Added.
+        * web-platform-tests/fetch/api/policies/referrer-no-referrer.js: Added.
+        * web-platform-tests/fetch/api/policies/referrer-no-referrer.js.headers: Added.
+        * web-platform-tests/fetch/api/policies/referrer-origin-expected.txt: Added.
+        * web-platform-tests/fetch/api/policies/referrer-origin-worker-expected.txt: Added.
+        * web-platform-tests/fetch/api/policies/referrer-origin-worker.html: Added.
+        * web-platform-tests/fetch/api/policies/referrer-origin.html: Added.
+        * web-platform-tests/fetch/api/policies/referrer-origin.html.headers: Added.
+        * web-platform-tests/fetch/api/policies/referrer-origin.js: Added.
+        * web-platform-tests/fetch/api/policies/referrer-origin.js.headers: Added.
+        * web-platform-tests/fetch/api/policies/referrer-unsafe-url-expected.txt: Added.
+        * web-platform-tests/fetch/api/policies/referrer-unsafe-url-worker-expected.txt: Added.
+        * web-platform-tests/fetch/api/policies/referrer-unsafe-url-worker.html: Added.
+        * web-platform-tests/fetch/api/policies/referrer-unsafe-url.html: Added.
+        * web-platform-tests/fetch/api/policies/referrer-unsafe-url.html.headers: Added.
+        * web-platform-tests/fetch/api/policies/referrer-unsafe-url.js: Added.
+        * web-platform-tests/fetch/api/policies/referrer-unsafe-url.js.headers: Added.
+        * web-platform-tests/fetch/api/policies/w3c-import.log: Added.
+        * web-platform-tests/fetch/api/redirect/redirect-count-expected.txt: Added.
+        * web-platform-tests/fetch/api/redirect/redirect-count-worker-expected.txt: Added.
+        * web-platform-tests/fetch/api/redirect/redirect-count-worker.html: Added.
+        * web-platform-tests/fetch/api/redirect/redirect-count.html: Added.
+        * web-platform-tests/fetch/api/redirect/redirect-count.js: Added.
+        * web-platform-tests/fetch/api/redirect/redirect-location-expected.txt: Added.
+        * web-platform-tests/fetch/api/redirect/redirect-location-worker-expected.txt: Added.
+        * web-platform-tests/fetch/api/redirect/redirect-location-worker.html: Added.
+        * web-platform-tests/fetch/api/redirect/redirect-location.html: Added.
+        * web-platform-tests/fetch/api/redirect/redirect-location.js: Added.
+        * web-platform-tests/fetch/api/redirect/redirect-method-expected.txt: Added.
+        * web-platform-tests/fetch/api/redirect/redirect-method-worker-expected.txt: Added.
+        * web-platform-tests/fetch/api/redirect/redirect-method-worker.html: Added.
+        * web-platform-tests/fetch/api/redirect/redirect-method.html: Added.
+        * web-platform-tests/fetch/api/redirect/redirect-method.js: Added.
+        * web-platform-tests/fetch/api/redirect/redirect-mode-expected.txt: Added.
+        * web-platform-tests/fetch/api/redirect/redirect-mode-worker-expected.txt: Added.
+        * web-platform-tests/fetch/api/redirect/redirect-mode-worker.html: Added.
+        * web-platform-tests/fetch/api/redirect/redirect-mode.html: Added.
+        * web-platform-tests/fetch/api/redirect/redirect-mode.js: Added.
+        * web-platform-tests/fetch/api/redirect/w3c-import.log: Added.
+        * web-platform-tests/fetch/nosniff/image-expected.txt: Added.
+        * web-platform-tests/fetch/nosniff/image.html: Added.
+        * web-platform-tests/fetch/nosniff/importscripts-expected.txt: Added.
+        * web-platform-tests/fetch/nosniff/importscripts.html: Added.
+        * web-platform-tests/fetch/nosniff/importscripts.js: Added.
+        * web-platform-tests/fetch/nosniff/parsing-nosniff-expected.txt: Added.
+        * web-platform-tests/fetch/nosniff/parsing-nosniff.html: Added.
+        * web-platform-tests/fetch/nosniff/resources/css.py: Added.
+        * web-platform-tests/fetch/nosniff/resources/image.py: Added.
+        * web-platform-tests/fetch/nosniff/resources/js.py: Added.
+        * web-platform-tests/fetch/nosniff/resources/nosniff-first.asis: Added.
+        * web-platform-tests/fetch/nosniff/resources/nosniff-last.asis: Added.
+        * web-platform-tests/fetch/nosniff/resources/nosniff-no-x.asis: Added.
+        * web-platform-tests/fetch/nosniff/resources/nosniff-quoted-single.asis: Added.
+        * web-platform-tests/fetch/nosniff/resources/nosniff-quoted.asis: Added.
+        * web-platform-tests/fetch/nosniff/resources/nosniff-uppercase.asis: Added.
+        * web-platform-tests/fetch/nosniff/resources/w3c-import.log: Added.
+        * web-platform-tests/fetch/nosniff/resources/worker.py: Added.
+        * web-platform-tests/fetch/nosniff/script-expected.txt: Added.
+        * web-platform-tests/fetch/nosniff/script.html: Added.
+        * web-platform-tests/fetch/nosniff/stylesheet-expected.txt: Added.
+        * web-platform-tests/fetch/nosniff/stylesheet.html: Added.
+        * web-platform-tests/fetch/nosniff/w3c-import.log: Added.
+        * web-platform-tests/fetch/nosniff/worker.html: Added.
+
</ins><span class="cx"> 2016-04-28  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Web IDL] Specify default values for optional parameters of type 'DOMString'
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cresourcesImportExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/resources/ImportExpectations (200194 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/resources/ImportExpectations        2016-04-28 17:05:17 UTC (rev 200194)
+++ trunk/LayoutTests/imported/w3c/resources/ImportExpectations        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -120,11 +120,6 @@
</span><span class="cx"> web-platform-tests/eventsource [ Skip ]
</span><span class="cx"> web-platform-tests/ext-xhtml-pubid [ Skip ]
</span><span class="cx"> #web-platform-tests/fetch [ Import ]
</span><del>-web-platform-tests/fetch/api/cors [ Skip ]
-web-platform-tests/fetch/api/credentials [ Skip ]
-web-platform-tests/fetch/api/policies [ Skip ]
-web-platform-tests/fetch/api/redirect [ Skip ]
-web-platform-tests/fetch/nosniff [ Skip ]
</del><span class="cx"> web-platform-tests/geolocation-API [ Skip ]
</span><span class="cx"> web-platform-tests/gamepad [ Skip ]
</span><span class="cx"> web-platform-tests/hr-time [ Skip ]
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsbasicexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+
+FAIL Cross domain basic usage [no-cors mode] promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+PASS Cross domain basic usage [server forbid CORS] 
+FAIL Cross domain basic usage [cors mode] promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL Same domain different port [no-cors mode] promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+PASS Same domain different port [server forbid CORS] 
+FAIL Same domain different port [cors mode] promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL Cross domain different port [no-cors mode] promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+PASS Cross domain different port [server forbid CORS] 
+FAIL Cross domain different port [cors mode] promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL Cross domain different protocol [no-cors mode] promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+PASS Cross domain different protocol [server forbid CORS] 
+FAIL Cross domain different protocol [cors mode] promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL Same domain different protocol different port [no-cors mode] promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+PASS Same domain different protocol different port [server forbid CORS] 
+FAIL Same domain different protocol different port [cors mode] promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsbasicworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic-worker-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic-worker-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+
+FAIL Cross domain basic usage [no-cors mode] promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+PASS Cross domain basic usage [server forbid CORS] 
+FAIL Cross domain basic usage [cors mode] promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL Same domain different port [no-cors mode] promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+PASS Same domain different port [server forbid CORS] 
+FAIL Same domain different port [cors mode] promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL Cross domain different port [no-cors mode] promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+PASS Cross domain different port [server forbid CORS] 
+FAIL Cross domain different port [cors mode] promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL Cross domain different protocol [no-cors mode] promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+PASS Cross domain different protocol [server forbid CORS] 
+FAIL Cross domain different protocol [cors mode] promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL Same domain different protocol different port [no-cors mode] promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+PASS Same domain different protocol different port [server forbid CORS] 
+FAIL Same domain different protocol different port [cors mode] promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsbasicworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic-worker.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic-worker.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic-worker.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch in worker: basic CORS&lt;/title&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-cors-protocol&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#concept-filtered-response-cors&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#concept-cors-check&quot;&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&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;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      fetch_tests_from_worker(new Worker(&quot;cors-basic.js?pipe=sub&quot;));
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsbasichtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch:  basic CORS&lt;/title&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-cors-protocol&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#concept-filtered-response-cors&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#concept-cors-check&quot;&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&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;/head&gt;
+  &lt;body&gt;
+    &lt;script src=&quot;../resources/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;cors-basic.js?pipe=sub&quot;&gt;&lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsbasicjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.js (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.js        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+if (this.document === undefined) {
+  importScripts(&quot;/resources/testharness.js&quot;);
+  importScripts(&quot;../resources/utils.js&quot;);
+}
+
+function cors(desc, scheme, subdomain, port) {
+  if (!port)
+    port = location.port;
+  if (subdomain)
+    subdomain = subdomain + &quot;.&quot;;
+  else
+    subdomain = &quot;&quot;;
+
+  var url = scheme + &quot;://&quot; + subdomain + &quot;{{host}}&quot; + &quot;:&quot; + port + dirname(location.pathname);
+  var urlParameters = &quot;?pipe=header(Access-Control-Allow-Origin,*)&quot;;
+
+  promise_test(function(test) {
+    return fetch(url + RESOURCES_DIR + &quot;top.txt&quot; + urlParameters, {&quot;mode&quot;: &quot;no-cors&quot;} ).then(function(resp) {
+      assert_equals(resp.status, 0, &quot;Opaque filter: status is 0&quot;);
+      assert_equals(resp.statusText, &quot;&quot;, &quot;Opaque filter: statusText is \&quot;\&quot;&quot;);
+      assert_equals(resp.type , &quot;opaque&quot;, &quot;Opaque filter: response's type is opaque&quot;);
+    });
+  }, desc + &quot; [no-cors mode]&quot;);
+
+  promise_test(function(test) {
+    var testedPromise = fetch(url + RESOURCES_DIR + &quot;top.txt&quot;, {&quot;mode&quot;: &quot;cors&quot;} ).then(function(resp) {
+      return promise_rejects(test, new TypeError(), testedPromise);
+    });
+  }, desc + &quot; [server forbid CORS]&quot;);
+
+  promise_test(function(test) {
+    return fetch(url + RESOURCES_DIR + &quot;top.txt&quot; + urlParameters, {&quot;mode&quot;: &quot;cors&quot;} ).then(function(resp) {
+      assert_equals(resp.status, 200, &quot;Fetch's response's status is 200&quot;);
+      assert_equals(resp.type , &quot;cors&quot;, &quot;CORS response's type is cors&quot;);
+    });
+  }, desc + &quot; [cors mode]&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, &quot;{{ports[http][1]}}&quot;);
+cors(&quot;Cross domain different port&quot;, &quot;http&quot;, &quot;www1&quot;, &quot;{{ports[http][1]}}&quot;);
+cors(&quot;Cross domain different protocol&quot;, &quot;https&quot;, &quot;www1&quot;, &quot;{{ports[https][0]}}&quot;);
+cors(&quot;Same domain different protocol different port&quot;, &quot;https&quot;, undefined, &quot;{{ports[https][0]}}&quot;);
+
+done();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorscookiesexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+
+FAIL Include mode: 1 cookie promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL Include mode: local cookies are not sent with remote request promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL Include mode: remote cookies are not sent with local request promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL Include mode: remote cookies are not sent with other remote request promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL Same-origin mode: cookies are discarded in cors request promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL Omit mode: no cookie sent assert_false: Request should have no cookie expected false got true
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorscookiesworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-worker-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-worker-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+
+FAIL Include mode: 1 cookie promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL Include mode: local cookies are not sent with remote request promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL Include mode: remote cookies are not sent with local request promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL Include mode: remote cookies are not sent with other remote request promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL Same-origin mode: cookies are discarded in cors request promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL Omit mode: no cookie sent assert_false: Request should have no cookie expected false got true
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorscookiesworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-worker.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-worker.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-worker.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch in worker: cookies management for cors requests&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-network-fetch&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;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      fetch_tests_from_worker(new Worker(&quot;cors-cookies.js?pipe=sub&quot;));
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorscookieshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch: cookies management for cors requests&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-network-fetch&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;/head&gt;
+  &lt;body&gt;
+    &lt;script src=&quot;../resources/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;cors-cookies.js?pipe=sub&quot;&gt;&lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorscookiesjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies.js (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies.js        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+if (this.document === undefined) {
+  importScripts(&quot;/resources/testharness.js&quot;);
+  importScripts(&quot;../resources/utils.js&quot;);
+}
+
+function corsCookies(desc, domain1, domain2, credentialsMode, cookies) {
+  var urlSetCookie = &quot;http://&quot; + domain1 + &quot;:{{ports[http][0]}}&quot; + dirname(location.pathname) + RESOURCES_DIR + &quot;top.txt&quot;;
+  var urlCheckCookies = &quot;http://&quot; + domain2 + &quot;:{{ports[http][0]}}&quot; + dirname(location.pathname) + RESOURCES_DIR + &quot;inspect-headers.py?cors&amp;headers=cookie&quot;;
+  //enable cors with credentials
+  var urlParameters = &quot;?pipe=header(Access-Control-Allow-Origin,&quot; + location.origin + &quot;)&quot;;
+  urlParameters += &quot;|header(Access-Control-Allow-Credentials,true)&quot;;
+
+  var urlCleanParameters = &quot;?pipe=header(Access-Control-Allow-Origin,&quot; + location.origin + &quot;)&quot;;
+  urlCleanParameters += &quot;|header(Access-Control-Allow-Credentials,true)&quot;;
+  if (cookies) {
+    urlParameters += &quot;|header(Set-Cookie,&quot;;
+    urlParameters += cookies.join(&quot;,True)|header(Set-Cookie,&quot;) +  &quot;,True)&quot;;
+    urlCleanParameters += &quot;|header(Set-Cookie,&quot;;
+    urlCleanParameters +=  cookies.join(&quot;%3B%20max-age=0,True)|header(Set-Cookie,&quot;) +  &quot;%3B%20max-age=0,True)&quot;;
+  }
+
+  var requestInit = {&quot;credentials&quot;: credentialsMode, &quot;mode&quot;: &quot;cors&quot;};
+
+  promise_test(function(test){
+    return fetch(urlSetCookie + urlParameters, requestInit).then(function(resp) {
+      assert_equals(resp.status, 200, &quot;HTTP status is 200&quot;);
+      //check cookies sent
+      return fetch(urlCheckCookies, requestInit);
+    }).then(function(resp) {
+      assert_equals(resp.status, 200, &quot;HTTP status is 200&quot;);
+      assert_false(resp.headers.has(&quot;Cookie&quot;) , &quot;Cookie header is not exposed in response&quot;);
+      if (credentialsMode === &quot;include&quot; &amp;&amp; domain1 === domain2) {
+        assert_equals(resp.headers.get(&quot;x-request-cookie&quot;) , cookies.join(&quot;; &quot;), &quot;Request includes cookie(s)&quot;);
+      }
+      else {
+        assert_false(resp.headers.has(&quot;x-request-cookie&quot;) , &quot;Request should have no cookie&quot;);
+      }
+      //clean cookies
+      return fetch(urlSetCookie + urlCleanParameters, {&quot;credentials&quot;: &quot;include&quot;});
+    }).catch(function(e) {
+      fetch(urlSetCookie + urlCleanParameters, {&quot;credentials&quot;: &quot;include&quot;});
+      throw e;
+    });
+  }, desc);
+}
+
+var local = &quot;{{host}}&quot;;
+var remote = &quot;www.{{host}}&quot;;
+var remote1 = &quot;www1.{{host}}&quot;;
+
+corsCookies(&quot;Include mode: 1 cookie&quot;, remote, remote, &quot;include&quot;, [&quot;a=1&quot;]);
+corsCookies(&quot;Include mode: local cookies are not sent with remote request&quot;, local, remote, &quot;include&quot;, [&quot;c=3&quot;]);
+corsCookies(&quot;Include mode: remote cookies are not sent with local request&quot;, remote, local, &quot;include&quot;, [&quot;d=4&quot;]);
+corsCookies(&quot;Include mode: remote cookies are not sent with other remote request&quot;, remote, remote1, &quot;include&quot;, [&quot;e=5&quot;]);
+corsCookies(&quot;Same-origin mode: cookies are discarded in cors request&quot;, remote, remote, &quot;same-origin&quot;, [&quot;f=6&quot;]);
+corsCookies(&quot;Omit mode: no cookie sent&quot;, local, local, &quot;omit&quot;, [&quot;g=7&quot;]);
+
+done();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsfilteringexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-filtering-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-filtering-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-filtering-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+
+FAIL CORS filter on Cache-Control header promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Content-Language header promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Content-Type header promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Expires header promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Last-Modified header promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Pragma header promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Age header promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Server header promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Warning header promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Content-Length header promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Set-Cookie header promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Set-Cookie2 header promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Age header, header is exposed promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Server header, header is exposed promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Warning header, header is exposed promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Content-Length header, header is exposed promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Set-Cookie header, header is exposed promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Set-Cookie2 header, header is exposed promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsfilteringworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-filtering-worker-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-filtering-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-filtering-worker-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+
+FAIL CORS filter on Cache-Control header promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Content-Language header promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Content-Type header promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Expires header promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Last-Modified header promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Pragma header promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Age header promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Server header promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Warning header promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Content-Length header promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Set-Cookie header promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Set-Cookie2 header promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Age header, header is exposed promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Server header, header is exposed promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Warning header, header is exposed promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Content-Length header, header is exposed promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Set-Cookie header, header is exposed promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL CORS filter on Set-Cookie2 header, header is exposed promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsfilteringworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-filtering-worker.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-filtering-worker.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-filtering-worker.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch in worker: filtered headers in CORS response&lt;/title&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-cors-protocol&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#concept-filtered-response-cors&quot;&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&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;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      fetch_tests_from_worker(new Worker(&quot;cors-filtering.js?pipe=sub&quot;));
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsfilteringhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-filtering.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-filtering.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-filtering.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch: filtered headers in CORS response&lt;/title&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-cors-protocol&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#concept-filtered-response-cors&quot;&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&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;/head&gt;
+  &lt;body&gt;
+    &lt;script src=&quot;../resources/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;cors-filtering.js?pipe=sub&quot;&gt;&lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsfilteringjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-filtering.js (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-filtering.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-filtering.js        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,66 @@
</span><ins>+if (this.document === undefined) {
+  importScripts(&quot;/resources/testharness.js&quot;);
+  importScripts(&quot;../resources/utils.js&quot;);
+}
+
+function corsFilter(corsUrl, headerName, headerValue, isFiltered) {
+  var url = corsUrl + &quot;?pipe=header(&quot; + headerName + &quot;,&quot; + encodeURIComponent(headerValue) +&quot;)|header(Access-Control-Allow-Origin,*)&quot;;
+  promise_test(function(test) {
+    return fetch(url).then(function(resp) {
+      assert_equals(resp.status, 200, &quot;Fetch success with code 200&quot;);
+      assert_equals(resp.type , &quot;cors&quot;, &quot;CORS fetch's response has cors type&quot;);
+      if (!isFiltered) {
+        assert_equals(resp.headers.get(headerName), headerValue,
+          headerName + &quot; header should be included in response with value: &quot; + headerValue);
+      } else {
+        assert_false(resp.headers.has(headerName), &quot;UA should exclude &quot; + headerName + &quot; header from response&quot;);
+      }
+      test.done();
+    });
+  }, &quot;CORS filter on &quot; + headerName + &quot; header&quot;);
+}
+
+function corsExposeFilter(corsUrl, headerName, headerValue, isForbidden) {
+  var url = corsUrl + &quot;?pipe=header(&quot; + headerName + &quot;,&quot; + encodeURIComponent(headerValue) +&quot;)|&quot; +
+                            &quot;header(Access-Control-Allow-Origin,*)&quot; +
+                            &quot;header(Access-Control-Expose-Headers,&quot; + headerName + &quot;)&quot;;
+
+  promise_test(function(test) {
+    return fetch(url).then(function(resp) {
+      assert_equals(resp.status, 200, &quot;Fetch success with code 200&quot;);
+      assert_equals(resp.type , &quot;cors&quot;, &quot;CORS fetch's response has cors type&quot;);
+      if (!isForbidden) {
+        assert_equals(resp.headers.get(headerName), headerValue,
+          headerName + &quot; header should be included in response with value: &quot; + headerValue);
+      } else {
+        assert_false(resp.headers.has(headerName), &quot;UA should exclude &quot; + headerName + &quot; header from response&quot;);
+      }
+      test.done();
+    });
+  }, &quot;CORS filter on &quot; + headerName + &quot; header, header is exposed&quot;);
+}
+
+var url = &quot;http://www1.{{host}}:{{ports[http][1]}}&quot; + dirname(location.pathname) + RESOURCES_DIR + &quot;top.txt&quot;;
+
+corsFilter(url, &quot;Cache-Control&quot;, &quot;no-cache&quot;, false);
+corsFilter(url, &quot;Content-Language&quot;, &quot;fr&quot;, false);
+corsFilter(url, &quot;Content-Type&quot;, &quot;text/html&quot;, false);
+corsFilter(url, &quot;Expires&quot;,&quot;04 May 1988 22:22:22 GMT&quot; , false);
+corsFilter(url, &quot;Last-Modified&quot;, &quot;04 May 1988 22:22:22 GMT&quot;, false);
+corsFilter(url, &quot;Pragma&quot;, &quot;no-cache&quot;, false);
+
+corsFilter(url, &quot;Age&quot;, &quot;27&quot;, true);
+corsFilter(url, &quot;Server&quot;, &quot;wptServe&quot; , true);
+corsFilter(url, &quot;Warning&quot;, &quot;Mind the gap&quot; , true);
+corsFilter(url, &quot;Content-Length&quot;, &quot;0&quot; , true);
+corsFilter(url, &quot;Set-Cookie&quot;, &quot;name=value&quot; , true);
+corsFilter(url, &quot;Set-Cookie2&quot;, &quot;name=value&quot; , true);
+
+corsExposeFilter(url, &quot;Age&quot;, &quot;27&quot;, false);
+corsExposeFilter(url, &quot;Server&quot;, &quot;wptServe&quot; , false);
+corsExposeFilter(url, &quot;Warning&quot;, &quot;Mind the gap&quot; , false);
+corsExposeFilter(url, &quot;Content-Length&quot;, &quot;0&quot; , false);
+corsExposeFilter(url, &quot;Set-Cookie&quot;, &quot;name=value&quot; , true);
+corsExposeFilter(url, &quot;Set-Cookie2&quot;, &quot;name=value&quot; , true);
+
+done();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsmultipleoriginsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-multiple-origins-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-multiple-origins-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-multiple-origins-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+
+FAIL 3 origins allowed, match the 3rd (http://localhost:8800) promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL 3 origins allowed, match the 3rd (&quot;*&quot;) promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL 3 origins allowed, match twice (http://localhost:8800) promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL 3 origins allowed, match twice (&quot;*&quot;) promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL 3 origins allowed, match twice (&quot;*&quot; and http://localhost:8800) promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+PASS 3 origins allowed, no match 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsmultipleoriginsworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-multiple-origins-worker-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-multiple-origins-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-multiple-origins-worker-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+
+FAIL 3 origins allowed, match the 3rd (http://localhost:8800) promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL 3 origins allowed, match the 3rd (&quot;*&quot;) promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL 3 origins allowed, match twice (http://localhost:8800) promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL 3 origins allowed, match twice (&quot;*&quot;) promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+FAIL 3 origins allowed, match twice (&quot;*&quot; and http://localhost:8800) promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+PASS 3 origins allowed, no match 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsmultipleoriginsworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-multiple-origins-worker.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-multiple-origins-worker.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-multiple-origins-worker.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch in worker: check multiple Access-Control-Allow-Origin header management&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-cors-protocol&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#cors-check&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;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      fetch_tests_from_worker(new Worker(&quot;cors-multiple-origins.js?pipe=sub&quot;));
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsmultipleoriginshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-multiple-origins.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-multiple-origins.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-multiple-origins.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch: check multiple Access-Control-Allow-Origin header management&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-cors-protocol&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#cors-check&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;/head&gt;
+  &lt;body&gt;
+    &lt;script src=&quot;../resources/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;cors-multiple-origins.js?pipe=sub&quot;&gt;&lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsmultipleoriginsjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-multiple-origins.js (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-multiple-origins.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-multiple-origins.js        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+if (this.document === undefined) {
+  importScripts(&quot;/resources/testharness.js&quot;);
+  importScripts(&quot;../resources/utils.js&quot;);
+}
+
+function corsMultipleOrigins(desc, originList, shouldPass) {
+  var urlParameters = &quot;?origin=&quot; + encodeURIComponent(originList.join(&quot;, &quot;));
+  var url = &quot;http://www1.{{host}}:{{ports[http][0]}}&quot; + dirname(location.pathname) + RESOURCES_DIR + &quot;preflight.py&quot;;
+
+  if (shouldPass) {
+    promise_test(function(test) {
+      return fetch(url + urlParameters).then(function(resp) {
+        assert_equals(resp.status, 200, &quot;Response's status is 200&quot;);
+      });
+    }, desc);
+  } else {
+    promise_test(function(test) {
+      return promise_rejects(test, new TypeError(), fetch(url + urlParameters));
+    }, desc);
+  }
+}
+/* Actual origin */
+var origin = &quot;http://{{host}}:{{ports[http][0]}}&quot;;
+
+corsMultipleOrigins(&quot;3 origins allowed, match the 3rd (&quot; + origin + &quot;)&quot;, [&quot;\&quot;\&quot;&quot;, &quot;http://example.com&quot;, origin], true);
+corsMultipleOrigins(&quot;3 origins allowed, match the 3rd (\&quot;*\&quot;)&quot;, [&quot;\&quot;\&quot;&quot;, &quot;http://example.com&quot;, &quot;*&quot;], true);
+corsMultipleOrigins(&quot;3 origins allowed, match twice (&quot; + origin + &quot;)&quot;, [&quot;\&quot;\&quot;&quot;, origin, origin], true);
+corsMultipleOrigins(&quot;3 origins allowed, match twice (\&quot;*\&quot;)&quot;, [&quot;*&quot;, &quot;http://example.com&quot;, &quot;*&quot;], true);
+corsMultipleOrigins(&quot;3 origins allowed, match twice (\&quot;*\&quot; and &quot; + origin + &quot;)&quot;, [&quot;*&quot;, &quot;http://example.com&quot;, origin], true);
+corsMultipleOrigins(&quot;3 origins allowed, no match&quot;, [&quot;&quot;, &quot;http://example.com&quot;, &quot;https://example2.com&quot;], false);
+
+done();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsnopreflightexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+
+PASS Cross domain basic usage [GET] 
+PASS Same domain different port [GET] 
+PASS Cross domain different port [GET] 
+PASS Cross domain different protocol [GET] 
+PASS Same domain different protocol different port [GET] 
+PASS Cross domain [POST] 
+PASS Cross domain [HEAD] 
+PASS Cross domain [GET] [Accept: */*] 
+PASS Cross domain [GET] [Accept-Language: fr] 
+PASS Cross domain [GET] [Content-Language: fr] 
+PASS Cross domain [GET] [Content-Type: application/x-www-form-urlencoded] 
+PASS Cross domain [GET] [Content-Type: multipart/form-data] 
+PASS Cross domain [GET] [Content-Type: text/plain] 
+PASS Cross domain [GET] [Content-Type: text/plain;charset=utf-8] 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsnopreflightworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight-worker-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight-worker-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+
+PASS Cross domain basic usage [GET] 
+PASS Same domain different port [GET] 
+PASS Cross domain different port [GET] 
+PASS Cross domain different protocol [GET] 
+PASS Same domain different protocol different port [GET] 
+PASS Cross domain [POST] 
+PASS Cross domain [HEAD] 
+PASS Cross domain [GET] [Accept: */*] 
+PASS Cross domain [GET] [Accept-Language: fr] 
+PASS Cross domain [GET] [Content-Language: fr] 
+PASS Cross domain [GET] [Content-Type: application/x-www-form-urlencoded] 
+PASS Cross domain [GET] [Content-Type: multipart/form-data] 
+PASS Cross domain [GET] [Content-Type: text/plain] 
+PASS Cross domain [GET] [Content-Type: text/plain;charset=utf-8] 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsnopreflightworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight-worker.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight-worker.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight-worker.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch in worker: CORS request with simple methods and headers&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-cors-protocol&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#simple-method&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#simple-header&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;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      fetch_tests_from_worker(new Worker(&quot;cors-no-preflight.js?pipe=sub&quot;));
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsnopreflighthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch: CORS request with simple methods and headers&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-cors-protocol&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#simple-method&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#simple-header&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;/head&gt;
+  &lt;body&gt;
+    &lt;script src=&quot;/common/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;../resources/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;cors-no-preflight.js?pipe=sub&quot;&gt;&lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsnopreflightjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight.js (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight.js        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+if (this.document === undefined) {
+  importScripts(&quot;/resources/testharness.js&quot;);
+  importScripts(&quot;/common/utils.js&quot;);
+  importScripts(&quot;../resources/utils.js&quot;);
+}
+
+function corsNoPreflight(desc, scheme, subdomain, port, method, headerName, headerValue) {
+  if (!port)
+    port = location.port;
+  if (subdomain)
+    subdomain = subdomain + &quot;.&quot;;
+  else
+    subdomain = &quot;&quot;;
+
+  var uuid_token = token();
+  var url = scheme + &quot;://&quot; + subdomain + &quot;{{host}}&quot; + &quot;:&quot; + port + dirname(location.pathname) + RESOURCES_DIR + &quot;preflight.py&quot;;
+  var urlParameters = &quot;?token=&quot; + uuid_token + &quot;&amp;max_age=0&quot;;
+  var requestInit = {&quot;mode&quot;: &quot;cors&quot;, &quot;method&quot;: method, &quot;headers&quot;:{}};
+  if (headerName)
+    requestInit[&quot;headers&quot;][headerName] = headerValue;
+
+  promise_test(function(test) {
+    fetch(RESOURCES_DIR + &quot;clean-stash.py?token=&quot; + uuid_token).then(function(resp) {
+      assert_equals(resp.status, 200, &quot;Clean stash response's status is 200&quot;);
+      return fetch(url + urlParameters, requestInit).then(function(resp) {
+        assert_equals(resp.status, 200, &quot;Response's status is 200&quot;);
+        assert_equals(resp.headers.get(&quot;x-did-preflight&quot;), &quot;0&quot;, &quot;No preflight request has been made&quot;);
+      });
+    });
+  }, desc);
+}
+var port2 = &quot;{{ports[http][1]}}&quot;;
+var httpsPort = &quot;{{ports[https][0]}}&quot;;
+
+corsNoPreflight(&quot;Cross domain basic usage [GET]&quot;, &quot;http&quot;, &quot;www1&quot;, undefined, &quot;GET&quot;);
+corsNoPreflight(&quot;Same domain different port [GET]&quot;, &quot;http&quot;, undefined, port2, &quot;GET&quot;);
+corsNoPreflight(&quot;Cross domain different port [GET]&quot;, &quot;http&quot;, &quot;www1&quot;, port2, &quot;GET&quot;);
+corsNoPreflight(&quot;Cross domain different protocol [GET]&quot;, &quot;https&quot;, &quot;www1&quot;, httpsPort, &quot;GET&quot;);
+corsNoPreflight(&quot;Same domain different protocol different port [GET]&quot;, &quot;https&quot;, undefined, httpsPort, &quot;GET&quot;);
+corsNoPreflight(&quot;Cross domain [POST]&quot;, &quot;http&quot;, &quot;www1&quot;, undefined, &quot;POST&quot;);
+corsNoPreflight(&quot;Cross domain [HEAD]&quot;, &quot;http&quot;, &quot;www1&quot;, undefined, &quot;HEAD&quot;);
+corsNoPreflight(&quot;Cross domain [GET] [Accept: */*]&quot;, &quot;http&quot;, &quot;www1&quot;, undefined, &quot;GET&quot; , &quot;Accept&quot;, &quot;*/*&quot;);
+corsNoPreflight(&quot;Cross domain [GET] [Accept-Language: fr]&quot;, &quot;http&quot;, &quot;www1&quot;, undefined, &quot;GET&quot; , &quot;Accept-Language&quot;, &quot;fr&quot;);
+corsNoPreflight(&quot;Cross domain [GET] [Content-Language: fr]&quot;, &quot;http&quot;, &quot;www1&quot;, undefined, &quot;GET&quot; , &quot;Content-Language&quot;, &quot;fr&quot;);
+corsNoPreflight(&quot;Cross domain [GET] [Content-Type: application/x-www-form-urlencoded]&quot;, &quot;http&quot;, &quot;www1&quot;, undefined, &quot;GET&quot; , &quot;Content-Type&quot;, &quot;application/x-www-form-urlencoded&quot;);
+corsNoPreflight(&quot;Cross domain [GET] [Content-Type: multipart/form-data]&quot;, &quot;http&quot;, &quot;www1&quot;, undefined, &quot;GET&quot; , &quot;Content-Type&quot;, &quot;multipart/form-data&quot;);
+corsNoPreflight(&quot;Cross domain [GET] [Content-Type: text/plain]&quot;, &quot;http&quot;, &quot;www1&quot;, undefined, &quot;GET&quot; , &quot;Content-Type&quot;, &quot;text/plain&quot;);
+corsNoPreflight(&quot;Cross domain [GET] [Content-Type: text/plain;charset=utf-8]&quot;, &quot;http&quot;, &quot;www1&quot;, undefined, &quot;GET&quot; , &quot;Content-Type&quot;, &quot;text/plain;charset=utf-8&quot;);
+
+done();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsoriginexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+
+PASS Cross domain different subdomain [origin OK] 
+PASS Cross domain different subdomain [origin KO] 
+PASS Same domain different port [origin OK] 
+PASS Same domain different port [origin KO] 
+PASS Cross domain different port [origin OK] 
+PASS Cross domain different port [origin KO] 
+PASS Cross domain different protocol [origin OK] 
+PASS Cross domain different protocol [origin KO] 
+PASS Same domain different protocol different port [origin OK] 
+PASS Same domain different protocol different port [origin KO] 
+PASS Cross domain [POST] [origin OK] 
+PASS Cross domain [POST] [origin KO] 
+PASS Cross domain [HEAD] [origin OK] 
+PASS Cross domain [HEAD] [origin KO] 
+PASS CORS preflight [PUT] [origin OK] 
+PASS CORS preflight [PUT] [origin KO] 
+PASS Allowed origin: &quot;&quot; [origin KO] 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsoriginworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin-worker-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin-worker-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+
+PASS Cross domain different subdomain [origin OK] 
+PASS Cross domain different subdomain [origin KO] 
+PASS Same domain different port [origin OK] 
+PASS Same domain different port [origin KO] 
+PASS Cross domain different port [origin OK] 
+PASS Cross domain different port [origin KO] 
+PASS Cross domain different protocol [origin OK] 
+PASS Cross domain different protocol [origin KO] 
+PASS Same domain different protocol different port [origin OK] 
+PASS Same domain different protocol different port [origin KO] 
+PASS Cross domain [POST] [origin OK] 
+PASS Cross domain [POST] [origin KO] 
+PASS Cross domain [HEAD] [origin OK] 
+PASS Cross domain [HEAD] [origin KO] 
+PASS CORS preflight [PUT] [origin OK] 
+PASS CORS preflight [PUT] [origin KO] 
+PASS Allowed origin: &quot;&quot; [origin KO] 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsoriginworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin-worker.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin-worker.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin-worker.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch in worker: check Access-Control-Allow-Origin header management&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-cors-protocol&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#cors-check&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;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      fetch_tests_from_worker(new Worker(&quot;cors-origin.js?pipe=sub&quot;));
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsoriginhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch: check Access-Control-Allow-Origin header management&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-cors-protocol&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#cors-check&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;/head&gt;
+  &lt;body&gt;
+    &lt;script src=&quot;/common/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;../resources/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;cors-origin.js?pipe=sub&quot;&gt;&lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsoriginjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin.js (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin.js        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,61 @@
</span><ins>+if (this.document === undefined) {
+  importScripts(&quot;/resources/testharness.js&quot;);
+  importScripts(&quot;../resources/utils.js&quot;);
+  importScripts(&quot;/common/utils.js&quot;);
+}
+
+/* If origin is undefined, it is set to fetched url's origin*/
+function corsOrigin(desc, scheme, subdomain, port, method, origin, shouldPass) {
+  if (!port)
+    port = location.port;
+  if (subdomain)
+    subdomain = subdomain + &quot;.&quot;;
+  else
+    subdomain = &quot;&quot;;
+  if (!origin)
+    origin = scheme + &quot;://&quot; + subdomain + &quot;{{host}}&quot; + &quot;:&quot; + port;
+
+  var uuid_token = token();
+  var urlParameters = &quot;?token=&quot; + uuid_token + &quot;&amp;max_age=0&amp;origin=&quot; + encodeURIComponent(origin) + &quot;&amp;allow_methods=&quot; + method;
+  var url = scheme + &quot;://&quot; + subdomain + &quot;{{host}}&quot; + &quot;:&quot; + port + dirname(location.pathname) + RESOURCES_DIR + &quot;preflight.py&quot;;
+  var requestInit = {&quot;mode&quot;: &quot;cors&quot;, &quot;method&quot;: method};
+
+  promise_test(function(test) {
+    fetch(RESOURCES_DIR + &quot;clean-stash.py?token=&quot; + uuid_token).then(function(resp) {
+      assert_equals(resp.status, 200, &quot;Clean stash response's status is 200&quot;);
+      if (shouldPass) {
+        return fetch(url + urlParameters, requestInit).then(function(resp) {
+          assert_equals(resp.status, 200, &quot;Response's status is 200&quot;);
+        });
+      } else {
+        return promise_rejects(test, new TypeError(), fetch(url + urlParameters, requestInit));
+      }
+    });
+  }, desc);
+
+}
+var port = &quot;{{ports[http][0]}}&quot;;
+var port2 = &quot;{{ports[http][1]}}&quot;;
+var httpsPort = &quot;{{ports[https][0]}}&quot;;
+/* Actual origin */
+var origin = &quot;http://{{host}}:{{ports[http][0]}}&quot;;
+
+corsOrigin(&quot;Cross domain different subdomain [origin OK]&quot;, &quot;http&quot;, &quot;www1&quot;, undefined, &quot;GET&quot;, origin, true);
+corsOrigin(&quot;Cross domain different subdomain [origin KO]&quot;, &quot;http&quot;, &quot;www1&quot;, undefined, &quot;GET&quot;, undefined, false);
+corsOrigin(&quot;Same domain different port [origin OK]&quot;, &quot;http&quot;, undefined, port2, &quot;GET&quot;, origin, true);
+corsOrigin(&quot;Same domain different port [origin KO]&quot;, &quot;http&quot;, undefined, port2, &quot;GET&quot;, undefined, false);
+corsOrigin(&quot;Cross domain different port [origin OK]&quot;, &quot;http&quot;, &quot;www1&quot;, port2, &quot;GET&quot;, origin, true);
+corsOrigin(&quot;Cross domain different port [origin KO]&quot;, &quot;http&quot;, &quot;www1&quot;, port2, &quot;GET&quot;, undefined, false);
+corsOrigin(&quot;Cross domain different protocol [origin OK]&quot;, &quot;https&quot;, &quot;www1&quot;, httpsPort, &quot;GET&quot;, origin, true);
+corsOrigin(&quot;Cross domain different protocol [origin KO]&quot;, &quot;https&quot;, &quot;www1&quot;, httpsPort, &quot;GET&quot;, undefined, false);
+corsOrigin(&quot;Same domain different protocol different port [origin OK]&quot;, &quot;https&quot;, undefined, httpsPort, &quot;GET&quot;, origin, true);
+corsOrigin(&quot;Same domain different protocol different port [origin KO]&quot;, &quot;https&quot;, undefined, httpsPort, &quot;GET&quot;, undefined, false);
+corsOrigin(&quot;Cross domain [POST] [origin OK]&quot;, &quot;http&quot;, &quot;www1&quot;, undefined, &quot;POST&quot;, origin, true);
+corsOrigin(&quot;Cross domain [POST] [origin KO]&quot;, &quot;http&quot;, &quot;www1&quot;, undefined, &quot;POST&quot;, undefined, false);
+corsOrigin(&quot;Cross domain [HEAD] [origin OK]&quot;, &quot;http&quot;, &quot;www1&quot;, undefined, &quot;HEAD&quot;, origin, true);
+corsOrigin(&quot;Cross domain [HEAD] [origin KO]&quot;, &quot;http&quot;, &quot;www1&quot;, undefined, &quot;HEAD&quot;, undefined, false);
+corsOrigin(&quot;CORS preflight [PUT] [origin OK]&quot;, &quot;http&quot;, &quot;www1&quot;, undefined, &quot;PUT&quot;, origin, true);
+corsOrigin(&quot;CORS preflight [PUT] [origin KO]&quot;, &quot;http&quot;, &quot;www1&quot;, undefined, &quot;PUT&quot;, undefined, false);
+corsOrigin(&quot;Allowed origin: \&quot;\&quot; [origin KO]&quot;, &quot;http&quot;, &quot;www1&quot;, undefined, &quot;GET&quot;, &quot;&quot; , false);
+
+done();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+
+PASS Fetch: Check cors fetches requiring preflight 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightredirectexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+
+PASS Redirection 301 on preflight failed 
+PASS Redirection 301 after preflight failed 
+PASS Redirection 302 on preflight failed 
+PASS Redirection 302 after preflight failed 
+PASS Redirection 303 on preflight failed 
+PASS Redirection 303 after preflight failed 
+PASS Redirection 307 on preflight failed 
+PASS Redirection 307 after preflight failed 
+PASS Redirection 308 on preflight failed 
+PASS Redirection 308 after preflight failed 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightredirectworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect-worker-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect-worker-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+
+PASS Redirection 301 on preflight failed 
+PASS Redirection 301 after preflight failed 
+PASS Redirection 302 on preflight failed 
+PASS Redirection 302 after preflight failed 
+PASS Redirection 303 on preflight failed 
+PASS Redirection 303 after preflight failed 
+PASS Redirection 307 on preflight failed 
+PASS Redirection 307 after preflight failed 
+PASS Redirection 308 on preflight failed 
+PASS Redirection 308 after preflight failed 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightredirectworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect-worker.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect-worker.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect-worker.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch in worker: redirection handling for cors with preflight&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-cors-protocol&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-fetch&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;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      fetch_tests_from_worker(new Worker(&quot;cors-preflight-redirect.js?pipe=sub&quot;));
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightredirecthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch: redirection handling for cors with preflight&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-cors-protocol&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-fetch&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;/head&gt;
+  &lt;body&gt;
+    &lt;script src=&quot;/common/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;../resources/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;cors-preflight-redirect.js?pipe=sub&quot;&gt;&lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightredirectjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect.js (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect.js        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+if (this.document === undefined) {
+  importScripts(&quot;/resources/testharness.js&quot;);
+  importScripts(&quot;../resources/utils.js&quot;);
+  importScripts(&quot;/common/utils.js&quot;);
+}
+
+function corsPreflightRedirect(desc, redirectUrl, redirectLocation, redirectStatus, redirectPreflight) {
+  var uuid_token = token();
+  var url = redirectUrl;
+  var urlParameters = &quot;?token=&quot; + uuid_token + &quot;&amp;max_age=0&quot;;
+  urlParameters += &quot;&amp;redirect_status=&quot; + redirectStatus;
+  urlParameters += &quot;&amp;location=&quot; + encodeURIComponent(redirectLocation);
+
+  if (redirectPreflight)
+    urlParameters += &quot;&amp;redirect_preflight&quot;;
+  var requestInit = {&quot;mode&quot;: &quot;cors&quot;, &quot;redirect&quot;: &quot;follow&quot;};
+
+  /* Force preflight */
+  requestInit[&quot;headers&quot;] = {&quot;x-force-preflight&quot;: &quot;&quot;};
+  urlParameters += &quot;&amp;allow_headers=x-force-preflight&quot;;
+
+  promise_test(function(test) {
+    fetch(RESOURCES_DIR + &quot;clean-stash.py?token=&quot; + uuid_token).then(function(resp) {
+      assert_equals(resp.status, 200, &quot;Clean stash response's status is 200&quot;);
+      return promise_rejects(test, new TypeError(), fetch(url + urlParameters, requestInit));
+    });
+  }, desc);
+}
+
+var redirectUrl = &quot;http://www1.{{host}}:{{ports[http][0]}}&quot; + dirname(location.pathname) + RESOURCES_DIR + &quot;redirect.py&quot;;
+var locationUrl = &quot;http://www1.{{host}}:{{ports[http][0]}}&quot; + dirname(location.pathname) + RESOURCES_DIR + &quot;preflight.py&quot;;
+
+for (var code of [301, 302, 303, 307, 308]) {
+  /* preflight should not follow the redirection */
+  corsPreflightRedirect(&quot;Redirection &quot; + code + &quot; on preflight failed&quot;, redirectUrl, locationUrl, code, true);
+  /* preflight is done before redirection: preflight force redirect to error */
+  corsPreflightRedirect(&quot;Redirection &quot; + code + &quot; after preflight failed&quot;, redirectUrl, locationUrl, code, false);
+}
+
+done();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightreferrerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+
+PASS Referrer policy: no-referrer 
+PASS Referrer policy: &quot;&quot; 
+PASS Referrer policy: origin-only 
+PASS Referrer policy: origin-when-cross-origin 
+PASS Referrer policy: unsafe-url 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightreferrerworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+
+PASS Referrer policy: no-referrer 
+PASS Referrer policy: &quot;&quot; 
+PASS Referrer policy: origin-only 
+PASS Referrer policy: origin-when-cross-origin 
+PASS Referrer policy: unsafe-url 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightreferrerworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch in worker: Referer header management in CORS request with preflight&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#cors-preflight-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-network-or-cache-fetch&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;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      fetch_tests_from_worker(new Worker(&quot;cors-preflight-referrer.js?pipe=sub&quot;));
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightreferrerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch: Referer header management in CORS request with preflight&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#cors-preflight-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-network-or-cache-fetch&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;/head&gt;
+  &lt;body&gt;
+    &lt;script src=&quot;/common/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;../resources/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;cors-preflight-referrer.js?pipe=sub&quot;&gt;&lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightreferrerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer.js (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer.js        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+if (this.document === undefined) {
+  importScripts(&quot;/resources/testharness.js&quot;);
+  importScripts(&quot;/common/utils.js&quot;);
+  importScripts(&quot;../resources/utils.js&quot;);
+}
+
+function corsPreflightReferrer(desc, corsUrl, referrerPolicy, expectedReferrer) {
+  var uuid_token = token();
+  var url = corsUrl;
+  var urlParameters = &quot;?token=&quot; + uuid_token + &quot;&amp;max_age=0&quot;;
+  var requestInit = {&quot;mode&quot;: &quot;cors&quot;, &quot;referrerPolicy&quot;: referrerPolicy};
+
+  /* Force preflight */
+  requestInit[&quot;headers&quot;] = {&quot;x-force-preflight&quot;: &quot;&quot;};
+  urlParameters += &quot;&amp;allow_headers=x-force-preflight&quot;;
+
+  promise_test(function(test) {
+    fetch(RESOURCES_DIR + &quot;clean-stash.py?token=&quot; + uuid_token).then(function(resp) {
+      assert_equals(resp.status, 200, &quot;Clean stash response's status is 200&quot;);
+      return fetch(url + urlParameters, requestInit).then(function(resp) {
+        assert_equals(resp.status, 200, &quot;Response's status is 200&quot;);
+        assert_equals(resp.headers.get(&quot;x-did-preflight&quot;), &quot;1&quot;, &quot;Preflight request has been made&quot;);
+        assert_equals(resp.headers.get(&quot;x-preflight-referrer&quot;), expectedReferrer, &quot;Preflight's referrer is correct&quot;);
+        assert_equals(resp.headers.get(&quot;x-referrer&quot;), expectedReferrer, &quot;Request's refferer is correct&quot;);
+      });
+    });
+  }, desc);
+}
+
+var corsUrl = &quot;http://www1.{{host}}:{{ports[http][0]}}&quot; + dirname(location.pathname) + RESOURCES_DIR + &quot;preflight.py&quot;;
+var origin = &quot;http://{{host}}:{{ports[http][0]}}&quot;;
+
+corsPreflightReferrer(&quot;Referrer policy: no-referrer&quot;, corsUrl, &quot;no-referrer&quot;, &quot;&quot;);
+corsPreflightReferrer(&quot;Referrer policy: \&quot;\&quot;&quot;, corsUrl, &quot;&quot;, &quot;&quot;);
+corsPreflightReferrer(&quot;Referrer policy: origin-only&quot;, corsUrl, &quot;origin-only&quot;, origin);
+corsPreflightReferrer(&quot;Referrer policy: origin-when-cross-origin&quot;, corsUrl, &quot;origin-when-cross-origin&quot;, origin);
+corsPreflightReferrer(&quot;Referrer policy: unsafe-url&quot;, corsUrl, &quot;unsafe-url&quot;, location.toString());
+
+done();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightstatusexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+
+PASS Preflight answered with status 200 
+PASS Preflight answered with status 201 
+PASS Preflight answered with status 202 
+PASS Preflight answered with status 203 
+PASS Preflight answered with status 204 
+PASS Preflight answered with status 205 
+PASS Preflight answered with status 206 
+PASS Preflight answered with status 300 
+PASS Preflight answered with status 301 
+PASS Preflight answered with status 302 
+PASS Preflight answered with status 303 
+PASS Preflight answered with status 304 
+PASS Preflight answered with status 305 
+PASS Preflight answered with status 306 
+PASS Preflight answered with status 307 
+PASS Preflight answered with status 308 
+PASS Preflight answered with status 400 
+PASS Preflight answered with status 401 
+PASS Preflight answered with status 402 
+PASS Preflight answered with status 403 
+PASS Preflight answered with status 404 
+PASS Preflight answered with status 405 
+PASS Preflight answered with status 501 
+PASS Preflight answered with status 502 
+PASS Preflight answered with status 503 
+PASS Preflight answered with status 504 
+PASS Preflight answered with status 505 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightstatusworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+
+PASS Preflight answered with status 200 
+PASS Preflight answered with status 201 
+PASS Preflight answered with status 202 
+PASS Preflight answered with status 203 
+PASS Preflight answered with status 204 
+PASS Preflight answered with status 205 
+PASS Preflight answered with status 206 
+PASS Preflight answered with status 300 
+PASS Preflight answered with status 301 
+PASS Preflight answered with status 302 
+PASS Preflight answered with status 303 
+PASS Preflight answered with status 304 
+PASS Preflight answered with status 305 
+PASS Preflight answered with status 306 
+PASS Preflight answered with status 307 
+PASS Preflight answered with status 308 
+PASS Preflight answered with status 400 
+PASS Preflight answered with status 401 
+PASS Preflight answered with status 402 
+PASS Preflight answered with status 403 
+PASS Preflight answered with status 404 
+PASS Preflight answered with status 405 
+PASS Preflight answered with status 501 
+PASS Preflight answered with status 502 
+PASS Preflight answered with status 503 
+PASS Preflight answered with status 504 
+PASS Preflight answered with status 505 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightstatusworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch in worker: preflight status code handling&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#cors-preflight-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-network-or-cache-fetch&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;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      fetch_tests_from_worker(new Worker(&quot;cors-preflight-status.js?pipe=sub&quot;));
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightstatushtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch: preflight status code handling&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#cors-preflight-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-network-or-cache-fetch&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;/head&gt;
+  &lt;body&gt;
+    &lt;script src=&quot;/common/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;../resources/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;cors-preflight-status.js?pipe=sub&quot;&gt;&lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightstatusjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status.js (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status.js        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+if (this.document === undefined) {
+  importScripts(&quot;/resources/testharness.js&quot;);
+  importScripts(&quot;../resources/utils.js&quot;);
+  importScripts(&quot;/common/utils.js&quot;);
+}
+
+/* Check preflight is ok if status is ok status (200  to 299)*/
+function corsPreflightStatus(desc, corsUrl, preflightStatus) {
+  var uuid_token = token();
+  var url = corsUrl;
+  var requestInit = {&quot;mode&quot;: &quot;cors&quot;};
+  /* Force preflight */
+  requestInit[&quot;headers&quot;] = {&quot;x-force-preflight&quot;: &quot;&quot;};
+
+  var urlParameters = &quot;?token=&quot; + uuid_token + &quot;&amp;max_age=0&quot;;
+  urlParameters += &quot;&amp;allow_headers=x-force-preflight&quot;;
+  urlParameters += &quot;&amp;preflight_status=&quot; + preflightStatus;
+
+  promise_test(function(test) {
+    fetch(RESOURCES_DIR + &quot;clean-stash.py?token=&quot; + uuid_token).then(function(resp) {
+      assert_equals(resp.status, 200, &quot;Clean stash response's status is 200&quot;);
+      if (200 &lt;= preflightStatus &amp;&amp; 299 &gt;= preflightStatus) {
+        return fetch(url + urlParameters, requestInit).then(function(resp) {
+          assert_equals(resp.status, 200, &quot;Response's status is 200&quot;);
+          assert_equals(resp.headers.get(&quot;x-did-preflight&quot;), &quot;1&quot;, &quot;Preflight request has been made&quot;);
+        });
+      } else {
+        return promise_rejects(test, new TypeError(), fetch(url + urlParameters, requestInit));
+      }
+    });
+  }, desc);
+}
+
+var corsUrl = &quot;http://www1.{{host}}:{{ports[http][0]}}&quot; + dirname(location.pathname) + RESOURCES_DIR + &quot;preflight.py&quot;;
+for (status of [200, 201, 202, 203, 204, 205, 206,
+                300, 301, 302, 303, 304, 305, 306, 307, 308,
+                400, 401, 402, 403, 404, 405,
+                501, 502, 503, 504, 505])
+  corsPreflightStatus(&quot;Preflight answered with status &quot; + status, corsUrl, status);
+
+done();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-worker-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-worker-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+
+PASS Untitled 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-worker.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-worker.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-worker.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch in worker: Check cors fetches requiring prefligh&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&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;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-cors-protocol&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#simple-method&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#simple-header&quot;&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      fetch_tests_from_worker(new Worker(&quot;cors-preflight.js?pipe=sub&quot;));
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflighthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch: Check cors fetches requiring preflight&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-cors-protocol&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#simple-method&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#simple-header&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;/head&gt;
+  &lt;body&gt;
+    &lt;script src=&quot;../resources/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;/common/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;cors-preflight.js?pipe=sub&quot;&gt;&lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorspreflightjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight.js (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight.js        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,82 @@
</span><ins>+if (this.document === undefined) {
+  importScripts(&quot;/resources/testharness.js&quot;);
+  importScripts(&quot;../resources/utils.js&quot;);
+  importScripts(&quot;/common/utils.js&quot;);
+}
+
+/*
+  Check preflight is done
+  Control if server allows method and headers and check accordingly
+  Check control access headers added by UA (for method and headers)
+*/
+function corsPreflight(desc, corsUrl, method, allowed, headers) {
+  var uuid_token = token();
+  fetch(RESOURCES_DIR + &quot;clean-stash.py?token=&quot; + uuid_token).then(function(response) {
+
+    var url = corsUrl;
+    var urlParameters = &quot;?token=&quot; + uuid_token + &quot;&amp;max_age=0&quot;;
+    var requestInit = {&quot;mode&quot;: &quot;cors&quot;, &quot;method&quot;: method};
+    if (headers)
+      requestInit[&quot;headers&quot;] = headers;
+
+    if (allowed) {
+      urlParameters += &quot;&amp;allow_methods=&quot; + method;
+      if (headers) {
+        //Let's check prefligh request.
+        //Server will send back headers from Access-Control-Request-Headers in x-control-request-headers
+        urlParameters += &quot;&amp;control_request_headers&quot;
+        //Make the server allow the headers
+        urlParameters += &quot;&amp;allow_headers=&quot;
+        urlParameters += headers.join(&quot;%2C%20&quot;);
+      }
+      promise_test(function(test) {
+        test.add_cleanup(function() {
+          fetch(RESOURCES_DIR + &quot;clean-stash.py?token=&quot; + uuid_token);
+        });
+        return fetch(url + urlParameters, requestInit).then(function(resp) {
+          assert_equals(resp.status, 200, &quot;Response's status is 200&quot;);
+          assert_equals(resp.headers.get(&quot;x-did-preflight&quot;), &quot;1&quot;, &quot;Preflight request has been made&quot;);
+          if (headers) {
+            var actualHeaders = resp.headers.get(&quot;x-control-request-headers&quot;).split(&quot;,&quot;);
+            for (var i in actualHeaders)
+              actualHeaders[i] = actualHeaders[i].trim();
+            for (var header in headers)
+              assert_in_array(header, actualHeaders, &quot;Preflight asked permission for header: &quot; + header);
+          }
+        });
+      }, desc);
+    } else {
+      promise_test(function(test) {
+        test.add_cleanup(function() {
+          fetch(RESOURCES_DIR + &quot;clean-stash.py?token=&quot; + uuid_token);
+        });
+        return promise_rejects(test, new TypeError(), fetch(url + urlParameters, requestInit));
+      }, desc);
+    }
+  });
+}
+
+var corsUrl = &quot;http://www1.{{host}}:{{ports[http][0]}}&quot; + dirname(location.pathname) + RESOURCES_DIR + &quot;preflight.py&quot;;
+
+//corsPreflight(&quot;CORS [DELETE], server allows&quot;, corsUrl, &quot;DELETE&quot;, true);
+//corsPreflight(&quot;CORS [DELETE], server refuses&quot;, corsUrl, &quot;DELETE&quot;, false);
+//corsPreflight(&quot;CORS [PUT], server allows&quot;, corsUrl, &quot;PUT&quot;, true);
+//corsPreflight(&quot;CORS [PUT], server refuses&quot;, corsUrl, &quot;PUT&quot;, false);
+//corsPreflight(&quot;CORS [PATCH], server allows&quot;, corsUrl, &quot;PATCH&quot;, true);
+//corsPreflight(&quot;CORS [PATCH], server refuses&quot;, corsUrl, &quot;PATCH&quot;, false);
+//corsPreflight(&quot;CORS [NEW], server allows&quot;, corsUrl, &quot;NEW&quot;, true);
+//corsPreflight(&quot;CORS [NEW], server refuses&quot;, corsUrl, &quot;NEW&quot;, false);
+//
+//corsPreflight(&quot;CORS [GET] [x-test-header: allowed], server allows&quot;, corsUrl, &quot;GET&quot;, true, {&quot;x-test-header1&quot;: &quot;allowed&quot;});
+//corsPreflight(&quot;CORS [GET] [x-test-header: refused], server refuses&quot;, corsUrl, &quot;GET&quot;, false, {&quot;x-test-header1&quot;: &quot;refused&quot;});
+//
+var headers = {&quot;x-test-header1&quot;: &quot;allowedOrRefused&quot;,
+               &quot;x-test-header2&quot;: &quot;allowedOrRefused&quot;,
+               &quot;x-test-header3&quot;: &quot;allowedOrRefused&quot;,
+};
+//corsPreflight(&quot;CORS [GET] [several headers], server allows&quot;, corsUrl, &quot;GET&quot;, true, headers);
+//corsPreflight(&quot;CORS [GET] [several headers], server refuses&quot;, corsUrl, &quot;GET&quot;, false, headers);
+//corsPreflight(&quot;CORS [PUT] [several headers], server allows&quot;, corsUrl, &quot;PUT&quot;, true, headers);
+corsPreflight(&quot;CORS [PUT] [several headers], server refuses&quot;, corsUrl, &quot;PUT&quot;, false, headers);
+
+done();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsredirectcredentialsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,62 @@
</span><ins>+
+PASS Redirect 301 from same origin to remote with user and password 
+PASS Redirect 301 from same origin to remote with user 
+PASS Redirect 301 from same origin to remote with password 
+PASS Redirect 301 from remote to same origin with user and password 
+PASS Redirect 301 from remote to same origin with user 
+PASS Redirect 301 from remote to same origin with password 
+PASS Redirect 301 from remote to another remote with user and password 
+PASS Redirect 301 from remote to another remote with user 
+PASS Redirect 301 from remote to another remote with password 
+PASS Redirect 301 from remote to same remote with user and password 
+PASS Redirect 301 from remote to same remote with user 
+PASS Redirect 301 from remote to same remote with password 
+PASS Redirect 302 from same origin to remote with user and password 
+PASS Redirect 302 from same origin to remote with user 
+PASS Redirect 302 from same origin to remote with password 
+PASS Redirect 302 from remote to same origin with user and password 
+PASS Redirect 302 from remote to same origin with user 
+PASS Redirect 302 from remote to same origin with password 
+PASS Redirect 302 from remote to another remote with user and password 
+PASS Redirect 302 from remote to another remote with user 
+PASS Redirect 302 from remote to another remote with password 
+PASS Redirect 302 from remote to same remote with user and password 
+PASS Redirect 302 from remote to same remote with user 
+PASS Redirect 302 from remote to same remote with password 
+PASS Redirect 303 from same origin to remote with user and password 
+PASS Redirect 303 from same origin to remote with user 
+PASS Redirect 303 from same origin to remote with password 
+PASS Redirect 303 from remote to same origin with user and password 
+PASS Redirect 303 from remote to same origin with user 
+PASS Redirect 303 from remote to same origin with password 
+PASS Redirect 303 from remote to another remote with user and password 
+PASS Redirect 303 from remote to another remote with user 
+PASS Redirect 303 from remote to another remote with password 
+PASS Redirect 303 from remote to same remote with user and password 
+PASS Redirect 303 from remote to same remote with user 
+PASS Redirect 303 from remote to same remote with password 
+PASS Redirect 307 from same origin to remote with user and password 
+PASS Redirect 307 from same origin to remote with user 
+PASS Redirect 307 from same origin to remote with password 
+PASS Redirect 307 from remote to same origin with user and password 
+PASS Redirect 307 from remote to same origin with user 
+PASS Redirect 307 from remote to same origin with password 
+PASS Redirect 307 from remote to another remote with user and password 
+PASS Redirect 307 from remote to another remote with user 
+PASS Redirect 307 from remote to another remote with password 
+PASS Redirect 307 from remote to same remote with user and password 
+PASS Redirect 307 from remote to same remote with user 
+PASS Redirect 307 from remote to same remote with password 
+PASS Redirect 308 from same origin to remote with user and password 
+PASS Redirect 308 from same origin to remote with user 
+PASS Redirect 308 from same origin to remote with password 
+PASS Redirect 308 from remote to same origin with user and password 
+PASS Redirect 308 from remote to same origin with user 
+PASS Redirect 308 from remote to same origin with password 
+PASS Redirect 308 from remote to another remote with user and password 
+PASS Redirect 308 from remote to another remote with user 
+PASS Redirect 308 from remote to another remote with password 
+PASS Redirect 308 from remote to same remote with user and password 
+PASS Redirect 308 from remote to same remote with user 
+PASS Redirect 308 from remote to same remote with password 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsredirectcredentialsworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials-worker-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials-worker-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,62 @@
</span><ins>+
+PASS Redirect 301 from same origin to remote with user and password 
+PASS Redirect 301 from same origin to remote with user 
+PASS Redirect 301 from same origin to remote with password 
+PASS Redirect 301 from remote to same origin with user and password 
+PASS Redirect 301 from remote to same origin with user 
+PASS Redirect 301 from remote to same origin with password 
+PASS Redirect 301 from remote to another remote with user and password 
+PASS Redirect 301 from remote to another remote with user 
+PASS Redirect 301 from remote to another remote with password 
+PASS Redirect 301 from remote to same remote with user and password 
+PASS Redirect 301 from remote to same remote with user 
+PASS Redirect 301 from remote to same remote with password 
+PASS Redirect 302 from same origin to remote with user and password 
+PASS Redirect 302 from same origin to remote with user 
+PASS Redirect 302 from same origin to remote with password 
+PASS Redirect 302 from remote to same origin with user and password 
+PASS Redirect 302 from remote to same origin with user 
+PASS Redirect 302 from remote to same origin with password 
+PASS Redirect 302 from remote to another remote with user and password 
+PASS Redirect 302 from remote to another remote with user 
+PASS Redirect 302 from remote to another remote with password 
+PASS Redirect 302 from remote to same remote with user and password 
+PASS Redirect 302 from remote to same remote with user 
+PASS Redirect 302 from remote to same remote with password 
+PASS Redirect 303 from same origin to remote with user and password 
+PASS Redirect 303 from same origin to remote with user 
+PASS Redirect 303 from same origin to remote with password 
+PASS Redirect 303 from remote to same origin with user and password 
+PASS Redirect 303 from remote to same origin with user 
+PASS Redirect 303 from remote to same origin with password 
+PASS Redirect 303 from remote to another remote with user and password 
+PASS Redirect 303 from remote to another remote with user 
+PASS Redirect 303 from remote to another remote with password 
+PASS Redirect 303 from remote to same remote with user and password 
+PASS Redirect 303 from remote to same remote with user 
+PASS Redirect 303 from remote to same remote with password 
+PASS Redirect 307 from same origin to remote with user and password 
+PASS Redirect 307 from same origin to remote with user 
+PASS Redirect 307 from same origin to remote with password 
+PASS Redirect 307 from remote to same origin with user and password 
+PASS Redirect 307 from remote to same origin with user 
+PASS Redirect 307 from remote to same origin with password 
+PASS Redirect 307 from remote to another remote with user and password 
+PASS Redirect 307 from remote to another remote with user 
+PASS Redirect 307 from remote to another remote with password 
+PASS Redirect 307 from remote to same remote with user and password 
+PASS Redirect 307 from remote to same remote with user 
+PASS Redirect 307 from remote to same remote with password 
+PASS Redirect 308 from same origin to remote with user and password 
+PASS Redirect 308 from same origin to remote with user 
+PASS Redirect 308 from same origin to remote with password 
+PASS Redirect 308 from remote to same origin with user and password 
+PASS Redirect 308 from remote to same origin with user 
+PASS Redirect 308 from remote to same origin with password 
+PASS Redirect 308 from remote to another remote with user and password 
+PASS Redirect 308 from remote to another remote with user 
+PASS Redirect 308 from remote to another remote with password 
+PASS Redirect 308 from remote to same remote with user and password 
+PASS Redirect 308 from remote to same remote with user 
+PASS Redirect 308 from remote to same remote with password 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsredirectcredentialsworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials-worker.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials-worker.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials-worker.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch in worker: redirection url has credentials&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-fetch&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;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      fetch_tests_from_worker(new Worker(&quot;cors-redirect-credentials.js&quot;));
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsredirectcredentialshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch: redirection url has credentials&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-fetch&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;/head&gt;
+  &lt;body&gt;
+    &lt;script src=&quot;../resources/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;cors-redirect-credentials.js?pipe=sub&quot;&gt;&lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsredirectcredentialsjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials.js (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials.js        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+if (this.document === undefined) {
+  importScripts(&quot;/resources/testharness.js&quot;);
+  importScripts(&quot;../resources/utils.js&quot;);
+}
+
+function corsRedirectCredentials(desc, redirectUrl, redirectLocation, redirectStatus, locationCredentials) {
+
+  var url = redirectUrl
+  var urlParameters = &quot;?redirect_status=&quot; + redirectStatus;
+  urlParameters += &quot;&amp;location=&quot; + encodeURIComponent(redirectLocation.replace(&quot;://&quot;, &quot;://&quot; + locationCredentials + &quot;@&quot;));
+
+  var requestInit = {&quot;mode&quot;: &quot;cors&quot;, &quot;redirect&quot;: &quot;follow&quot;, &quot;credentials&quot;:&quot;include&quot;};
+
+  promise_test(function(test) {
+    return promise_rejects(test, new TypeError(), fetch(url + urlParameters, requestInit));
+  }, desc);
+}
+
+var redirPath = dirname(location.pathname) + RESOURCES_DIR + &quot;redirect.py&quot;;
+var preflightPath = dirname(location.pathname) + RESOURCES_DIR + &quot;preflight.py&quot;;
+
+var localRedirect = &quot;http://{{host}}:{{ports[http][0]}}&quot; + redirPath;
+var remoteRedirect = &quot;http://www1.{{host}}:{{ports[http][0]}}&quot; + redirPath;
+
+var localLocation = &quot;http://{{host}}:{{ports[http][0]}}&quot; + preflightPath;
+var remoteLocation = &quot;http://www1.{{host}}:{{ports[http][0]}}&quot; + preflightPath;
+var remoteLocation2 = &quot;http://www.{{host}}:{{ports[http][0]}}&quot; + preflightPath;
+
+for (var code of [301, 302, 303, 307, 308]) {
+  corsRedirectCredentials(&quot;Redirect &quot; + code + &quot; from same origin to remote with user and password&quot;, localRedirect, remoteLocation, code, &quot;user:password&quot;);
+  corsRedirectCredentials(&quot;Redirect &quot; + code + &quot; from same origin to remote with user&quot;, localRedirect, remoteLocation, code, &quot;user:&quot;);
+  corsRedirectCredentials(&quot;Redirect &quot; + code + &quot; from same origin to remote with password&quot;, localRedirect, remoteLocation, code, &quot;:password&quot;);
+
+  corsRedirectCredentials(&quot;Redirect &quot; + code + &quot; from remote to same origin with user and password&quot;, remoteRedirect, localLocation, code, &quot;user:password&quot;);
+  corsRedirectCredentials(&quot;Redirect &quot; + code + &quot; from remote to same origin with user&quot;, remoteRedirect, localLocation, code, &quot;user:&quot;);
+  corsRedirectCredentials(&quot;Redirect &quot; + code + &quot; from remote to same origin with password&quot;, remoteRedirect, localLocation, code, &quot;:password&quot;);
+
+  corsRedirectCredentials(&quot;Redirect &quot; + code + &quot; from remote to another remote with user and password&quot;, remoteRedirect, remoteLocation2, code, &quot;user:password&quot;);
+  corsRedirectCredentials(&quot;Redirect &quot; + code + &quot; from remote to another remote with user&quot;, remoteRedirect, remoteLocation2, code, &quot;user:&quot;);
+  corsRedirectCredentials(&quot;Redirect &quot; + code + &quot; from remote to another remote with password&quot;, remoteRedirect, remoteLocation2, code, &quot;:password&quot;);
+
+  corsRedirectCredentials(&quot;Redirect &quot; + code + &quot; from remote to same remote with user and password&quot;, remoteRedirect, remoteLocation, code, &quot;user:password&quot;);
+  corsRedirectCredentials(&quot;Redirect &quot; + code + &quot; from remote to same remote with user&quot;, remoteRedirect, remoteLocation, code, &quot;user:&quot;);
+  corsRedirectCredentials(&quot;Redirect &quot; + code + &quot; from remote to same remote with password&quot;, remoteRedirect, remoteLocation, code, &quot;:password&quot;);
+}
+
+done();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsredirectexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+
+PASS Redirect 301: cors to same cors 
+PASS Redirect 301: cors to another cors 
+PASS Redirect 301: same origin to cors 
+PASS Redirect 301: cors to same origin 
+PASS Redirect 302: cors to same cors 
+PASS Redirect 302: cors to another cors 
+PASS Redirect 302: same origin to cors 
+PASS Redirect 302: cors to same origin 
+PASS Redirect 303: cors to same cors 
+PASS Redirect 303: cors to another cors 
+PASS Redirect 303: same origin to cors 
+PASS Redirect 303: cors to same origin 
+PASS Redirect 307: cors to same cors 
+PASS Redirect 307: cors to another cors 
+PASS Redirect 307: same origin to cors 
+PASS Redirect 307: cors to same origin 
+PASS Redirect 308: cors to same cors 
+PASS Redirect 308: cors to another cors 
+PASS Redirect 308: same origin to cors 
+PASS Redirect 308: cors to same origin 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsredirectworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-worker-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-worker-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+
+PASS Redirect 301: cors to same cors 
+PASS Redirect 301: cors to another cors 
+PASS Redirect 301: same origin to cors 
+PASS Redirect 301: cors to same origin 
+PASS Redirect 302: cors to same cors 
+PASS Redirect 302: cors to another cors 
+PASS Redirect 302: same origin to cors 
+PASS Redirect 302: cors to same origin 
+PASS Redirect 303: cors to same cors 
+PASS Redirect 303: cors to another cors 
+PASS Redirect 303: same origin to cors 
+PASS Redirect 303: cors to same origin 
+PASS Redirect 307: cors to same cors 
+PASS Redirect 307: cors to another cors 
+PASS Redirect 307: same origin to cors 
+PASS Redirect 307: cors to same origin 
+PASS Redirect 308: cors to same cors 
+PASS Redirect 308: cors to another cors 
+PASS Redirect 308: same origin to cors 
+PASS Redirect 308: cors to same origin 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsredirectworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-worker.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-worker.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-worker.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch in worker: CORS Redirection with several origins&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-network-or-cache-fetch&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;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      fetch_tests_from_worker(new Worker(&quot;cors-redirect.js?pipe=sub&quot;));
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsredirecthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch:  CORS Redirection with several origins&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-network-or-cache-fetch&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;/head&gt;
+  &lt;body&gt;
+    &lt;script src=&quot;/common/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;../resources/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;cors-redirect.js?pipe=sub&quot;&gt;&lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorscorsredirectjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect.js (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect.js        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+if (this.document === undefined) {
+  importScripts(&quot;/resources/testharness.js&quot;);
+  importScripts(&quot;/common/utils.js&quot;);
+  importScripts(&quot;../resources/utils.js&quot;);
+}
+
+function corsRedirect(desc, redirectUrl, redirectLocation, redirectStatus, expectedOrigin) {
+  var uuid_token = token();
+  var url = redirectUrl;
+  var urlParameters = &quot;?token=&quot; + uuid_token + &quot;&amp;max_age=0&quot;;
+  urlParameters += &quot;&amp;redirect_status=&quot; + redirectStatus;
+  urlParameters += &quot;&amp;location=&quot; + encodeURIComponent(redirectLocation);
+
+  var requestInit = {&quot;mode&quot;: &quot;cors&quot;, &quot;redirect&quot;: &quot;follow&quot;};
+
+  promise_test(function(test) {
+    fetch(RESOURCES_DIR + &quot;clean-stash.py?token=&quot; + uuid_token).then(function(resp) {
+      return fetch(url + urlParameters, requestInit).then(function(resp) {
+        assert_equals(resp.status, 200, &quot;Response's status is 200&quot;);
+        assert_equals(resp.headers.get(&quot;x-did-preflight&quot;), &quot;0&quot;, &quot;No preflight request has been made&quot;);
+        assert_equals(resp.headers.get(&quot;x-origin&quot;), expectedOrigin, &quot;Origin is correctly set after redirect&quot;);
+      });
+    });
+  }, desc);
+}
+
+var redirPath = dirname(location.pathname) + RESOURCES_DIR + &quot;redirect.py&quot;;
+var preflightPath = dirname(location.pathname) + RESOURCES_DIR + &quot;preflight.py&quot;;
+
+var localRedirect = &quot;http://{{host}}:{{ports[http][0]}}&quot; + redirPath;
+var remoteRedirect = &quot;http://www1.{{host}}:{{ports[http][0]}}&quot; + redirPath;
+
+var localLocation = &quot;http://{{host}}:{{ports[http][0]}}&quot; + preflightPath;
+var remoteLocation = &quot;http://www1.{{host}}:{{ports[http][0]}}&quot; + preflightPath;
+var remoteLocation2 = &quot;http://www.{{host}}:{{ports[http][0]}}&quot; + preflightPath;
+
+for (var code of [301, 302, 303, 307, 308]) {
+  corsRedirect(&quot;Redirect &quot; + code + &quot;: cors to same cors&quot;, remoteRedirect, remoteLocation, code, location.origin);
+  corsRedirect(&quot;Redirect &quot; + code + &quot;: cors to another cors&quot;, remoteRedirect, remoteLocation2, code, &quot;null&quot;);
+  corsRedirect(&quot;Redirect &quot; + code + &quot;: same origin to cors&quot;, localRedirect, remoteLocation, code, location.origin);
+  corsRedirect(&quot;Redirect &quot; + code + &quot;: cors to same origin&quot;, remoteRedirect, localLocation, code, &quot;null&quot;);
+}
+
+done();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicorsw3cimportlog"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/w3c-import.log (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/w3c-import.log                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/w3c-import.log        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,53 @@
</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/fetch/api/cors/cors-basic-worker.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.js
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-worker.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies.js
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-filtering-worker.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-filtering.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-filtering.js
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-multiple-origins-worker.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-multiple-origins.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-multiple-origins.js
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight-worker.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-no-preflight.js
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin-worker.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin.js
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect-worker.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect.js
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-referrer.js
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status.js
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-worker.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight.js
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials-worker.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-credentials.js
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-worker.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect.js
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicredentialsauthenticationbasicexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+localhost:8800 - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet
+localhost:8800 - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet
+localhost:8800 - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet
+
+FAIL User-added Authorization header with include mode assert_equals: HTTP status is 200 expected 200 but got 401
+FAIL User-added Authorization header with same-origin mode assert_equals: HTTP status is 200 expected 200 but got 401
+FAIL User-added Authorization header with omit mode assert_equals: HTTP status is 200 expected 200 but got 401
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicredentialsauthenticationbasicworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic-worker-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic-worker-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+
+FAIL User-added Authorization header with include mode Can't find variable: btoa
+FAIL User-added Authorization header with same-origin mode Can't find variable: btoa
+FAIL User-added Authorization header with omit mode Can't find variable: btoa
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicredentialsauthenticationbasicworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic-worker.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic-worker.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic-worker.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch in worker: Authorisation header management for basic authentication&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-fetch&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;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      fetch_tests_from_worker(new Worker(&quot;authentication-basic.js&quot;));
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicredentialsauthenticationbasichtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch: Authorisation header management for basic authentication&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-fetch&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;/head&gt;
+  &lt;body&gt;
+    &lt;script src=&quot;../resources/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;authentication-basic.js&quot;&gt;&lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicredentialsauthenticationbasicjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic.js (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic.js        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+if (this.document === undefined) {
+  importScripts(&quot;/resources/testharness.js&quot;);
+  importScripts(&quot;../resources/utils.js&quot;);
+}
+
+function basicAuth(desc, user, pass, mode, status) {
+  promise_test(function(test) {
+    var headers = { &quot;Authorization&quot;: &quot;Basic &quot; + btoa(user + &quot;:&quot; + pass)};
+    var requestInit = {&quot;credentials&quot;: mode, &quot;headers&quot;: headers};
+    return fetch(RESOURCES_DIR + &quot;authentication.py?realm=test&quot;, requestInit).then(function(resp) {
+        assert_equals(resp.status, status, &quot;HTTP status is &quot; + status);
+        assert_equals(resp.type , &quot;basic&quot;, &quot;Response's type is basic&quot;);
+    });
+  }, desc);
+}
+
+basicAuth(&quot;User-added Authorization header with include mode&quot;, &quot;user&quot;, &quot;password&quot;, &quot;include&quot;, 200);
+basicAuth(&quot;User-added Authorization header with same-origin mode&quot;, &quot;user&quot;, &quot;password&quot;, &quot;same-origin&quot;, 200);
+basicAuth(&quot;User-added Authorization header with omit mode&quot;, &quot;user&quot;, &quot;password&quot;, &quot;omit&quot;, 200);
+
+done();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicredentialscookiesexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+
+PASS Include mode: 1 cookie 
+PASS Include mode: 2 cookies 
+FAIL Omit mode: discard cookies assert_false: Request does not have cookie(s) expected false got true
+FAIL Omit mode: no cookie is stored assert_false: Request does not have cookie(s) expected false got true
+FAIL Omit mode: no cookie is sent assert_false: Request does not have cookie(s) expected false got true
+PASS Same-origin mode: 1 cookie 
+PASS Same-origin mode: 2 cookies 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicredentialscookiesworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies-worker-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies-worker-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+
+PASS Include mode: 1 cookie 
+PASS Include mode: 2 cookies 
+PASS Omit mode: discard cookies 
+PASS Omit mode: no cookie is stored 
+PASS Omit mode: no cookie is sent 
+PASS Same-origin mode: 1 cookie 
+PASS Same-origin mode: 2 cookies 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicredentialscookiesworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies-worker.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies-worker.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies-worker.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch in worker: cookies management&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-network-fetch&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;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      fetch_tests_from_worker(new Worker(&quot;cookies.js&quot;));
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicredentialscookieshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch: cookies management&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-network-fetch&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;/head&gt;
+  &lt;body&gt;
+    &lt;script src=&quot;../resources/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;cookies.js&quot;&gt;&lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicredentialscookiesjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies.js (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies.js        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+if (this.document === undefined) {
+  importScripts(&quot;/resources/testharness.js&quot;);
+  importScripts(&quot;../resources/utils.js&quot;);
+}
+
+function cookies(desc, credentials1, credentials2 ,cookies) {
+  var url = RESOURCES_DIR + &quot;top.txt&quot;
+  var urlParameters = &quot;&quot;;
+  var urlCleanParameters = &quot;&quot;;
+  if (cookies) {
+    urlParameters +=&quot;?pipe=header(Set-Cookie,&quot;;
+    urlParameters += cookies.join(&quot;,True)|header(Set-Cookie,&quot;) +  &quot;,True)&quot;;
+    urlCleanParameters +=&quot;?pipe=header(Set-Cookie,&quot;;
+    urlCleanParameters +=  cookies.join(&quot;%3B%20max-age=0,True)|header(Set-Cookie,&quot;) +  &quot;%3B%20max-age=0,True)&quot;;
+  }
+
+  var requestInit = {&quot;credentials&quot;: credentials1}
+  promise_test(function(test){
+    var requestInit = {&quot;credentials&quot;: credentials1}
+    return fetch(url + urlParameters, requestInit).then(function(resp) {
+      assert_equals(resp.status, 200, &quot;HTTP status is 200&quot;);
+      assert_equals(resp.type , &quot;basic&quot;, &quot;Response's type is basic&quot;);
+      //check cookies sent
+      return fetch(RESOURCES_DIR + &quot;inspect-headers.py?headers=cookie&quot; , {&quot;credentials&quot;: credentials2});
+    }).then(function(resp) {
+      assert_equals(resp.status, 200, &quot;HTTP status is 200&quot;);
+      assert_equals(resp.type , &quot;basic&quot;, &quot;Response's type is basic&quot;);
+      assert_false(resp.headers.has(&quot;Cookie&quot;) , &quot;Cookie header is not exposed in response&quot;);
+      if (credentials1 != &quot;omit&quot; &amp;&amp; credentials2 != &quot;omit&quot;) {
+        assert_equals(resp.headers.get(&quot;x-request-cookie&quot;) , cookies.join(&quot;; &quot;), &quot;Request include cookie(s)&quot;);
+      }
+      else {
+        assert_false(resp.headers.has(&quot;x-request-cookie&quot;) , &quot;Request does not have cookie(s)&quot;);
+      }
+      //clean cookies
+      return fetch(url + urlCleanParameters, {&quot;credentials&quot;: &quot;include&quot;});
+    }).catch(function(e) {
+      return fetch(url + urlCleanParameters, {&quot;credentials&quot;: &quot;include&quot;}).then(function() {
+        return Promise.reject(e);
+      });
+    });
+  }, desc);
+}
+
+cookies(&quot;Include mode: 1 cookie&quot;, &quot;include&quot;, &quot;include&quot;, [&quot;a=1&quot;]);
+cookies(&quot;Include mode: 2 cookies&quot;, &quot;include&quot;, &quot;include&quot;, [&quot;b=2&quot;, &quot;c=3&quot;]);
+cookies(&quot;Omit mode: discard cookies&quot;, &quot;omit&quot;, &quot;omit&quot;, [&quot;d=4&quot;]);
+cookies(&quot;Omit mode: no cookie is stored&quot;, &quot;omit&quot;, &quot;include&quot;, [&quot;e=5&quot;]);
+cookies(&quot;Omit mode: no cookie is sent&quot;, &quot;include&quot;, &quot;omit&quot;, [&quot;f=6&quot;]);
+cookies(&quot;Same-origin mode: 1 cookie&quot;, &quot;same-origin&quot;, &quot;same-origin&quot;, [&quot;a=1&quot;]);
+cookies(&quot;Same-origin mode: 2 cookies&quot;, &quot;same-origin&quot;, &quot;same-origin&quot;, [&quot;b=2&quot;, &quot;c=3&quot;]);
+
+done();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapicredentialsw3cimportlog"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/w3c-import.log (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/w3c-import.log                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/w3c-import.log        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,23 @@
</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/fetch/api/credentials/authentication-basic-worker.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic.js
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies-worker.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/credentials/cookies.js
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciescspblockedexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+
+FAIL Fetch is blocked by CSP, got a TypeError assert_unreached: Should have rejected. Reached unreachable code
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciescspblockedworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked-worker-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked-worker-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+
+FAIL Fetch is blocked by CSP, got a TypeError assert_unreached: Should have rejected. Reached unreachable code
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciescspblockedworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked-worker.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked-worker.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked-worker.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch in worker: blocked by CSP&lt;/title&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&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;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      fetch_tests_from_worker(new Worker(&quot;csp-blocked.js&quot;));
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciescspblockedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch: blocked by CSP&lt;/title&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&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;/head&gt;
+  &lt;body&gt;
+    &lt;script src=&quot;../resources/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;csp-blocked.js&quot;&gt;&lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciescspblockedhtmlheaders"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked.html.headers (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked.html.headers                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked.html.headers        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+Content-Security-Policy: connect-src 'none';
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciescspblockedjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked.js (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked.js        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+if (this.document === undefined) {
+  importScripts(&quot;/resources/testharness.js&quot;);
+  importScripts(&quot;../resources/utils.js&quot;);
+}
+
+//Content-Security-Policy: connect-src 'none'; cf .headers file
+cspViolationUrl = RESOURCES_DIR + &quot;top.txt&quot;;
+
+promise_test(function(test) {
+  return promise_rejects(test, new TypeError(), fetch(cspViolationUrl));
+}, &quot;Fetch is blocked by CSP, got a TypeError&quot;);
+
+done();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciescspblockedjsheaders"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked.js.headers (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked.js.headers                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked.js.headers        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+Content-Security-Policy: connect-src 'none';
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrernoreferrerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'referrer'.
+
+
+PASS Request's referrer is empty 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrernoreferrerworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer-worker-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer-worker-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'referrer'.
+
+
+PASS Request's referrer is empty 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrernoreferrerworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer-worker.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer-worker.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer-worker.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch in worker: referrer with no-referrer policy&lt;/title&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-network-or-cache-fetch&quot;&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&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;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      fetch_tests_from_worker(new Worker(&quot;referrer-no-referrer.js&quot;));
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrernoreferrerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch: referrer with no-referrer policy&lt;/title&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&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;/head&gt;
+  &lt;body&gt;
+    &lt;script src=&quot;../resources/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;referrer-no-referrer.js&quot;&gt;&lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrernoreferrerhtmlheaders"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer.html.headers (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer.html.headers                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer.html.headers        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+Content-Security-Policy: referrer no-referrer;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrernoreferrerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer.js (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer.js        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+if (this.document === undefined) {
+  importScripts(&quot;/resources/testharness.js&quot;);
+  importScripts(&quot;../resources/utils.js&quot;);
+}
+
+var fetchedUrl = RESOURCES_DIR + &quot;inspect-headers.py?headers=origin&quot;;
+
+promise_test(function(test) {
+  return fetch(fetchedUrl).then(function(resp) {
+    assert_equals(resp.status, 200, &quot;HTTP status is 200&quot;);
+    assert_equals(resp.type , &quot;basic&quot;, &quot;Response's type is basic&quot;);
+    var referrer = resp.headers.get(&quot;x-request-referer&quot;);
+    //Either no referrer header is sent or it is empty
+    if (referrer)
+      assert_equals(referrer, &quot;&quot;, &quot;request's referrer is empty&quot;);
+  });
+}, &quot;Request's referrer is empty&quot;);
+
+done();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrernoreferrerjsheaders"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer.js.headers (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer.js.headers                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer.js.headers        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+Content-Security-Policy: referrer no-referrer;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferreroriginexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'referrer'.
+
+
+FAIL Request's referrer is origin assert_equals: request's referrer is http://localhost:8800 expected &quot;http://localhost:8800&quot; but got &quot;http://localhost:8800/fetch/api/policies/referrer-origin.html&quot;
+PASS Throw a TypeError referrer is not same-origin with origin 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferreroriginworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin-worker-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin-worker-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'referrer'.
+
+
+FAIL Request's referrer is origin assert_equals: request's referrer is http://localhost:8800 expected &quot;http://localhost:8800&quot; but got &quot;http://localhost:8800/fetch/api/policies/referrer-origin.js?pipe=sub&quot;
+PASS Throw a TypeError referrer is not same-origin with origin 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferreroriginworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin-worker.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin-worker.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin-worker.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch in worker: referrer with origin policy&lt;/title&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-network-or-cache-fetch&quot;&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&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;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      fetch_tests_from_worker(new Worker(&quot;referrer-origin.js?pipe=sub&quot;));
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferreroriginhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch: referrer with origin policy&lt;/title&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-network-or-cache-fetch&quot;&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&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;/head&gt;
+  &lt;body&gt;
+    &lt;script src=&quot;../resources/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;referrer-origin.js?pipe=sub&quot;&gt;&lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferreroriginhtmlheaders"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin.html.headers (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin.html.headers                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin.html.headers        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+Content-Security-Policy: referrer origin;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferreroriginjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin.js (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin.js        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+if (this.document === undefined) {
+  importScripts(&quot;/resources/testharness.js&quot;);
+  importScripts(&quot;../resources/utils.js&quot;);
+}
+
+var origin = &quot;http://{{host}}:{{ports[http][0]}}&quot;;
+var fetchedUrl = RESOURCES_DIR + &quot;inspect-headers.py?headers=referer&quot;;
+
+promise_test(function(test) {
+  return fetch(fetchedUrl).then(function(resp) {
+    assert_equals(resp.status, 200, &quot;HTTP status is 200&quot;);
+    assert_equals(resp.type , &quot;basic&quot;, &quot;Response's type is basic&quot;);
+    assert_equals(resp.headers.get(&quot;x-request-referer&quot;), origin, &quot;request's referrer is &quot; + origin);
+  });
+}, &quot;Request's referrer is origin&quot;);
+
+promise_test(function(test) {
+  var referrerUrl = &quot;http://{{domains[www]}}:{{ports[http][0]}}/&quot;;
+  return promise_rejects(test, new TypeError(), fetch(fetchedUrl, { &quot;referrer&quot;:  referrerUrl}));
+}, &quot;Throw a TypeError referrer is not same-origin with origin&quot;);
+
+done();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferreroriginjsheaders"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin.js.headers (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin.js.headers                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin.js.headers        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+Content-Security-Policy: referrer origin;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrerunsafeurlexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'referrer'.
+
+
+PASS Request's referrer is the full url of current document/worker 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrerunsafeurlworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url-worker-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url-worker-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'referrer'.
+
+
+PASS Request's referrer is the full url of current document/worker 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrerunsafeurlworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url-worker.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url-worker.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url-worker.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch in worker: referrer with unsafe-url policy&lt;/title&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-network-or-cache-fetch&quot;&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&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;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      fetch_tests_from_worker(new Worker(&quot;referrer-unsafe-url.js&quot;));
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrerunsafeurlhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch: referrer with unsafe-url policy&lt;/title&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#main-fetch&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-network-or-cache-fetch&quot;&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&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;/head&gt;
+  &lt;body&gt;
+    &lt;script src=&quot;../resources/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;referrer-unsafe-url.js&quot;&gt;&lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrerunsafeurlhtmlheaders"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url.html.headers (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url.html.headers                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url.html.headers        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+Content-Security-Policy: referrer unsafe-url;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrerunsafeurljs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url.js (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url.js        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+if (this.document === undefined) {
+  importScripts(&quot;/resources/testharness.js&quot;);
+  importScripts(&quot;../resources/utils.js&quot;);
+}
+
+var referrerUrl = location.href;
+var fetchedUrl = RESOURCES_DIR + &quot;inspect-headers.py?headers=referer&quot;;
+
+promise_test(function(test) {
+  return fetch(fetchedUrl).then(function(resp) {
+    assert_equals(resp.status, 200, &quot;HTTP status is 200&quot;);
+    assert_equals(resp.type , &quot;basic&quot;, &quot;Response's type is basic&quot;);
+    assert_equals(resp.headers.get(&quot;x-request-referer&quot;), referrerUrl, &quot;request's referrer is &quot; + referrerUrl);
+  });
+}, &quot;Request's referrer is the full url of current document/worker&quot;);
+
+done();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesreferrerunsafeurljsheaders"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url.js.headers (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url.js.headers                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url.js.headers        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+Content-Security-Policy: referrer unsafe-url;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapipoliciesw3cimportlog"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/w3c-import.log (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/w3c-import.log                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/w3c-import.log        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,37 @@
</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/fetch/api/policies/csp-blocked-worker.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked.html.headers
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked.js
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/csp-blocked.js.headers
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer-worker.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer.html.headers
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer.js
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-no-referrer.js.headers
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin-worker.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin.html.headers
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin.js
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin.js.headers
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url-worker.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url.html.headers
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url.js
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-unsafe-url.js.headers
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectcountexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+
+PASS Redirect 301 20 times 
+PASS Redirect 301 21 times 
+PASS Redirect 302 20 times 
+PASS Redirect 302 21 times 
+PASS Redirect 303 20 times 
+PASS Redirect 303 21 times 
+PASS Redirect 307 20 times 
+PASS Redirect 307 21 times 
+PASS Redirect 308 20 times 
+PASS Redirect 308 21 times 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectcountworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count-worker-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count-worker-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+
+PASS Redirect 301 20 times 
+PASS Redirect 301 21 times 
+PASS Redirect 302 20 times 
+PASS Redirect 302 21 times 
+PASS Redirect 303 20 times 
+PASS Redirect 303 21 times 
+PASS Redirect 307 20 times 
+PASS Redirect 307 21 times 
+PASS Redirect 308 20 times 
+PASS Redirect 308 21 times 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectcountworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count-worker.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count-worker.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count-worker.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch in worker: rediraction loop&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-network-or-cache-fetch&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;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      fetch_tests_from_worker(new Worker(&quot;redirect-count.js&quot;));
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectcounthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch: redirection loop&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-network-or-cache-fetch&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;/head&gt;
+  &lt;body&gt;
+    &lt;script src=&quot;/common/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;../resources/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;redirect-count.js&quot;&gt;&lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectcountjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count.js (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count.js        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+if (this.document === undefined) {
+  importScripts(&quot;/resources/testharness.js&quot;);
+  importScripts(&quot;../resources/utils.js&quot;);
+  importScripts(&quot;/common/utils.js&quot;);
+}
+
+function redirectCount(desc, redirectUrl, redirectLocation, redirectStatus, maxCount, shouldPass) {
+  var uuid_token = token();
+
+  var urlParameters = &quot;?token=&quot; + uuid_token + &quot;&amp;max_age=0&quot;;
+  urlParameters += &quot;&amp;redirect_status=&quot; + redirectStatus;
+  urlParameters += &quot;&amp;max_count=&quot; + maxCount;
+  if (redirectLocation)
+    urlParameters += &quot;&amp;location=&quot; + encodeURIComponent(redirectLocation);
+
+  var url = redirectUrl;
+  var requestInit = {&quot;redirect&quot;: &quot;follow&quot;};
+
+  promise_test(function(test) {
+    fetch(RESOURCES_DIR + &quot;clean-stash.py?token=&quot; + uuid_token).then(function(resp) {
+      assert_equals(resp.status, 200, &quot;Clean stash response's status is 200&quot;);
+
+      if (!shouldPass)
+        return promise_rejects(test, new TypeError(), fetch(url + urlParameters, requestInit));
+
+      return fetch(url + urlParameters, requestInit).then(function(resp) {
+        assert_equals(resp.status, 200, &quot;Response's status is 200&quot;);
+      });
+    }).then(function(body) {
+      assert_equals(body, maxCount.toString(), &quot;Redirected &quot; + maxCount + &quot;times&quot;);
+    });
+  }, desc);
+}
+
+var redirUrl = RESOURCES_DIR + &quot;redirect.py&quot;;
+
+for (var statusCode of [301, 302, 303, 307, 308]) {
+  redirectCount(&quot;Redirect &quot; + statusCode + &quot; 20 times&quot;, redirUrl, redirUrl, statusCode, 20, true);
+  redirectCount(&quot;Redirect &quot; + statusCode + &quot; 21 times&quot;, redirUrl, redirUrl, statusCode, 21, false);
+}
+
+done();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectlocationexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+
+PASS Redirect 301 in &quot;follow&quot; mode without location 
+PASS Redirect 301 in &quot;manual&quot; mode without location 
+PASS Redirect 301 in &quot;follow&quot; mode with invalid location 
+PASS Redirect 301 in &quot;manual&quot; mode with invalid location 
+PASS Redirect 301 in &quot;follow&quot; mode with data location 
+FAIL Redirect 301 in &quot;manual&quot; mode with data location promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+PASS Redirect 302 in &quot;follow&quot; mode without location 
+PASS Redirect 302 in &quot;manual&quot; mode without location 
+PASS Redirect 302 in &quot;follow&quot; mode with invalid location 
+PASS Redirect 302 in &quot;manual&quot; mode with invalid location 
+PASS Redirect 302 in &quot;follow&quot; mode with data location 
+FAIL Redirect 302 in &quot;manual&quot; mode with data location promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+PASS Redirect 303 in &quot;follow&quot; mode without location 
+PASS Redirect 303 in &quot;manual&quot; mode without location 
+PASS Redirect 303 in &quot;follow&quot; mode with invalid location 
+PASS Redirect 303 in &quot;manual&quot; mode with invalid location 
+PASS Redirect 303 in &quot;follow&quot; mode with data location 
+FAIL Redirect 303 in &quot;manual&quot; mode with data location promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+PASS Redirect 307 in &quot;follow&quot; mode without location 
+PASS Redirect 307 in &quot;manual&quot; mode without location 
+PASS Redirect 307 in &quot;follow&quot; mode with invalid location 
+PASS Redirect 307 in &quot;manual&quot; mode with invalid location 
+PASS Redirect 307 in &quot;follow&quot; mode with data location 
+FAIL Redirect 307 in &quot;manual&quot; mode with data location promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+PASS Redirect 308 in &quot;follow&quot; mode without location 
+PASS Redirect 308 in &quot;manual&quot; mode without location 
+PASS Redirect 308 in &quot;follow&quot; mode with invalid location 
+PASS Redirect 308 in &quot;manual&quot; mode with invalid location 
+PASS Redirect 308 in &quot;follow&quot; mode with data location 
+FAIL Redirect 308 in &quot;manual&quot; mode with data location promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectlocationworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-worker-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-worker-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+
+PASS Redirect 301 in &quot;follow&quot; mode without location 
+PASS Redirect 301 in &quot;manual&quot; mode without location 
+PASS Redirect 301 in &quot;follow&quot; mode with invalid location 
+PASS Redirect 301 in &quot;manual&quot; mode with invalid location 
+PASS Redirect 301 in &quot;follow&quot; mode with data location 
+FAIL Redirect 301 in &quot;manual&quot; mode with data location promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+PASS Redirect 302 in &quot;follow&quot; mode without location 
+PASS Redirect 302 in &quot;manual&quot; mode without location 
+PASS Redirect 302 in &quot;follow&quot; mode with invalid location 
+PASS Redirect 302 in &quot;manual&quot; mode with invalid location 
+PASS Redirect 302 in &quot;follow&quot; mode with data location 
+FAIL Redirect 302 in &quot;manual&quot; mode with data location promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+PASS Redirect 303 in &quot;follow&quot; mode without location 
+PASS Redirect 303 in &quot;manual&quot; mode without location 
+PASS Redirect 303 in &quot;follow&quot; mode with invalid location 
+PASS Redirect 303 in &quot;manual&quot; mode with invalid location 
+PASS Redirect 303 in &quot;follow&quot; mode with data location 
+FAIL Redirect 303 in &quot;manual&quot; mode with data location promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+PASS Redirect 307 in &quot;follow&quot; mode without location 
+PASS Redirect 307 in &quot;manual&quot; mode without location 
+PASS Redirect 307 in &quot;follow&quot; mode with invalid location 
+PASS Redirect 307 in &quot;manual&quot; mode with invalid location 
+PASS Redirect 307 in &quot;follow&quot; mode with data location 
+FAIL Redirect 307 in &quot;manual&quot; mode with data location promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+PASS Redirect 308 in &quot;follow&quot; mode without location 
+PASS Redirect 308 in &quot;manual&quot; mode without location 
+PASS Redirect 308 in &quot;follow&quot; mode with invalid location 
+PASS Redirect 308 in &quot;manual&quot; mode with invalid location 
+PASS Redirect 308 in &quot;follow&quot; mode with data location 
+FAIL Redirect 308 in &quot;manual&quot; mode with data location promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectlocationworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-worker.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-worker.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-worker.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch in worker: handling Location header during redirection&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-network-or-cache-fetch&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;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      fetch_tests_from_worker(new Worker(&quot;redirect-location.js&quot;));
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectlocationhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch: handling Location header during redirection&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-network-or-cache-fetch&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;/head&gt;
+  &lt;body&gt;
+    &lt;script src=&quot;../resources/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;redirect-location.js&quot;&gt;&lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectlocationjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location.js (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location.js        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+if (this.document === undefined) {
+  importScripts(&quot;/resources/testharness.js&quot;);
+  importScripts(&quot;../resources/utils.js&quot;);
+}
+
+function redirectLocation(desc, redirectUrl, redirectLocation, redirectStatus, redirectMode, shouldPass) {
+  var url = redirectUrl;
+  var urlParameters = &quot;?redirect_status=&quot; + redirectStatus;
+  if (redirectLocation)
+    urlParameters += &quot;&amp;location=&quot; + encodeURIComponent(redirectLocation);
+
+  var requestInit = {&quot;redirect&quot;: redirectMode};
+
+  promise_test(function(test) {
+    if (redirectMode === &quot;error&quot; || !shouldPass)
+      return promise_rejects(test, new TypeError(), fetch(url + urlParameters, requestInit));
+    if (redirectLocation &amp;&amp; redirectMode === &quot;manual&quot;)
+      return fetch(url + urlParameters, requestInit).then(function(resp) {
+        assert_equals(resp.status, 0, &quot;Response's status is 0&quot;);
+        assert_equals(resp.type, &quot;opaqueredirect&quot;, &quot;Response's type is opaqueredirect&quot;);
+        assert_equals(resp.statusText, &quot;&quot;, &quot;Response's statusText is \&quot;\&quot;&quot;);
+        assert_true(resp.headers.entries().next().done, &quot;Headers should be empty&quot;);
+      });
+
+    if (redirectMode === &quot;manual&quot; || redirectMode === &quot;follow&quot;)
+      return fetch(url + urlParameters, requestInit).then(function(resp) {
+        assert_equals(resp.status, redirectStatus, &quot;Response's status is &quot; + redirectStatus);
+      });
+    assert_unreached(redirectMode + &quot; is not a valid redirect mode&quot;);
+  }, desc);
+}
+
+var redirUrl = RESOURCES_DIR + &quot;redirect.py&quot;;
+var locationUrl = &quot;top.txt&quot;;
+var invalidLocationUrl = &quot;#invalidurl:&quot;;
+var dataLocationUrl = &quot;data:,data%20url&quot;;
+// FIXME: We may want to mix redirect-mode and cors-mode.
+// FIXME: Add tests for &quot;error&quot; redirect-mode.
+for (var statusCode of [301, 302, 303, 307, 308]) {
+  redirectLocation(&quot;Redirect &quot; + statusCode + &quot; in \&quot;follow\&quot; mode without location&quot;, redirUrl, undefined, statusCode, &quot;follow&quot;, true);
+  redirectLocation(&quot;Redirect &quot; + statusCode + &quot; in \&quot;manual\&quot; mode without location&quot;, redirUrl, undefined, statusCode, &quot;manual&quot;, true);
+
+  redirectLocation(&quot;Redirect &quot; + statusCode + &quot; in \&quot;follow\&quot; mode with invalid location&quot;, redirUrl, invalidLocationUrl, statusCode, &quot;follow&quot;, false);
+  redirectLocation(&quot;Redirect &quot; + statusCode + &quot; in \&quot;manual\&quot; mode with invalid location&quot;, redirUrl, invalidLocationUrl, statusCode, &quot;manual&quot;, false);
+
+  redirectLocation(&quot;Redirect &quot; + statusCode + &quot; in \&quot;follow\&quot; mode with data location&quot;, redirUrl, dataLocationUrl, statusCode, &quot;follow&quot;, false);
+  redirectLocation(&quot;Redirect &quot; + statusCode + &quot; in \&quot;manual\&quot; mode with data location&quot;, redirUrl, dataLocationUrl, statusCode, &quot;manual&quot;, true);
+}
+
+done();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectmethodexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+
+PASS Redirect 301 with GET 
+PASS Redirect 301 with POST 
+PASS Redirect 301 with HEAD 
+PASS Redirect 302 with GET 
+PASS Redirect 302 with POST 
+PASS Redirect 302 with HEAD 
+PASS Redirect 303 with GET 
+PASS Redirect 303 with POST 
+FAIL Redirect 303 with HEAD assert_equals: Request method after redirection is HEAD expected &quot;HEAD&quot; but got &quot;GET&quot;
+PASS Redirect 307 with GET 
+PASS Redirect 307 with POST 
+PASS Redirect 307 with HEAD 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectmethodworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-worker-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-worker-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+
+PASS Redirect 301 with GET 
+PASS Redirect 301 with POST 
+PASS Redirect 301 with HEAD 
+PASS Redirect 302 with GET 
+PASS Redirect 302 with POST 
+PASS Redirect 302 with HEAD 
+PASS Redirect 303 with GET 
+PASS Redirect 303 with POST 
+FAIL Redirect 303 with HEAD assert_equals: Request method after redirection is HEAD expected &quot;HEAD&quot; but got &quot;GET&quot;
+PASS Redirect 307 with GET 
+PASS Redirect 307 with POST 
+PASS Redirect 307 with HEAD 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectmethodworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-worker.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-worker.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-worker.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch in worker: request method handling when redirected&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-network-or-cache-fetch&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;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      fetch_tests_from_worker(new Worker(&quot;redirect-method.js&quot;));
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectmethodhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch: request method handling when redirected&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-network-or-cache-fetch&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;/head&gt;
+  &lt;body&gt;
+    &lt;script src=&quot;../resources/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;redirect-method.js&quot;&gt;&lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectmethodjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.js (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.js        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+if (this.document === undefined) {
+  importScripts(&quot;/resources/testharness.js&quot;);
+  importScripts(&quot;../resources/utils.js&quot;);
+}
+
+function redirectMethod(desc, redirectUrl, redirectLocation, redirectStatus, method, expectedMethod) {
+  var url = redirectUrl;
+  var urlParameters = &quot;?redirect_status=&quot; + redirectStatus;
+  urlParameters += &quot;&amp;location=&quot; + encodeURIComponent(redirectLocation);
+
+  var requestInit = {&quot;method&quot;: method, &quot;redirect&quot;: &quot;follow&quot;};
+  if (method != &quot;GET&quot; &amp;&amp; method != &quot;HEAD&quot;)
+    requestInit.body = &quot;this is my body&quot;;
+
+  promise_test(function(test) {
+    return fetch(url + urlParameters, requestInit).then(function(resp) {
+      assert_equals(resp.status, 200, &quot;Response's status is 200&quot;);
+      assert_equals(resp.type, &quot;basic&quot;, &quot;Response's type basic&quot;);
+      assert_equals(resp.headers.get(&quot;x-request-method&quot;), expectedMethod, &quot;Request method after redirection is &quot; + expectedMethod);
+      return resp.text().then(function(text) {
+        assert_equals(text, expectedMethod == &quot;POST&quot; ? requestInit.body : &quot;&quot;);
+      });
+    });
+  }, desc);
+}
+
+var redirUrl = RESOURCES_DIR + &quot;redirect.py&quot;;
+var locationUrl = &quot;method.py&quot;;
+
+redirectMethod(&quot;Redirect 301 with GET&quot;, redirUrl, locationUrl, 301, &quot;GET&quot;, &quot;GET&quot;);
+redirectMethod(&quot;Redirect 301 with POST&quot;, redirUrl, locationUrl, 301, &quot;POST&quot;, &quot;GET&quot;);
+redirectMethod(&quot;Redirect 301 with HEAD&quot;, redirUrl, locationUrl, 301, &quot;HEAD&quot;, &quot;HEAD&quot;);
+
+redirectMethod(&quot;Redirect 302 with GET&quot;, redirUrl, locationUrl, 302, &quot;GET&quot;, &quot;GET&quot;);
+redirectMethod(&quot;Redirect 302 with POST&quot;, redirUrl, locationUrl, 302, &quot;POST&quot;, &quot;GET&quot;);
+redirectMethod(&quot;Redirect 302 with HEAD&quot;, redirUrl, locationUrl, 302, &quot;HEAD&quot;, &quot;HEAD&quot;);
+
+redirectMethod(&quot;Redirect 303 with GET&quot;, redirUrl, locationUrl, 303, &quot;GET&quot;, &quot;GET&quot;);
+redirectMethod(&quot;Redirect 303 with POST&quot;, redirUrl, locationUrl, 303, &quot;POST&quot;, &quot;GET&quot;);
+redirectMethod(&quot;Redirect 303 with HEAD&quot;, redirUrl, locationUrl, 303, &quot;HEAD&quot;, &quot;HEAD&quot;);
+
+redirectMethod(&quot;Redirect 307 with GET&quot;, redirUrl, locationUrl, 307, &quot;GET&quot;, &quot;GET&quot;);
+redirectMethod(&quot;Redirect 307 with POST&quot;, redirUrl, locationUrl, 307, &quot;POST&quot;, &quot;POST&quot;);
+redirectMethod(&quot;Redirect 307 with HEAD&quot;, redirUrl, locationUrl, 307, &quot;HEAD&quot;, &quot;HEAD&quot;);
+
+done();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectmodeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+
+FAIL Redirect 301 in &quot;error&quot; mode  assert_unreached: Should have rejected. Reached unreachable code
+PASS Redirect 301 in &quot;follow&quot; mode  
+FAIL Redirect 301 in &quot;manual&quot; mode  assert_equals: Response's status is 0 expected 0 but got 200
+FAIL Redirect 302 in &quot;error&quot; mode  assert_unreached: Should have rejected. Reached unreachable code
+PASS Redirect 302 in &quot;follow&quot; mode  
+FAIL Redirect 302 in &quot;manual&quot; mode  assert_equals: Response's status is 0 expected 0 but got 200
+FAIL Redirect 303 in &quot;error&quot; mode  assert_unreached: Should have rejected. Reached unreachable code
+PASS Redirect 303 in &quot;follow&quot; mode  
+FAIL Redirect 303 in &quot;manual&quot; mode  assert_equals: Response's status is 0 expected 0 but got 200
+FAIL Redirect 307 in &quot;error&quot; mode  assert_unreached: Should have rejected. Reached unreachable code
+PASS Redirect 307 in &quot;follow&quot; mode  
+FAIL Redirect 307 in &quot;manual&quot; mode  assert_equals: Response's status is 0 expected 0 but got 200
+FAIL Redirect 308 in &quot;error&quot; mode  assert_unreached: Should have rejected. Reached unreachable code
+PASS Redirect 308 in &quot;follow&quot; mode  
+FAIL Redirect 308 in &quot;manual&quot; mode  assert_equals: Response's status is 0 expected 0 but got 200
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectmodeworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode-worker-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode-worker-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+
+FAIL Redirect 301 in &quot;error&quot; mode  assert_unreached: Should have rejected. Reached unreachable code
+PASS Redirect 301 in &quot;follow&quot; mode  
+FAIL Redirect 301 in &quot;manual&quot; mode  assert_equals: Response's status is 0 expected 0 but got 200
+FAIL Redirect 302 in &quot;error&quot; mode  assert_unreached: Should have rejected. Reached unreachable code
+PASS Redirect 302 in &quot;follow&quot; mode  
+FAIL Redirect 302 in &quot;manual&quot; mode  assert_equals: Response's status is 0 expected 0 but got 200
+FAIL Redirect 303 in &quot;error&quot; mode  assert_unreached: Should have rejected. Reached unreachable code
+PASS Redirect 303 in &quot;follow&quot; mode  
+FAIL Redirect 303 in &quot;manual&quot; mode  assert_equals: Response's status is 0 expected 0 but got 200
+FAIL Redirect 307 in &quot;error&quot; mode  assert_unreached: Should have rejected. Reached unreachable code
+PASS Redirect 307 in &quot;follow&quot; mode  
+FAIL Redirect 307 in &quot;manual&quot; mode  assert_equals: Response's status is 0 expected 0 but got 200
+FAIL Redirect 308 in &quot;error&quot; mode  assert_unreached: Should have rejected. Reached unreachable code
+PASS Redirect 308 in &quot;follow&quot; mode  
+FAIL Redirect 308 in &quot;manual&quot; mode  assert_equals: Response's status is 0 expected 0 but got 200
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectmodeworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode-worker.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode-worker.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode-worker.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch in worker: redirect mode handling&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#concept-filtered-response-opaque-redirect&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-network-or-cache-fetch&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;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      fetch_tests_from_worker(new Worker(&quot;redirect-mode.js&quot;));
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectmodehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Fetch: redirect mode handling&lt;/title&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#concept-filtered-response-opaque-redirect&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#http-network-or-cache-fetch&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;/head&gt;
+  &lt;body&gt;
+    &lt;script src=&quot;../resources/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;redirect-mode.js&quot;&gt;&lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectredirectmodejs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode.js (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode.js        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+if (this.document === undefined) {
+  importScripts(&quot;/resources/testharness.js&quot;);
+  importScripts(&quot;../resources/utils.js&quot;);
+}
+
+function redirectMode(desc, redirectUrl, redirectLocation, redirectStatus, redirectMode) {
+  var url = redirectUrl;
+  var urlParameters = &quot;?redirect_status=&quot; + redirectStatus;
+  urlParameters += &quot;&amp;location=&quot; + encodeURIComponent(redirectLocation);
+
+  var requestInit = {&quot;redirect&quot;: redirectMode};
+
+  promise_test(function(test) {
+    if (redirectMode === &quot;error&quot;)
+      return promise_rejects(test, new TypeError(), fetch(url + urlParameters, requestInit));
+    if (redirectMode === &quot;manual&quot;)
+      return fetch(url + urlParameters, requestInit).then(function(resp) {
+        assert_equals(resp.status, 0, &quot;Response's status is 0&quot;);
+        assert_equals(resp.type, &quot;opaqueredirect&quot;, &quot;Response's type is opaqueredirect&quot;);
+        assert_equals(resp.statusText, &quot;&quot;, &quot;Response's statusText is \&quot;\&quot;&quot;);
+      });
+    if (redirectMode === &quot;follow&quot;)
+      return fetch(url + urlParameters, requestInit).then(function(resp) {
+        assert_true(new URL(resp.url).pathname.endsWith(locationUrl), &quot;Response's url should be the redirected one&quot;);
+        assert_equals(resp.status, 200, &quot;Response's status is 200&quot;);
+      });
+    assert_unreached(redirectMode + &quot; is no a valid redirect mode&quot;);
+  }, desc);
+}
+
+var redirUrl = RESOURCES_DIR + &quot;redirect.py&quot;;
+var locationUrl = &quot;top.txt&quot;;
+
+for (var statusCode of [301, 302, 303, 307, 308]) {
+  redirectMode(&quot;Redirect &quot; + statusCode + &quot; in \&quot;error\&quot; mode &quot;, redirUrl, locationUrl, statusCode, &quot;error&quot;);
+  redirectMode(&quot;Redirect &quot; + statusCode + &quot; in \&quot;follow\&quot; mode &quot;, redirUrl, locationUrl, statusCode, &quot;follow&quot;);
+  redirectMode(&quot;Redirect &quot; + statusCode + &quot; in \&quot;manual\&quot; mode &quot;, redirUrl, locationUrl, statusCode, &quot;manual&quot;);
+}
+
+done();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiredirectw3cimportlog"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/w3c-import.log (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/w3c-import.log                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/w3c-import.log        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,29 @@
</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/fetch/api/redirect/redirect-count-worker.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count.js
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-worker.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location.js
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-worker.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.js
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode-worker.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode.js
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffimageexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/image-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/image-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/image-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+
+
+FAIL URL query:  assert_unreached: Unexpected load event Reached unreachable code
+FAIL URL query: ?type= assert_unreached: Unexpected load event Reached unreachable code
+FAIL URL query: ?type=x assert_unreached: Unexpected load event Reached unreachable code
+FAIL URL query: ?type=x/x assert_unreached: Unexpected load event Reached unreachable code
+PASS URL query: ?type=image/gif 
+PASS URL query: ?type=image/png 
+PASS URL query: ?type=image/png;blah 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffimagehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/image.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/image.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/image.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+&lt;script src=/resources/testharness.js&gt;&lt;/script&gt;
+&lt;script src=/resources/testharnessreport.js&gt;&lt;/script&gt;
+&lt;div id=log&gt;&lt;/div&gt;
+&lt;script&gt;
+  var fails = [&quot;&quot;, &quot;?type=&quot;, &quot;?type=x&quot;, &quot;?type=x/x&quot;],
+      passes = [&quot;?type=image/gif&quot;, &quot;?type=image/png&quot;, &quot;?type=image/png;blah&quot;]
+
+  fails.forEach(function(urlpart) {
+    async_test(function(t) {
+      var img = document.createElement(&quot;img&quot;)
+      img.onerror = t.step_func_done(function(){})
+      img.onload = t.unreached_func(&quot;Unexpected load event&quot;)
+      img.src = &quot;resources/image.py&quot; + urlpart
+      document.body.appendChild(img)
+    }, &quot;URL query: &quot; + urlpart)
+  })
+
+  passes.forEach(function(urlpart) {
+    async_test(function(t) {
+      var img = document.createElement(&quot;img&quot;)
+      img.onerror = t.unreached_func(&quot;Unexpected error event&quot;)
+      img.onload = t.step_func_done(function(){
+        assert_equals(img.width, 96)
+      })
+      img.src = &quot;resources/image.py&quot; + urlpart
+      document.body.appendChild(img)
+    }, &quot;URL query: &quot; + urlpart)
+  })
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffimportscriptsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/importscripts-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/importscripts-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/importscripts-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+
+FAIL Test importScripts() assert_equals: expected &quot;PASS&quot; but got &quot;FAIL: Content-Type missing&quot;
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffimportscriptshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/importscripts.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/importscripts.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/importscripts.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+&lt;script src=/resources/testharness.js&gt;&lt;/script&gt;
+&lt;script src=/resources/testharnessreport.js&gt;&lt;/script&gt;
+&lt;div id=log&gt;&lt;/div&gt;
+&lt;script&gt;
+ async_test(function(t) {
+   var w = new Worker(&quot;importscripts.js&quot;)
+   w.onmessage = t.step_func(function(e) {
+     if(e.data == &quot;END&quot;)
+       t.done()
+     else
+       assert_equals(e.data, &quot;PASS&quot;)
+   })
+ }, &quot;Test importScripts()&quot;)
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffimportscriptsjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/importscripts.js (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/importscripts.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/importscripts.js        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+// Testing importScripts()
+function log(w) { this.postMessage(w) }
+function f() { log(&quot;FAIL&quot;) }
+function p() { log(&quot;PASS&quot;) }
+
+[&quot;&quot;, &quot;?type=&quot;, &quot;?type=x&quot;, &quot;?type=x/x&quot;].forEach(function(urlpart) {
+  try {
+    importScripts(&quot;resources/js.py&quot; + urlpart)
+  } catch(e) {
+    (e.name == &quot;NetworkError&quot;) ? p() : log(&quot;FAIL (no NetworkError exception): &quot; + urlpart)
+  }
+
+})
+importScripts(&quot;resources/js.py?type=text/javascript&amp;outcome=p&quot;)
+importScripts(&quot;resources/js.py?type=text/ecmascript&amp;outcome=p&quot;)
+importScripts(&quot;resources/js.py?type=text/ecmascript;blah&amp;outcome=p&quot;)
+log(&quot;END&quot;)
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffparsingnosniffexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/parsing-nosniff-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/parsing-nosniff-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/parsing-nosniff-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+
+FAIL URL query: first assert_unreached: Unexpected load event Reached unreachable code
+FAIL URL query: uppercase assert_unreached: Unexpected load event Reached unreachable code
+PASS URL query: last 
+PASS URL query: quoted 
+PASS URL query: quoted-single 
+PASS URL query: no-x 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffparsingnosniffhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/parsing-nosniff.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/parsing-nosniff.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/parsing-nosniff.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+&lt;script src=/resources/testharness.js&gt;&lt;/script&gt;
+&lt;script src=/resources/testharnessreport.js&gt;&lt;/script&gt;
+&lt;div id=log&gt;&lt;/div&gt;
+&lt;script&gt;
+  var fails = [&quot;first&quot;, &quot;uppercase&quot;],
+      passes = [&quot;last&quot;, &quot;quoted&quot;, &quot;quoted-single&quot;, &quot;no-x&quot;]
+
+  fails.forEach(function(urlpart) {
+    async_test(function(t) {
+      var script = document.createElement(&quot;script&quot;)
+      script.onerror = t.step_func_done(function(){})
+      script.onload = t.unreached_func(&quot;Unexpected load event&quot;)
+      script.src = &quot;resources/nosniff-&quot; + urlpart + &quot;.asis&quot;
+      document.body.appendChild(script)
+    }, &quot;URL query: &quot; + urlpart)
+  })
+
+  passes.forEach(function(urlpart) {
+    async_test(function(t) {
+      var script = document.createElement(&quot;script&quot;)
+      script.onerror = t.unreached_func(&quot;Unexpected error event&quot;)
+      script.onload = t.step_func_done(function(){})
+      script.src = &quot;resources/nosniff-&quot; + urlpart + &quot;.asis&quot;
+      document.body.appendChild(script)
+    }, &quot;URL query: &quot; + urlpart)
+  })
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffresourcescsspy"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/css.py (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/css.py                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/css.py        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+def main(request, response):
+    outcome = request.GET.first(&quot;outcome&quot;, &quot;f&quot;)
+    type = request.GET.first(&quot;type&quot;, None)
+
+    content = &quot;/* nothing to see here */&quot;
+
+    response.add_required_headers = False
+    response.writer.write_status(200)
+    response.writer.write_header(&quot;x-content-type-options&quot;, &quot;nosniff&quot;)
+    response.writer.write_header(&quot;content-length&quot;, len(content))
+    if(type != None):
+      response.writer.write_header(&quot;content-type&quot;, type)
+    response.writer.end_headers()
+
+    response.writer.write(content)
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffresourcesimagepy"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/image.py (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/image.py                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/image.py        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+import os.path
+
+def main(request, response):
+    type = request.GET.first(&quot;type&quot;, None)
+
+    body = open(os.path.join(os.path.dirname(__file__), &quot;../../../images/blue96x96.png&quot;)).read()
+
+    response.add_required_headers = False
+    response.writer.write_status(200)
+    response.writer.write_header(&quot;x-content-type-options&quot;, &quot;nosniff&quot;)
+    response.writer.write_header(&quot;content-length&quot;, len(body))
+    if(type != None):
+      response.writer.write_header(&quot;content-type&quot;, type)
+    response.writer.end_headers()
+
+    response.writer.write(body)
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffresourcesjspy"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/js.py (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/js.py                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/js.py        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+def main(request, response):
+    outcome = request.GET.first(&quot;outcome&quot;, &quot;f&quot;)
+    type = request.GET.first(&quot;type&quot;, &quot;Content-Type missing&quot;)
+
+    content = &quot;// nothing to see here&quot;
+    content += &quot;\n&quot;
+    content += &quot;log('FAIL: &quot; + type + &quot;')&quot; if (outcome == &quot;f&quot;) else &quot;p()&quot;
+
+    response.add_required_headers = False
+    response.writer.write_status(200)
+    response.writer.write_header(&quot;x-content-type-options&quot;, &quot;nosniff&quot;)
+    response.writer.write_header(&quot;content-length&quot;, len(content))
+    if(type != &quot;Content-Type missing&quot;):
+      response.writer.write_header(&quot;content-type&quot;, type)
+    response.writer.end_headers()
+
+    response.writer.write(content)
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffresourcesnosnifffirstasis"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-first.asis (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-first.asis                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-first.asis        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+HTTP/1.1 200 YOU HAVE NO POWER HERE
+Content-Length: 22
+Content-Type: x/x
+X-Content-Type-options: nosniff
+X-Content-Type-Options: no
+
+// nothing to see here
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffresourcesnosnifflastasis"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-last.asis (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-last.asis                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-last.asis        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+HTTP/1.1 200 YOU HAVE NO POWER HERE
+Content-Length: 22
+Content-Type: x/x
+X-Content-Type-Options: no
+X-Content-Type-options: nosniff
+
+// nothing to see here
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffresourcesnosniffnoxasis"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-no-x.asis (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-no-x.asis                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-no-x.asis        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+HTTP/1.1 200 YOU HAVE NO POWER HERE
+Content-Length: 22
+Content-Type: x/x
+Content-Type-Options: nosniff
+
+// nothing to see here
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffresourcesnosniffquotedsingleasis"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-quoted-single.asis (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-quoted-single.asis                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-quoted-single.asis        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+HTTP/1.1 200 YOU HAVE NO POWER HERE
+Content-Length: 22
+Content-Type: x/x
+X-Content-Type-Options: 'NosniFF'
+
+// nothing to see here
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffresourcesnosniffquotedasis"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-quoted.asis (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-quoted.asis                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-quoted.asis        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+HTTP/1.1 200 YOU HAVE NO POWER HERE
+Content-Length: 22
+Content-Type: x/x
+X-Content-Type-Options: &quot;nosniFF&quot;
+
+// nothing to see here
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffresourcesnosniffuppercaseasis"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-uppercase.asis (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-uppercase.asis                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-uppercase.asis        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+HTTP/1.1 200 YOU HAVE NO POWER HERE
+Content-Length: 22
+Content-Type: x/x
+X-Content-Type-Options: NOSNIFF
+
+// nothing to see here
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffresourcesw3cimportlog"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/w3c-import.log (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/w3c-import.log                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/w3c-import.log        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,27 @@
</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/fetch/nosniff/resources/css.py
+/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/image.py
+/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/js.py
+/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-first.asis
+/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-last.asis
+/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-no-x.asis
+/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-quoted-single.asis
+/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-quoted.asis
+/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/nosniff-uppercase.asis
+/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/worker.py
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffresourcesworkerpy"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/worker.py (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/worker.py                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/resources/worker.py        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+def main(request, response):
+    type = request.GET.first(&quot;type&quot;, None)
+
+    content = &quot;// nothing to see here&quot;
+    content += &quot;\n&quot;
+    content += &quot;this.postMessage('hi')&quot;
+
+    response.add_required_headers = False
+    response.writer.write_status(200)
+    response.writer.write_header(&quot;x-content-type-options&quot;, &quot;nosniff&quot;)
+    response.writer.write_header(&quot;content-length&quot;, len(content))
+    if(type != None):
+      response.writer.write_header(&quot;content-type&quot;, type)
+    response.writer.end_headers()
+
+    response.writer.write(content)
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffscriptexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/script-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/script-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/script-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+
+FAIL URL query:  assert_unreached: Unexpected load event Reached unreachable code
+FAIL URL query: ?type= assert_unreached: Unexpected load event Reached unreachable code
+FAIL URL query: ?type=x assert_unreached: Unexpected load event Reached unreachable code
+FAIL URL query: ?type=x/x assert_unreached: Unexpected load event Reached unreachable code
+PASS URL query: ?type=text/javascript 
+PASS URL query: ?type=text/ecmascript 
+PASS URL query: ?type=text/ecmascript;blah 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffscripthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/script.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/script.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/script.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+&lt;script src=/resources/testharness.js&gt;&lt;/script&gt;
+&lt;script src=/resources/testharnessreport.js&gt;&lt;/script&gt;
+&lt;div id=log&gt;&lt;/div&gt;
+&lt;script&gt;
+  var log = function() {}, // see comment below
+      p = function() {}, // see comment below
+      fails = [&quot;&quot;, &quot;?type=&quot;, &quot;?type=x&quot;, &quot;?type=x/x&quot;],
+      passes = [&quot;?type=text/javascript&quot;, &quot;?type=text/ecmascript&quot;, &quot;?type=text/ecmascript;blah&quot;]
+
+  // Ideally we'd also check whether the scripts in fact execute, but that would involve
+  // timers and might get a bit racy without cross-browser support for the execute events.
+
+  fails.forEach(function(urlpart) {
+    async_test(function(t) {
+      var script = document.createElement(&quot;script&quot;)
+      script.onerror = t.step_func_done(function(){})
+      script.onload = t.unreached_func(&quot;Unexpected load event&quot;)
+      script.src = &quot;resources/js.py&quot; + urlpart
+      document.body.appendChild(script)
+    }, &quot;URL query: &quot; + urlpart)
+  })
+
+  passes.forEach(function(urlpart) {
+    async_test(function(t) {
+      var script = document.createElement(&quot;script&quot;)
+      script.onerror = t.unreached_func(&quot;Unexpected error event&quot;)
+      script.onload = t.step_func_done(function(){})
+      script.src = &quot;resources/js.py&quot; + urlpart + &quot;&amp;outcome=p&quot;
+      document.body.appendChild(script)
+    }, &quot;URL query: &quot; + urlpart)
+  })
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffstylesheetexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/stylesheet-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/stylesheet-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/stylesheet-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+
+FAIL URL query:  assert_unreached: Unexpected load event Reached unreachable code
+FAIL URL query: ?type= assert_unreached: Unexpected load event Reached unreachable code
+FAIL URL query: ?type=x assert_unreached: Unexpected load event Reached unreachable code
+FAIL URL query: ?type=x/x assert_unreached: Unexpected load event Reached unreachable code
+PASS URL query: ?type=text/css 
+FAIL URL query: ?type=text/css;blah assert_equals: expected 2 but got 6
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffstylesheethtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/stylesheet.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/stylesheet.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/stylesheet.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+&lt;!--  quirks mode is important, text/css is already required otherwise  --&gt;
+&lt;script src=/resources/testharness.js&gt;&lt;/script&gt;
+&lt;script src=/resources/testharnessreport.js&gt;&lt;/script&gt;
+&lt;div id=log&gt;&lt;/div&gt;
+&lt;script&gt;
+  var fails = [&quot;&quot;, &quot;?type=&quot;, &quot;?type=x&quot;, &quot;?type=x/x&quot;],
+      passes = [&quot;?type=text/css&quot;, &quot;?type=text/css;blah&quot;]
+
+  fails.forEach(function(urlpart) {
+    async_test(function(t) {
+      var link = document.createElement(&quot;link&quot;)
+      link.rel = &quot;stylesheet&quot;
+      link.onerror = t.step_func_done(function(){})
+      link.onload = t.unreached_func(&quot;Unexpected load event&quot;)
+      link.href = &quot;resources/css.py&quot; + urlpart
+      document.body.appendChild(link)
+    }, &quot;URL query: &quot; + urlpart)
+  })
+
+  passes.forEach(function(urlpart) {
+    async_test(function(t) {
+      var link = document.createElement(&quot;link&quot;)
+      link.rel = &quot;stylesheet&quot;
+      link.onerror = t.unreached_func(&quot;Unexpected error event&quot;)
+      link.onload = t.step_func_done(function(){
+        if(passes[passes.length-1] == urlpart) {
+          assert_equals(document.styleSheets.length, passes.length)
+        }
+      })
+      link.href = &quot;resources/css.py&quot; + urlpart
+      document.body.appendChild(link)
+    }, &quot;URL query: &quot; + urlpart)
+  })
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffw3cimportlog"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/w3c-import.log (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/w3c-import.log                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/w3c-import.log        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,24 @@
</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/fetch/nosniff/image.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/importscripts.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/importscripts.js
+/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/parsing-nosniff.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/script.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/stylesheet.html
+/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/worker.html
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchnosniffworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/worker.html (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/worker.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/nosniff/worker.html        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+&lt;script src=/resources/testharness.js&gt;&lt;/script&gt;
+&lt;script src=/resources/testharnessreport.js&gt;&lt;/script&gt;
+&lt;div id=log&gt;&lt;/div&gt;
+&lt;script&gt;
+  var workers = [],
+      fails = [&quot;&quot;, &quot;?type=&quot;, &quot;?type=x&quot;, &quot;?type=x/x&quot;],
+      passes = [&quot;?type=text/javascript&quot;, &quot;?type=text/ecmascript&quot;, &quot;?type=text/ecmascript;yay&quot;]
+
+  fails.forEach(function(urlpart) {
+    async_test(function(t) {
+      var w = new Worker(&quot;resources/worker.py&quot; + urlpart)
+      w.onmessage = t.unreached_func(&quot;Unexpected message event&quot;)
+      w.onerror = t.step_func_done(function(){})
+      workers.push(w) // avoid GC
+    }, &quot;URL query: &quot; + urlpart)
+  })
+
+  passes.forEach(function(urlpart) {
+    async_test(function(t) {
+      var w = new Worker(&quot;resources/worker.py&quot; + urlpart)
+      w.onmessage = t.step_func_done(function(e){
+        assert_equals(e.data, &quot;hi&quot;)
+      })
+      w.onerror = t.unreached_func(&quot;Unexpected error event&quot;)
+      workers.push(w) // avoid GC
+    }, &quot;URL query: &quot; + urlpart)
+  })
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformgtkimportedw3cwebplatformtestsfetchapiredirectredirectlocationexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+
+Harness Error (TIMEOUT), message = null
+
+PASS Redirect 301 in &quot;follow&quot; mode without location 
+PASS Redirect 301 in &quot;manual&quot; mode without location 
+PASS Redirect 301 in &quot;follow&quot; mode with invalid location 
+PASS Redirect 301 in &quot;manual&quot; mode with invalid location 
+PASS Redirect 301 in &quot;follow&quot; mode with data location 
+FAIL Redirect 301 in &quot;manual&quot; mode with data location promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+PASS Redirect 302 in &quot;follow&quot; mode without location 
+PASS Redirect 302 in &quot;manual&quot; mode without location 
+PASS Redirect 302 in &quot;follow&quot; mode with invalid location 
+PASS Redirect 302 in &quot;manual&quot; mode with invalid location 
+PASS Redirect 302 in &quot;follow&quot; mode with data location 
+FAIL Redirect 302 in &quot;manual&quot; mode with data location promise_test: Unhandled rejection with value: object &quot;TypeError: Type error&quot;
+PASS Redirect 303 in &quot;follow&quot; mode without location 
+PASS Redirect 303 in &quot;manual&quot; mode without location 
+PASS Redirect 303 in &quot;follow&quot; mode with invalid location 
+TIMEOUT Redirect 303 in &quot;manual&quot; mode with invalid location Test timed out
+TIMEOUT Redirect 303 in &quot;follow&quot; mode with data location Test timed out
+TIMEOUT Redirect 303 in &quot;manual&quot; mode with data location Test timed out
+TIMEOUT Redirect 307 in &quot;follow&quot; mode without location Test timed out
+TIMEOUT Redirect 307 in &quot;manual&quot; mode without location Test timed out
+TIMEOUT Redirect 307 in &quot;follow&quot; mode with invalid location Test timed out
+TIMEOUT Redirect 307 in &quot;manual&quot; mode with invalid location Test timed out
+TIMEOUT Redirect 307 in &quot;follow&quot; mode with data location Test timed out
+TIMEOUT Redirect 307 in &quot;manual&quot; mode with data location Test timed out
+TIMEOUT Redirect 308 in &quot;follow&quot; mode without location Test timed out
+TIMEOUT Redirect 308 in &quot;manual&quot; mode without location Test timed out
+TIMEOUT Redirect 308 in &quot;follow&quot; mode with invalid location Test timed out
+TIMEOUT Redirect 308 in &quot;manual&quot; mode with invalid location Test timed out
+TIMEOUT Redirect 308 in &quot;follow&quot; mode with data location Test timed out
+TIMEOUT Redirect 308 in &quot;manual&quot; mode with data location Test timed out
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformgtkimportedw3cwebplatformtestsfetchapiredirectredirectmethodexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+
+PASS Redirect 301 with GET 
+PASS Redirect 301 with POST 
+PASS Redirect 301 with HEAD 
+PASS Redirect 302 with GET 
+PASS Redirect 302 with POST 
+PASS Redirect 302 with HEAD 
+PASS Redirect 303 with GET 
+PASS Redirect 303 with POST 
+PASS Redirect 303 with HEAD 
+PASS Redirect 307 with GET 
+PASS Redirect 307 with POST 
+PASS Redirect 307 with HEAD 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformgtkimportedw3cwebplatformtestsfetchnosniffstylesheetexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/fetch/nosniff/stylesheet-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/fetch/nosniff/stylesheet-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/fetch/nosniff/stylesheet-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+
+FAIL URL query:  assert_unreached: Unexpected load event Reached unreachable code
+FAIL URL query: ?type= assert_unreached: Unexpected load event Reached unreachable code
+FAIL URL query: ?type=x assert_unreached: Unexpected load event Reached unreachable code
+FAIL URL query: ?type=x/x assert_unreached: Unexpected load event Reached unreachable code
+PASS URL query: ?type=text/css 
+FAIL URL query: ?type=text/css;blah assert_equals: expected 2 but got 0
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk1importedw3cwebplatformtestsfetchapicredentialsauthenticationbasicexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic-expected.txt (0 => 200195)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic-expected.txt        2016-04-28 17:12:42 UTC (rev 200195)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+http://localhost:8800/fetch/api/resources/authentication.py?realm=test - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet
+http://localhost:8800/fetch/api/resources/authentication.py?realm=test - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet
+http://localhost:8800/fetch/api/resources/authentication.py?realm=test - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet
+
+FAIL User-added Authorization header with include mode assert_equals: HTTP status is 200 expected 200 but got 401
+FAIL User-added Authorization header with same-origin mode assert_equals: HTTP status is 200 expected 200 but got 401
+FAIL User-added Authorization header with omit mode assert_equals: HTTP status is 200 expected 200 but got 401
+
</ins></span></pre>
</div>
</div>

</body>
</html>