<!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 <youenn.fablet@crf.canon.fr>
+
+ [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 <cdumez@apple.com>
</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 <youenn.fablet@crf.canon.fr>
+
+ [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 <cdumez@apple.com>
</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 "TypeError: Type error"
+PASS Cross domain basic usage [server forbid CORS]
+FAIL Cross domain basic usage [cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL Same domain different port [no-cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
+PASS Same domain different port [server forbid CORS]
+FAIL Same domain different port [cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL Cross domain different port [no-cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
+PASS Cross domain different port [server forbid CORS]
+FAIL Cross domain different port [cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL Cross domain different protocol [no-cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
+PASS Cross domain different protocol [server forbid CORS]
+FAIL Cross domain different protocol [cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL Same domain different protocol different port [no-cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
+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 "TypeError: Type error"
+
</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 "TypeError: Type error"
+PASS Cross domain basic usage [server forbid CORS]
+FAIL Cross domain basic usage [cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL Same domain different port [no-cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
+PASS Same domain different port [server forbid CORS]
+FAIL Same domain different port [cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL Cross domain different port [no-cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
+PASS Cross domain different port [server forbid CORS]
+FAIL Cross domain different port [cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL Cross domain different protocol [no-cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
+PASS Cross domain different protocol [server forbid CORS]
+FAIL Cross domain different protocol [cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL Same domain different protocol different port [no-cors mode] promise_test: Unhandled rejection with value: object "TypeError: Type error"
+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 "TypeError: Type error"
+
</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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch in worker: basic CORS</title>
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-cors-protocol">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#concept-filtered-response-cors">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#concept-cors-check">
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ fetch_tests_from_worker(new Worker("cors-basic.js?pipe=sub"));
+ </script>
+ </body>
+</html>
</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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch: basic CORS</title>
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-cors-protocol">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#concept-filtered-response-cors">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#concept-cors-check">
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script src="../resources/utils.js"></script>
+ <script src="cors-basic.js?pipe=sub"></script>
+ </body>
+</html>
</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("/resources/testharness.js");
+ importScripts("../resources/utils.js");
+}
+
+function cors(desc, scheme, subdomain, port) {
+ if (!port)
+ port = location.port;
+ if (subdomain)
+ subdomain = subdomain + ".";
+ else
+ subdomain = "";
+
+ var url = scheme + "://" + subdomain + "{{host}}" + ":" + port + dirname(location.pathname);
+ var urlParameters = "?pipe=header(Access-Control-Allow-Origin,*)";
+
+ promise_test(function(test) {
+ return fetch(url + RESOURCES_DIR + "top.txt" + urlParameters, {"mode": "no-cors"} ).then(function(resp) {
+ assert_equals(resp.status, 0, "Opaque filter: status is 0");
+ assert_equals(resp.statusText, "", "Opaque filter: statusText is \"\"");
+ assert_equals(resp.type , "opaque", "Opaque filter: response's type is opaque");
+ });
+ }, desc + " [no-cors mode]");
+
+ promise_test(function(test) {
+ var testedPromise = fetch(url + RESOURCES_DIR + "top.txt", {"mode": "cors"} ).then(function(resp) {
+ return promise_rejects(test, new TypeError(), testedPromise);
+ });
+ }, desc + " [server forbid CORS]");
+
+ promise_test(function(test) {
+ return fetch(url + RESOURCES_DIR + "top.txt" + urlParameters, {"mode": "cors"} ).then(function(resp) {
+ assert_equals(resp.status, 200, "Fetch's response's status is 200");
+ assert_equals(resp.type , "cors", "CORS response's type is cors");
+ });
+ }, desc + " [cors mode]");
+}
+
+cors("Cross domain basic usage", "http", "www1");
+cors("Same domain different port", "http", undefined, "{{ports[http][1]}}");
+cors("Cross domain different port", "http", "www1", "{{ports[http][1]}}");
+cors("Cross domain different protocol", "https", "www1", "{{ports[https][0]}}");
+cors("Same domain different protocol different port", "https", undefined, "{{ports[https][0]}}");
+
+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 "TypeError: Type error"
+FAIL Include mode: local cookies are not sent with remote request promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL Include mode: remote cookies are not sent with local request promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL Include mode: remote cookies are not sent with other remote request promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL Same-origin mode: cookies are discarded in cors request promise_test: Unhandled rejection with value: object "TypeError: Type error"
+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 "TypeError: Type error"
+FAIL Include mode: local cookies are not sent with remote request promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL Include mode: remote cookies are not sent with local request promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL Include mode: remote cookies are not sent with other remote request promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL Same-origin mode: cookies are discarded in cors request promise_test: Unhandled rejection with value: object "TypeError: Type error"
+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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch in worker: cookies management for cors requests</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-network-fetch">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ fetch_tests_from_worker(new Worker("cors-cookies.js?pipe=sub"));
+ </script>
+ </body>
+</html>
</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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch: cookies management for cors requests</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-network-fetch">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script src="../resources/utils.js"></script>
+ <script src="cors-cookies.js?pipe=sub"></script>
+ </body>
+</html>
</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("/resources/testharness.js");
+ importScripts("../resources/utils.js");
+}
+
+function corsCookies(desc, domain1, domain2, credentialsMode, cookies) {
+ var urlSetCookie = "http://" + domain1 + ":{{ports[http][0]}}" + dirname(location.pathname) + RESOURCES_DIR + "top.txt";
+ var urlCheckCookies = "http://" + domain2 + ":{{ports[http][0]}}" + dirname(location.pathname) + RESOURCES_DIR + "inspect-headers.py?cors&headers=cookie";
+ //enable cors with credentials
+ var urlParameters = "?pipe=header(Access-Control-Allow-Origin," + location.origin + ")";
+ urlParameters += "|header(Access-Control-Allow-Credentials,true)";
+
+ var urlCleanParameters = "?pipe=header(Access-Control-Allow-Origin," + location.origin + ")";
+ urlCleanParameters += "|header(Access-Control-Allow-Credentials,true)";
+ if (cookies) {
+ urlParameters += "|header(Set-Cookie,";
+ urlParameters += cookies.join(",True)|header(Set-Cookie,") + ",True)";
+ urlCleanParameters += "|header(Set-Cookie,";
+ urlCleanParameters += cookies.join("%3B%20max-age=0,True)|header(Set-Cookie,") + "%3B%20max-age=0,True)";
+ }
+
+ var requestInit = {"credentials": credentialsMode, "mode": "cors"};
+
+ promise_test(function(test){
+ return fetch(urlSetCookie + urlParameters, requestInit).then(function(resp) {
+ assert_equals(resp.status, 200, "HTTP status is 200");
+ //check cookies sent
+ return fetch(urlCheckCookies, requestInit);
+ }).then(function(resp) {
+ assert_equals(resp.status, 200, "HTTP status is 200");
+ assert_false(resp.headers.has("Cookie") , "Cookie header is not exposed in response");
+ if (credentialsMode === "include" && domain1 === domain2) {
+ assert_equals(resp.headers.get("x-request-cookie") , cookies.join("; "), "Request includes cookie(s)");
+ }
+ else {
+ assert_false(resp.headers.has("x-request-cookie") , "Request should have no cookie");
+ }
+ //clean cookies
+ return fetch(urlSetCookie + urlCleanParameters, {"credentials": "include"});
+ }).catch(function(e) {
+ fetch(urlSetCookie + urlCleanParameters, {"credentials": "include"});
+ throw e;
+ });
+ }, desc);
+}
+
+var local = "{{host}}";
+var remote = "www.{{host}}";
+var remote1 = "www1.{{host}}";
+
+corsCookies("Include mode: 1 cookie", remote, remote, "include", ["a=1"]);
+corsCookies("Include mode: local cookies are not sent with remote request", local, remote, "include", ["c=3"]);
+corsCookies("Include mode: remote cookies are not sent with local request", remote, local, "include", ["d=4"]);
+corsCookies("Include mode: remote cookies are not sent with other remote request", remote, remote1, "include", ["e=5"]);
+corsCookies("Same-origin mode: cookies are discarded in cors request", remote, remote, "same-origin", ["f=6"]);
+corsCookies("Omit mode: no cookie sent", local, local, "omit", ["g=7"]);
+
+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 "TypeError: Type error"
+FAIL CORS filter on Content-Language header promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Content-Type header promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Expires header promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Last-Modified header promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Pragma header promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Age header promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Server header promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Warning header promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Content-Length header promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Set-Cookie header promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Set-Cookie2 header promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Age header, header is exposed promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Server header, header is exposed promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Warning header, header is exposed promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Content-Length header, header is exposed promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Set-Cookie header, header is exposed promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Set-Cookie2 header, header is exposed promise_test: Unhandled rejection with value: object "TypeError: Type error"
+
</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 "TypeError: Type error"
+FAIL CORS filter on Content-Language header promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Content-Type header promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Expires header promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Last-Modified header promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Pragma header promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Age header promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Server header promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Warning header promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Content-Length header promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Set-Cookie header promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Set-Cookie2 header promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Age header, header is exposed promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Server header, header is exposed promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Warning header, header is exposed promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Content-Length header, header is exposed promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Set-Cookie header, header is exposed promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL CORS filter on Set-Cookie2 header, header is exposed promise_test: Unhandled rejection with value: object "TypeError: Type error"
+
</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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch in worker: filtered headers in CORS response</title>
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-cors-protocol">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#concept-filtered-response-cors">
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ fetch_tests_from_worker(new Worker("cors-filtering.js?pipe=sub"));
+ </script>
+ </body>
+</html>
</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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch: filtered headers in CORS response</title>
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-cors-protocol">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#concept-filtered-response-cors">
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script src="../resources/utils.js"></script>
+ <script src="cors-filtering.js?pipe=sub"></script>
+ </body>
+</html>
</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("/resources/testharness.js");
+ importScripts("../resources/utils.js");
+}
+
+function corsFilter(corsUrl, headerName, headerValue, isFiltered) {
+ var url = corsUrl + "?pipe=header(" + headerName + "," + encodeURIComponent(headerValue) +")|header(Access-Control-Allow-Origin,*)";
+ promise_test(function(test) {
+ return fetch(url).then(function(resp) {
+ assert_equals(resp.status, 200, "Fetch success with code 200");
+ assert_equals(resp.type , "cors", "CORS fetch's response has cors type");
+ if (!isFiltered) {
+ assert_equals(resp.headers.get(headerName), headerValue,
+ headerName + " header should be included in response with value: " + headerValue);
+ } else {
+ assert_false(resp.headers.has(headerName), "UA should exclude " + headerName + " header from response");
+ }
+ test.done();
+ });
+ }, "CORS filter on " + headerName + " header");
+}
+
+function corsExposeFilter(corsUrl, headerName, headerValue, isForbidden) {
+ var url = corsUrl + "?pipe=header(" + headerName + "," + encodeURIComponent(headerValue) +")|" +
+ "header(Access-Control-Allow-Origin,*)" +
+ "header(Access-Control-Expose-Headers," + headerName + ")";
+
+ promise_test(function(test) {
+ return fetch(url).then(function(resp) {
+ assert_equals(resp.status, 200, "Fetch success with code 200");
+ assert_equals(resp.type , "cors", "CORS fetch's response has cors type");
+ if (!isForbidden) {
+ assert_equals(resp.headers.get(headerName), headerValue,
+ headerName + " header should be included in response with value: " + headerValue);
+ } else {
+ assert_false(resp.headers.has(headerName), "UA should exclude " + headerName + " header from response");
+ }
+ test.done();
+ });
+ }, "CORS filter on " + headerName + " header, header is exposed");
+}
+
+var url = "http://www1.{{host}}:{{ports[http][1]}}" + dirname(location.pathname) + RESOURCES_DIR + "top.txt";
+
+corsFilter(url, "Cache-Control", "no-cache", false);
+corsFilter(url, "Content-Language", "fr", false);
+corsFilter(url, "Content-Type", "text/html", false);
+corsFilter(url, "Expires","04 May 1988 22:22:22 GMT" , false);
+corsFilter(url, "Last-Modified", "04 May 1988 22:22:22 GMT", false);
+corsFilter(url, "Pragma", "no-cache", false);
+
+corsFilter(url, "Age", "27", true);
+corsFilter(url, "Server", "wptServe" , true);
+corsFilter(url, "Warning", "Mind the gap" , true);
+corsFilter(url, "Content-Length", "0" , true);
+corsFilter(url, "Set-Cookie", "name=value" , true);
+corsFilter(url, "Set-Cookie2", "name=value" , true);
+
+corsExposeFilter(url, "Age", "27", false);
+corsExposeFilter(url, "Server", "wptServe" , false);
+corsExposeFilter(url, "Warning", "Mind the gap" , false);
+corsExposeFilter(url, "Content-Length", "0" , false);
+corsExposeFilter(url, "Set-Cookie", "name=value" , true);
+corsExposeFilter(url, "Set-Cookie2", "name=value" , 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 "TypeError: Type error"
+FAIL 3 origins allowed, match the 3rd ("*") promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL 3 origins allowed, match twice (http://localhost:8800) promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL 3 origins allowed, match twice ("*") promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL 3 origins allowed, match twice ("*" and http://localhost:8800) promise_test: Unhandled rejection with value: object "TypeError: Type error"
+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 "TypeError: Type error"
+FAIL 3 origins allowed, match the 3rd ("*") promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL 3 origins allowed, match twice (http://localhost:8800) promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL 3 origins allowed, match twice ("*") promise_test: Unhandled rejection with value: object "TypeError: Type error"
+FAIL 3 origins allowed, match twice ("*" and http://localhost:8800) promise_test: Unhandled rejection with value: object "TypeError: Type error"
+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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch in worker: check multiple Access-Control-Allow-Origin header management</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-cors-protocol">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#cors-check">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ fetch_tests_from_worker(new Worker("cors-multiple-origins.js?pipe=sub"));
+ </script>
+ </body>
+</html>
</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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch: check multiple Access-Control-Allow-Origin header management</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-cors-protocol">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#cors-check">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script src="../resources/utils.js"></script>
+ <script src="cors-multiple-origins.js?pipe=sub"></script>
+ </body>
+</html>
</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("/resources/testharness.js");
+ importScripts("../resources/utils.js");
+}
+
+function corsMultipleOrigins(desc, originList, shouldPass) {
+ var urlParameters = "?origin=" + encodeURIComponent(originList.join(", "));
+ var url = "http://www1.{{host}}:{{ports[http][0]}}" + dirname(location.pathname) + RESOURCES_DIR + "preflight.py";
+
+ if (shouldPass) {
+ promise_test(function(test) {
+ return fetch(url + urlParameters).then(function(resp) {
+ assert_equals(resp.status, 200, "Response's status is 200");
+ });
+ }, desc);
+ } else {
+ promise_test(function(test) {
+ return promise_rejects(test, new TypeError(), fetch(url + urlParameters));
+ }, desc);
+ }
+}
+/* Actual origin */
+var origin = "http://{{host}}:{{ports[http][0]}}";
+
+corsMultipleOrigins("3 origins allowed, match the 3rd (" + origin + ")", ["\"\"", "http://example.com", origin], true);
+corsMultipleOrigins("3 origins allowed, match the 3rd (\"*\")", ["\"\"", "http://example.com", "*"], true);
+corsMultipleOrigins("3 origins allowed, match twice (" + origin + ")", ["\"\"", origin, origin], true);
+corsMultipleOrigins("3 origins allowed, match twice (\"*\")", ["*", "http://example.com", "*"], true);
+corsMultipleOrigins("3 origins allowed, match twice (\"*\" and " + origin + ")", ["*", "http://example.com", origin], true);
+corsMultipleOrigins("3 origins allowed, no match", ["", "http://example.com", "https://example2.com"], 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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch in worker: CORS request with simple methods and headers</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-cors-protocol">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#simple-method">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#simple-header">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ fetch_tests_from_worker(new Worker("cors-no-preflight.js?pipe=sub"));
+ </script>
+ </body>
+</html>
</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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch: CORS request with simple methods and headers</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-cors-protocol">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#simple-method">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#simple-header">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script src="/common/utils.js"></script>
+ <script src="../resources/utils.js"></script>
+ <script src="cors-no-preflight.js?pipe=sub"></script>
+ </body>
+</html>
</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("/resources/testharness.js");
+ importScripts("/common/utils.js");
+ importScripts("../resources/utils.js");
+}
+
+function corsNoPreflight(desc, scheme, subdomain, port, method, headerName, headerValue) {
+ if (!port)
+ port = location.port;
+ if (subdomain)
+ subdomain = subdomain + ".";
+ else
+ subdomain = "";
+
+ var uuid_token = token();
+ var url = scheme + "://" + subdomain + "{{host}}" + ":" + port + dirname(location.pathname) + RESOURCES_DIR + "preflight.py";
+ var urlParameters = "?token=" + uuid_token + "&max_age=0";
+ var requestInit = {"mode": "cors", "method": method, "headers":{}};
+ if (headerName)
+ requestInit["headers"][headerName] = headerValue;
+
+ promise_test(function(test) {
+ fetch(RESOURCES_DIR + "clean-stash.py?token=" + uuid_token).then(function(resp) {
+ assert_equals(resp.status, 200, "Clean stash response's status is 200");
+ return fetch(url + urlParameters, requestInit).then(function(resp) {
+ assert_equals(resp.status, 200, "Response's status is 200");
+ assert_equals(resp.headers.get("x-did-preflight"), "0", "No preflight request has been made");
+ });
+ });
+ }, desc);
+}
+var port2 = "{{ports[http][1]}}";
+var httpsPort = "{{ports[https][0]}}";
+
+corsNoPreflight("Cross domain basic usage [GET]", "http", "www1", undefined, "GET");
+corsNoPreflight("Same domain different port [GET]", "http", undefined, port2, "GET");
+corsNoPreflight("Cross domain different port [GET]", "http", "www1", port2, "GET");
+corsNoPreflight("Cross domain different protocol [GET]", "https", "www1", httpsPort, "GET");
+corsNoPreflight("Same domain different protocol different port [GET]", "https", undefined, httpsPort, "GET");
+corsNoPreflight("Cross domain [POST]", "http", "www1", undefined, "POST");
+corsNoPreflight("Cross domain [HEAD]", "http", "www1", undefined, "HEAD");
+corsNoPreflight("Cross domain [GET] [Accept: */*]", "http", "www1", undefined, "GET" , "Accept", "*/*");
+corsNoPreflight("Cross domain [GET] [Accept-Language: fr]", "http", "www1", undefined, "GET" , "Accept-Language", "fr");
+corsNoPreflight("Cross domain [GET] [Content-Language: fr]", "http", "www1", undefined, "GET" , "Content-Language", "fr");
+corsNoPreflight("Cross domain [GET] [Content-Type: application/x-www-form-urlencoded]", "http", "www1", undefined, "GET" , "Content-Type", "application/x-www-form-urlencoded");
+corsNoPreflight("Cross domain [GET] [Content-Type: multipart/form-data]", "http", "www1", undefined, "GET" , "Content-Type", "multipart/form-data");
+corsNoPreflight("Cross domain [GET] [Content-Type: text/plain]", "http", "www1", undefined, "GET" , "Content-Type", "text/plain");
+corsNoPreflight("Cross domain [GET] [Content-Type: text/plain;charset=utf-8]", "http", "www1", undefined, "GET" , "Content-Type", "text/plain;charset=utf-8");
+
+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: "" [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: "" [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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch in worker: check Access-Control-Allow-Origin header management</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-cors-protocol">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#cors-check">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ fetch_tests_from_worker(new Worker("cors-origin.js?pipe=sub"));
+ </script>
+ </body>
+</html>
</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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch: check Access-Control-Allow-Origin header management</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-cors-protocol">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#cors-check">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script src="/common/utils.js"></script>
+ <script src="../resources/utils.js"></script>
+ <script src="cors-origin.js?pipe=sub"></script>
+ </body>
+</html>
</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("/resources/testharness.js");
+ importScripts("../resources/utils.js");
+ importScripts("/common/utils.js");
+}
+
+/* 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 + ".";
+ else
+ subdomain = "";
+ if (!origin)
+ origin = scheme + "://" + subdomain + "{{host}}" + ":" + port;
+
+ var uuid_token = token();
+ var urlParameters = "?token=" + uuid_token + "&max_age=0&origin=" + encodeURIComponent(origin) + "&allow_methods=" + method;
+ var url = scheme + "://" + subdomain + "{{host}}" + ":" + port + dirname(location.pathname) + RESOURCES_DIR + "preflight.py";
+ var requestInit = {"mode": "cors", "method": method};
+
+ promise_test(function(test) {
+ fetch(RESOURCES_DIR + "clean-stash.py?token=" + uuid_token).then(function(resp) {
+ assert_equals(resp.status, 200, "Clean stash response's status is 200");
+ if (shouldPass) {
+ return fetch(url + urlParameters, requestInit).then(function(resp) {
+ assert_equals(resp.status, 200, "Response's status is 200");
+ });
+ } else {
+ return promise_rejects(test, new TypeError(), fetch(url + urlParameters, requestInit));
+ }
+ });
+ }, desc);
+
+}
+var port = "{{ports[http][0]}}";
+var port2 = "{{ports[http][1]}}";
+var httpsPort = "{{ports[https][0]}}";
+/* Actual origin */
+var origin = "http://{{host}}:{{ports[http][0]}}";
+
+corsOrigin("Cross domain different subdomain [origin OK]", "http", "www1", undefined, "GET", origin, true);
+corsOrigin("Cross domain different subdomain [origin KO]", "http", "www1", undefined, "GET", undefined, false);
+corsOrigin("Same domain different port [origin OK]", "http", undefined, port2, "GET", origin, true);
+corsOrigin("Same domain different port [origin KO]", "http", undefined, port2, "GET", undefined, false);
+corsOrigin("Cross domain different port [origin OK]", "http", "www1", port2, "GET", origin, true);
+corsOrigin("Cross domain different port [origin KO]", "http", "www1", port2, "GET", undefined, false);
+corsOrigin("Cross domain different protocol [origin OK]", "https", "www1", httpsPort, "GET", origin, true);
+corsOrigin("Cross domain different protocol [origin KO]", "https", "www1", httpsPort, "GET", undefined, false);
+corsOrigin("Same domain different protocol different port [origin OK]", "https", undefined, httpsPort, "GET", origin, true);
+corsOrigin("Same domain different protocol different port [origin KO]", "https", undefined, httpsPort, "GET", undefined, false);
+corsOrigin("Cross domain [POST] [origin OK]", "http", "www1", undefined, "POST", origin, true);
+corsOrigin("Cross domain [POST] [origin KO]", "http", "www1", undefined, "POST", undefined, false);
+corsOrigin("Cross domain [HEAD] [origin OK]", "http", "www1", undefined, "HEAD", origin, true);
+corsOrigin("Cross domain [HEAD] [origin KO]", "http", "www1", undefined, "HEAD", undefined, false);
+corsOrigin("CORS preflight [PUT] [origin OK]", "http", "www1", undefined, "PUT", origin, true);
+corsOrigin("CORS preflight [PUT] [origin KO]", "http", "www1", undefined, "PUT", undefined, false);
+corsOrigin("Allowed origin: \"\" [origin KO]", "http", "www1", undefined, "GET", "" , 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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch in worker: redirection handling for cors with preflight</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-cors-protocol">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-fetch">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ fetch_tests_from_worker(new Worker("cors-preflight-redirect.js?pipe=sub"));
+ </script>
+ </body>
+</html>
</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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch: redirection handling for cors with preflight</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-cors-protocol">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-fetch">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script src="/common/utils.js"></script>
+ <script src="../resources/utils.js"></script>
+ <script src="cors-preflight-redirect.js?pipe=sub"></script>
+ </body>
+</html>
</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("/resources/testharness.js");
+ importScripts("../resources/utils.js");
+ importScripts("/common/utils.js");
+}
+
+function corsPreflightRedirect(desc, redirectUrl, redirectLocation, redirectStatus, redirectPreflight) {
+ var uuid_token = token();
+ var url = redirectUrl;
+ var urlParameters = "?token=" + uuid_token + "&max_age=0";
+ urlParameters += "&redirect_status=" + redirectStatus;
+ urlParameters += "&location=" + encodeURIComponent(redirectLocation);
+
+ if (redirectPreflight)
+ urlParameters += "&redirect_preflight";
+ var requestInit = {"mode": "cors", "redirect": "follow"};
+
+ /* Force preflight */
+ requestInit["headers"] = {"x-force-preflight": ""};
+ urlParameters += "&allow_headers=x-force-preflight";
+
+ promise_test(function(test) {
+ fetch(RESOURCES_DIR + "clean-stash.py?token=" + uuid_token).then(function(resp) {
+ assert_equals(resp.status, 200, "Clean stash response's status is 200");
+ return promise_rejects(test, new TypeError(), fetch(url + urlParameters, requestInit));
+ });
+ }, desc);
+}
+
+var redirectUrl = "http://www1.{{host}}:{{ports[http][0]}}" + dirname(location.pathname) + RESOURCES_DIR + "redirect.py";
+var locationUrl = "http://www1.{{host}}:{{ports[http][0]}}" + dirname(location.pathname) + RESOURCES_DIR + "preflight.py";
+
+for (var code of [301, 302, 303, 307, 308]) {
+ /* preflight should not follow the redirection */
+ corsPreflightRedirect("Redirection " + code + " on preflight failed", redirectUrl, locationUrl, code, true);
+ /* preflight is done before redirection: preflight force redirect to error */
+ corsPreflightRedirect("Redirection " + code + " after preflight failed", 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: ""
+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: ""
+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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch in worker: Referer header management in CORS request with preflight</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#cors-preflight-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-network-or-cache-fetch">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ fetch_tests_from_worker(new Worker("cors-preflight-referrer.js?pipe=sub"));
+ </script>
+ </body>
+</html>
</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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch: Referer header management in CORS request with preflight</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#cors-preflight-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-network-or-cache-fetch">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script src="/common/utils.js"></script>
+ <script src="../resources/utils.js"></script>
+ <script src="cors-preflight-referrer.js?pipe=sub"></script>
+ </body>
+</html>
</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("/resources/testharness.js");
+ importScripts("/common/utils.js");
+ importScripts("../resources/utils.js");
+}
+
+function corsPreflightReferrer(desc, corsUrl, referrerPolicy, expectedReferrer) {
+ var uuid_token = token();
+ var url = corsUrl;
+ var urlParameters = "?token=" + uuid_token + "&max_age=0";
+ var requestInit = {"mode": "cors", "referrerPolicy": referrerPolicy};
+
+ /* Force preflight */
+ requestInit["headers"] = {"x-force-preflight": ""};
+ urlParameters += "&allow_headers=x-force-preflight";
+
+ promise_test(function(test) {
+ fetch(RESOURCES_DIR + "clean-stash.py?token=" + uuid_token).then(function(resp) {
+ assert_equals(resp.status, 200, "Clean stash response's status is 200");
+ return fetch(url + urlParameters, requestInit).then(function(resp) {
+ assert_equals(resp.status, 200, "Response's status is 200");
+ assert_equals(resp.headers.get("x-did-preflight"), "1", "Preflight request has been made");
+ assert_equals(resp.headers.get("x-preflight-referrer"), expectedReferrer, "Preflight's referrer is correct");
+ assert_equals(resp.headers.get("x-referrer"), expectedReferrer, "Request's refferer is correct");
+ });
+ });
+ }, desc);
+}
+
+var corsUrl = "http://www1.{{host}}:{{ports[http][0]}}" + dirname(location.pathname) + RESOURCES_DIR + "preflight.py";
+var origin = "http://{{host}}:{{ports[http][0]}}";
+
+corsPreflightReferrer("Referrer policy: no-referrer", corsUrl, "no-referrer", "");
+corsPreflightReferrer("Referrer policy: \"\"", corsUrl, "", "");
+corsPreflightReferrer("Referrer policy: origin-only", corsUrl, "origin-only", origin);
+corsPreflightReferrer("Referrer policy: origin-when-cross-origin", corsUrl, "origin-when-cross-origin", origin);
+corsPreflightReferrer("Referrer policy: unsafe-url", corsUrl, "unsafe-url", 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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch in worker: preflight status code handling</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#cors-preflight-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-network-or-cache-fetch">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ fetch_tests_from_worker(new Worker("cors-preflight-status.js?pipe=sub"));
+ </script>
+ </body>
+</html>
</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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch: preflight status code handling</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#cors-preflight-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-network-or-cache-fetch">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script src="/common/utils.js"></script>
+ <script src="../resources/utils.js"></script>
+ <script src="cors-preflight-status.js?pipe=sub"></script>
+ </body>
+</html>
</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("/resources/testharness.js");
+ importScripts("../resources/utils.js");
+ importScripts("/common/utils.js");
+}
+
+/* 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 = {"mode": "cors"};
+ /* Force preflight */
+ requestInit["headers"] = {"x-force-preflight": ""};
+
+ var urlParameters = "?token=" + uuid_token + "&max_age=0";
+ urlParameters += "&allow_headers=x-force-preflight";
+ urlParameters += "&preflight_status=" + preflightStatus;
+
+ promise_test(function(test) {
+ fetch(RESOURCES_DIR + "clean-stash.py?token=" + uuid_token).then(function(resp) {
+ assert_equals(resp.status, 200, "Clean stash response's status is 200");
+ if (200 <= preflightStatus && 299 >= preflightStatus) {
+ return fetch(url + urlParameters, requestInit).then(function(resp) {
+ assert_equals(resp.status, 200, "Response's status is 200");
+ assert_equals(resp.headers.get("x-did-preflight"), "1", "Preflight request has been made");
+ });
+ } else {
+ return promise_rejects(test, new TypeError(), fetch(url + urlParameters, requestInit));
+ }
+ });
+ }, desc);
+}
+
+var corsUrl = "http://www1.{{host}}:{{ports[http][0]}}" + dirname(location.pathname) + RESOURCES_DIR + "preflight.py";
+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("Preflight answered with status " + 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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch in worker: Check cors fetches requiring prefligh</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-cors-protocol">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#simple-method">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#simple-header">
+ </head>
+ <body>
+ <script>
+ fetch_tests_from_worker(new Worker("cors-preflight.js?pipe=sub"));
+ </script>
+ </body>
+</html>
</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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch: Check cors fetches requiring preflight</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-cors-protocol">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#simple-method">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#simple-header">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script src="../resources/utils.js"></script>
+ <script src="/common/utils.js"></script>
+ <script src="cors-preflight.js?pipe=sub"></script>
+ </body>
+</html>
</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("/resources/testharness.js");
+ importScripts("../resources/utils.js");
+ importScripts("/common/utils.js");
+}
+
+/*
+ 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 + "clean-stash.py?token=" + uuid_token).then(function(response) {
+
+ var url = corsUrl;
+ var urlParameters = "?token=" + uuid_token + "&max_age=0";
+ var requestInit = {"mode": "cors", "method": method};
+ if (headers)
+ requestInit["headers"] = headers;
+
+ if (allowed) {
+ urlParameters += "&allow_methods=" + method;
+ if (headers) {
+ //Let's check prefligh request.
+ //Server will send back headers from Access-Control-Request-Headers in x-control-request-headers
+ urlParameters += "&control_request_headers"
+ //Make the server allow the headers
+ urlParameters += "&allow_headers="
+ urlParameters += headers.join("%2C%20");
+ }
+ promise_test(function(test) {
+ test.add_cleanup(function() {
+ fetch(RESOURCES_DIR + "clean-stash.py?token=" + uuid_token);
+ });
+ return fetch(url + urlParameters, requestInit).then(function(resp) {
+ assert_equals(resp.status, 200, "Response's status is 200");
+ assert_equals(resp.headers.get("x-did-preflight"), "1", "Preflight request has been made");
+ if (headers) {
+ var actualHeaders = resp.headers.get("x-control-request-headers").split(",");
+ for (var i in actualHeaders)
+ actualHeaders[i] = actualHeaders[i].trim();
+ for (var header in headers)
+ assert_in_array(header, actualHeaders, "Preflight asked permission for header: " + header);
+ }
+ });
+ }, desc);
+ } else {
+ promise_test(function(test) {
+ test.add_cleanup(function() {
+ fetch(RESOURCES_DIR + "clean-stash.py?token=" + uuid_token);
+ });
+ return promise_rejects(test, new TypeError(), fetch(url + urlParameters, requestInit));
+ }, desc);
+ }
+ });
+}
+
+var corsUrl = "http://www1.{{host}}:{{ports[http][0]}}" + dirname(location.pathname) + RESOURCES_DIR + "preflight.py";
+
+//corsPreflight("CORS [DELETE], server allows", corsUrl, "DELETE", true);
+//corsPreflight("CORS [DELETE], server refuses", corsUrl, "DELETE", false);
+//corsPreflight("CORS [PUT], server allows", corsUrl, "PUT", true);
+//corsPreflight("CORS [PUT], server refuses", corsUrl, "PUT", false);
+//corsPreflight("CORS [PATCH], server allows", corsUrl, "PATCH", true);
+//corsPreflight("CORS [PATCH], server refuses", corsUrl, "PATCH", false);
+//corsPreflight("CORS [NEW], server allows", corsUrl, "NEW", true);
+//corsPreflight("CORS [NEW], server refuses", corsUrl, "NEW", false);
+//
+//corsPreflight("CORS [GET] [x-test-header: allowed], server allows", corsUrl, "GET", true, {"x-test-header1": "allowed"});
+//corsPreflight("CORS [GET] [x-test-header: refused], server refuses", corsUrl, "GET", false, {"x-test-header1": "refused"});
+//
+var headers = {"x-test-header1": "allowedOrRefused",
+ "x-test-header2": "allowedOrRefused",
+ "x-test-header3": "allowedOrRefused",
+};
+//corsPreflight("CORS [GET] [several headers], server allows", corsUrl, "GET", true, headers);
+//corsPreflight("CORS [GET] [several headers], server refuses", corsUrl, "GET", false, headers);
+//corsPreflight("CORS [PUT] [several headers], server allows", corsUrl, "PUT", true, headers);
+corsPreflight("CORS [PUT] [several headers], server refuses", corsUrl, "PUT", 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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch in worker: redirection url has credentials</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-fetch">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ fetch_tests_from_worker(new Worker("cors-redirect-credentials.js"));
+ </script>
+ </body>
+</html>
</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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch: redirection url has credentials</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-fetch">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script src="../resources/utils.js"></script>
+ <script src="cors-redirect-credentials.js?pipe=sub"></script>
+ </body>
+</html>
</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("/resources/testharness.js");
+ importScripts("../resources/utils.js");
+}
+
+function corsRedirectCredentials(desc, redirectUrl, redirectLocation, redirectStatus, locationCredentials) {
+
+ var url = redirectUrl
+ var urlParameters = "?redirect_status=" + redirectStatus;
+ urlParameters += "&location=" + encodeURIComponent(redirectLocation.replace("://", "://" + locationCredentials + "@"));
+
+ var requestInit = {"mode": "cors", "redirect": "follow", "credentials":"include"};
+
+ promise_test(function(test) {
+ return promise_rejects(test, new TypeError(), fetch(url + urlParameters, requestInit));
+ }, desc);
+}
+
+var redirPath = dirname(location.pathname) + RESOURCES_DIR + "redirect.py";
+var preflightPath = dirname(location.pathname) + RESOURCES_DIR + "preflight.py";
+
+var localRedirect = "http://{{host}}:{{ports[http][0]}}" + redirPath;
+var remoteRedirect = "http://www1.{{host}}:{{ports[http][0]}}" + redirPath;
+
+var localLocation = "http://{{host}}:{{ports[http][0]}}" + preflightPath;
+var remoteLocation = "http://www1.{{host}}:{{ports[http][0]}}" + preflightPath;
+var remoteLocation2 = "http://www.{{host}}:{{ports[http][0]}}" + preflightPath;
+
+for (var code of [301, 302, 303, 307, 308]) {
+ corsRedirectCredentials("Redirect " + code + " from same origin to remote with user and password", localRedirect, remoteLocation, code, "user:password");
+ corsRedirectCredentials("Redirect " + code + " from same origin to remote with user", localRedirect, remoteLocation, code, "user:");
+ corsRedirectCredentials("Redirect " + code + " from same origin to remote with password", localRedirect, remoteLocation, code, ":password");
+
+ corsRedirectCredentials("Redirect " + code + " from remote to same origin with user and password", remoteRedirect, localLocation, code, "user:password");
+ corsRedirectCredentials("Redirect " + code + " from remote to same origin with user", remoteRedirect, localLocation, code, "user:");
+ corsRedirectCredentials("Redirect " + code + " from remote to same origin with password", remoteRedirect, localLocation, code, ":password");
+
+ corsRedirectCredentials("Redirect " + code + " from remote to another remote with user and password", remoteRedirect, remoteLocation2, code, "user:password");
+ corsRedirectCredentials("Redirect " + code + " from remote to another remote with user", remoteRedirect, remoteLocation2, code, "user:");
+ corsRedirectCredentials("Redirect " + code + " from remote to another remote with password", remoteRedirect, remoteLocation2, code, ":password");
+
+ corsRedirectCredentials("Redirect " + code + " from remote to same remote with user and password", remoteRedirect, remoteLocation, code, "user:password");
+ corsRedirectCredentials("Redirect " + code + " from remote to same remote with user", remoteRedirect, remoteLocation, code, "user:");
+ corsRedirectCredentials("Redirect " + code + " from remote to same remote with password", remoteRedirect, remoteLocation, code, ":password");
+}
+
+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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch in worker: CORS Redirection with several origins</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-network-or-cache-fetch">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ fetch_tests_from_worker(new Worker("cors-redirect.js?pipe=sub"));
+ </script>
+ </body>
+</html>
</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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch: CORS Redirection with several origins</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-network-or-cache-fetch">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script src="/common/utils.js"></script>
+ <script src="../resources/utils.js"></script>
+ <script src="cors-redirect.js?pipe=sub"></script>
+ </body>
+</html>
</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("/resources/testharness.js");
+ importScripts("/common/utils.js");
+ importScripts("../resources/utils.js");
+}
+
+function corsRedirect(desc, redirectUrl, redirectLocation, redirectStatus, expectedOrigin) {
+ var uuid_token = token();
+ var url = redirectUrl;
+ var urlParameters = "?token=" + uuid_token + "&max_age=0";
+ urlParameters += "&redirect_status=" + redirectStatus;
+ urlParameters += "&location=" + encodeURIComponent(redirectLocation);
+
+ var requestInit = {"mode": "cors", "redirect": "follow"};
+
+ promise_test(function(test) {
+ fetch(RESOURCES_DIR + "clean-stash.py?token=" + uuid_token).then(function(resp) {
+ return fetch(url + urlParameters, requestInit).then(function(resp) {
+ assert_equals(resp.status, 200, "Response's status is 200");
+ assert_equals(resp.headers.get("x-did-preflight"), "0", "No preflight request has been made");
+ assert_equals(resp.headers.get("x-origin"), expectedOrigin, "Origin is correctly set after redirect");
+ });
+ });
+ }, desc);
+}
+
+var redirPath = dirname(location.pathname) + RESOURCES_DIR + "redirect.py";
+var preflightPath = dirname(location.pathname) + RESOURCES_DIR + "preflight.py";
+
+var localRedirect = "http://{{host}}:{{ports[http][0]}}" + redirPath;
+var remoteRedirect = "http://www1.{{host}}:{{ports[http][0]}}" + redirPath;
+
+var localLocation = "http://{{host}}:{{ports[http][0]}}" + preflightPath;
+var remoteLocation = "http://www1.{{host}}:{{ports[http][0]}}" + preflightPath;
+var remoteLocation2 = "http://www.{{host}}:{{ports[http][0]}}" + preflightPath;
+
+for (var code of [301, 302, 303, 307, 308]) {
+ corsRedirect("Redirect " + code + ": cors to same cors", remoteRedirect, remoteLocation, code, location.origin);
+ corsRedirect("Redirect " + code + ": cors to another cors", remoteRedirect, remoteLocation2, code, "null");
+ corsRedirect("Redirect " + code + ": same origin to cors", localRedirect, remoteLocation, code, location.origin);
+ corsRedirect("Redirect " + code + ": cors to same origin", remoteRedirect, localLocation, code, "null");
+}
+
+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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch in worker: Authorisation header management for basic authentication</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-fetch">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ fetch_tests_from_worker(new Worker("authentication-basic.js"));
+ </script>
+ </body>
+</html>
</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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch: Authorisation header management for basic authentication</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-fetch">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script src="../resources/utils.js"></script>
+ <script src="authentication-basic.js"></script>
+ </body>
+</html>
</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("/resources/testharness.js");
+ importScripts("../resources/utils.js");
+}
+
+function basicAuth(desc, user, pass, mode, status) {
+ promise_test(function(test) {
+ var headers = { "Authorization": "Basic " + btoa(user + ":" + pass)};
+ var requestInit = {"credentials": mode, "headers": headers};
+ return fetch(RESOURCES_DIR + "authentication.py?realm=test", requestInit).then(function(resp) {
+ assert_equals(resp.status, status, "HTTP status is " + status);
+ assert_equals(resp.type , "basic", "Response's type is basic");
+ });
+ }, desc);
+}
+
+basicAuth("User-added Authorization header with include mode", "user", "password", "include", 200);
+basicAuth("User-added Authorization header with same-origin mode", "user", "password", "same-origin", 200);
+basicAuth("User-added Authorization header with omit mode", "user", "password", "omit", 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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch in worker: cookies management</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-network-fetch">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ fetch_tests_from_worker(new Worker("cookies.js"));
+ </script>
+ </body>
+</html>
</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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch: cookies management</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-network-fetch">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script src="../resources/utils.js"></script>
+ <script src="cookies.js"></script>
+ </body>
+</html>
</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("/resources/testharness.js");
+ importScripts("../resources/utils.js");
+}
+
+function cookies(desc, credentials1, credentials2 ,cookies) {
+ var url = RESOURCES_DIR + "top.txt"
+ var urlParameters = "";
+ var urlCleanParameters = "";
+ if (cookies) {
+ urlParameters +="?pipe=header(Set-Cookie,";
+ urlParameters += cookies.join(",True)|header(Set-Cookie,") + ",True)";
+ urlCleanParameters +="?pipe=header(Set-Cookie,";
+ urlCleanParameters += cookies.join("%3B%20max-age=0,True)|header(Set-Cookie,") + "%3B%20max-age=0,True)";
+ }
+
+ var requestInit = {"credentials": credentials1}
+ promise_test(function(test){
+ var requestInit = {"credentials": credentials1}
+ return fetch(url + urlParameters, requestInit).then(function(resp) {
+ assert_equals(resp.status, 200, "HTTP status is 200");
+ assert_equals(resp.type , "basic", "Response's type is basic");
+ //check cookies sent
+ return fetch(RESOURCES_DIR + "inspect-headers.py?headers=cookie" , {"credentials": credentials2});
+ }).then(function(resp) {
+ assert_equals(resp.status, 200, "HTTP status is 200");
+ assert_equals(resp.type , "basic", "Response's type is basic");
+ assert_false(resp.headers.has("Cookie") , "Cookie header is not exposed in response");
+ if (credentials1 != "omit" && credentials2 != "omit") {
+ assert_equals(resp.headers.get("x-request-cookie") , cookies.join("; "), "Request include cookie(s)");
+ }
+ else {
+ assert_false(resp.headers.has("x-request-cookie") , "Request does not have cookie(s)");
+ }
+ //clean cookies
+ return fetch(url + urlCleanParameters, {"credentials": "include"});
+ }).catch(function(e) {
+ return fetch(url + urlCleanParameters, {"credentials": "include"}).then(function() {
+ return Promise.reject(e);
+ });
+ });
+ }, desc);
+}
+
+cookies("Include mode: 1 cookie", "include", "include", ["a=1"]);
+cookies("Include mode: 2 cookies", "include", "include", ["b=2", "c=3"]);
+cookies("Omit mode: discard cookies", "omit", "omit", ["d=4"]);
+cookies("Omit mode: no cookie is stored", "omit", "include", ["e=5"]);
+cookies("Omit mode: no cookie is sent", "include", "omit", ["f=6"]);
+cookies("Same-origin mode: 1 cookie", "same-origin", "same-origin", ["a=1"]);
+cookies("Same-origin mode: 2 cookies", "same-origin", "same-origin", ["b=2", "c=3"]);
+
+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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch in worker: blocked by CSP</title>
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ fetch_tests_from_worker(new Worker("csp-blocked.js"));
+ </script>
+ </body>
+</html>
</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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch: blocked by CSP</title>
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script src="../resources/utils.js"></script>
+ <script src="csp-blocked.js"></script>
+ </body>
+</html>
</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("/resources/testharness.js");
+ importScripts("../resources/utils.js");
+}
+
+//Content-Security-Policy: connect-src 'none'; cf .headers file
+cspViolationUrl = RESOURCES_DIR + "top.txt";
+
+promise_test(function(test) {
+ return promise_rejects(test, new TypeError(), fetch(cspViolationUrl));
+}, "Fetch is blocked by CSP, got a TypeError");
+
+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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch in worker: referrer with no-referrer policy</title>
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-network-or-cache-fetch">
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ fetch_tests_from_worker(new Worker("referrer-no-referrer.js"));
+ </script>
+ </body>
+</html>
</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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch: referrer with no-referrer policy</title>
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script src="../resources/utils.js"></script>
+ <script src="referrer-no-referrer.js"></script>
+ </body>
+</html>
</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("/resources/testharness.js");
+ importScripts("../resources/utils.js");
+}
+
+var fetchedUrl = RESOURCES_DIR + "inspect-headers.py?headers=origin";
+
+promise_test(function(test) {
+ return fetch(fetchedUrl).then(function(resp) {
+ assert_equals(resp.status, 200, "HTTP status is 200");
+ assert_equals(resp.type , "basic", "Response's type is basic");
+ var referrer = resp.headers.get("x-request-referer");
+ //Either no referrer header is sent or it is empty
+ if (referrer)
+ assert_equals(referrer, "", "request's referrer is empty");
+ });
+}, "Request's referrer is empty");
+
+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 "http://localhost:8800" but got "http://localhost:8800/fetch/api/policies/referrer-origin.html"
+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 "http://localhost:8800" but got "http://localhost:8800/fetch/api/policies/referrer-origin.js?pipe=sub"
+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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch in worker: referrer with origin policy</title>
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-network-or-cache-fetch">
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ fetch_tests_from_worker(new Worker("referrer-origin.js?pipe=sub"));
+ </script>
+ </body>
+</html>
</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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch: referrer with origin policy</title>
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-network-or-cache-fetch">
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script src="../resources/utils.js"></script>
+ <script src="referrer-origin.js?pipe=sub"></script>
+ </body>
+</html>
</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("/resources/testharness.js");
+ importScripts("../resources/utils.js");
+}
+
+var origin = "http://{{host}}:{{ports[http][0]}}";
+var fetchedUrl = RESOURCES_DIR + "inspect-headers.py?headers=referer";
+
+promise_test(function(test) {
+ return fetch(fetchedUrl).then(function(resp) {
+ assert_equals(resp.status, 200, "HTTP status is 200");
+ assert_equals(resp.type , "basic", "Response's type is basic");
+ assert_equals(resp.headers.get("x-request-referer"), origin, "request's referrer is " + origin);
+ });
+}, "Request's referrer is origin");
+
+promise_test(function(test) {
+ var referrerUrl = "http://{{domains[www]}}:{{ports[http][0]}}/";
+ return promise_rejects(test, new TypeError(), fetch(fetchedUrl, { "referrer": referrerUrl}));
+}, "Throw a TypeError referrer is not same-origin with origin");
+
+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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch in worker: referrer with unsafe-url policy</title>
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-network-or-cache-fetch">
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ fetch_tests_from_worker(new Worker("referrer-unsafe-url.js"));
+ </script>
+ </body>
+</html>
</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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch: referrer with unsafe-url policy</title>
+ <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-network-or-cache-fetch">
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script src="../resources/utils.js"></script>
+ <script src="referrer-unsafe-url.js"></script>
+ </body>
+</html>
</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("/resources/testharness.js");
+ importScripts("../resources/utils.js");
+}
+
+var referrerUrl = location.href;
+var fetchedUrl = RESOURCES_DIR + "inspect-headers.py?headers=referer";
+
+promise_test(function(test) {
+ return fetch(fetchedUrl).then(function(resp) {
+ assert_equals(resp.status, 200, "HTTP status is 200");
+ assert_equals(resp.type , "basic", "Response's type is basic");
+ assert_equals(resp.headers.get("x-request-referer"), referrerUrl, "request's referrer is " + referrerUrl);
+ });
+}, "Request's referrer is the full url of current document/worker");
+
+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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch in worker: rediraction loop</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-network-or-cache-fetch">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ fetch_tests_from_worker(new Worker("redirect-count.js"));
+ </script>
+ </body>
+</html>
</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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch: redirection loop</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-network-or-cache-fetch">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script src="/common/utils.js"></script>
+ <script src="../resources/utils.js"></script>
+ <script src="redirect-count.js"></script>
+ </body>
+</html>
</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("/resources/testharness.js");
+ importScripts("../resources/utils.js");
+ importScripts("/common/utils.js");
+}
+
+function redirectCount(desc, redirectUrl, redirectLocation, redirectStatus, maxCount, shouldPass) {
+ var uuid_token = token();
+
+ var urlParameters = "?token=" + uuid_token + "&max_age=0";
+ urlParameters += "&redirect_status=" + redirectStatus;
+ urlParameters += "&max_count=" + maxCount;
+ if (redirectLocation)
+ urlParameters += "&location=" + encodeURIComponent(redirectLocation);
+
+ var url = redirectUrl;
+ var requestInit = {"redirect": "follow"};
+
+ promise_test(function(test) {
+ fetch(RESOURCES_DIR + "clean-stash.py?token=" + uuid_token).then(function(resp) {
+ assert_equals(resp.status, 200, "Clean stash response's status is 200");
+
+ 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, "Response's status is 200");
+ });
+ }).then(function(body) {
+ assert_equals(body, maxCount.toString(), "Redirected " + maxCount + "times");
+ });
+ }, desc);
+}
+
+var redirUrl = RESOURCES_DIR + "redirect.py";
+
+for (var statusCode of [301, 302, 303, 307, 308]) {
+ redirectCount("Redirect " + statusCode + " 20 times", redirUrl, redirUrl, statusCode, 20, true);
+ redirectCount("Redirect " + statusCode + " 21 times", 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 "follow" mode without location
+PASS Redirect 301 in "manual" mode without location
+PASS Redirect 301 in "follow" mode with invalid location
+PASS Redirect 301 in "manual" mode with invalid location
+PASS Redirect 301 in "follow" mode with data location
+FAIL Redirect 301 in "manual" mode with data location promise_test: Unhandled rejection with value: object "TypeError: Type error"
+PASS Redirect 302 in "follow" mode without location
+PASS Redirect 302 in "manual" mode without location
+PASS Redirect 302 in "follow" mode with invalid location
+PASS Redirect 302 in "manual" mode with invalid location
+PASS Redirect 302 in "follow" mode with data location
+FAIL Redirect 302 in "manual" mode with data location promise_test: Unhandled rejection with value: object "TypeError: Type error"
+PASS Redirect 303 in "follow" mode without location
+PASS Redirect 303 in "manual" mode without location
+PASS Redirect 303 in "follow" mode with invalid location
+PASS Redirect 303 in "manual" mode with invalid location
+PASS Redirect 303 in "follow" mode with data location
+FAIL Redirect 303 in "manual" mode with data location promise_test: Unhandled rejection with value: object "TypeError: Type error"
+PASS Redirect 307 in "follow" mode without location
+PASS Redirect 307 in "manual" mode without location
+PASS Redirect 307 in "follow" mode with invalid location
+PASS Redirect 307 in "manual" mode with invalid location
+PASS Redirect 307 in "follow" mode with data location
+FAIL Redirect 307 in "manual" mode with data location promise_test: Unhandled rejection with value: object "TypeError: Type error"
+PASS Redirect 308 in "follow" mode without location
+PASS Redirect 308 in "manual" mode without location
+PASS Redirect 308 in "follow" mode with invalid location
+PASS Redirect 308 in "manual" mode with invalid location
+PASS Redirect 308 in "follow" mode with data location
+FAIL Redirect 308 in "manual" mode with data location promise_test: Unhandled rejection with value: object "TypeError: Type error"
+
</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 "follow" mode without location
+PASS Redirect 301 in "manual" mode without location
+PASS Redirect 301 in "follow" mode with invalid location
+PASS Redirect 301 in "manual" mode with invalid location
+PASS Redirect 301 in "follow" mode with data location
+FAIL Redirect 301 in "manual" mode with data location promise_test: Unhandled rejection with value: object "TypeError: Type error"
+PASS Redirect 302 in "follow" mode without location
+PASS Redirect 302 in "manual" mode without location
+PASS Redirect 302 in "follow" mode with invalid location
+PASS Redirect 302 in "manual" mode with invalid location
+PASS Redirect 302 in "follow" mode with data location
+FAIL Redirect 302 in "manual" mode with data location promise_test: Unhandled rejection with value: object "TypeError: Type error"
+PASS Redirect 303 in "follow" mode without location
+PASS Redirect 303 in "manual" mode without location
+PASS Redirect 303 in "follow" mode with invalid location
+PASS Redirect 303 in "manual" mode with invalid location
+PASS Redirect 303 in "follow" mode with data location
+FAIL Redirect 303 in "manual" mode with data location promise_test: Unhandled rejection with value: object "TypeError: Type error"
+PASS Redirect 307 in "follow" mode without location
+PASS Redirect 307 in "manual" mode without location
+PASS Redirect 307 in "follow" mode with invalid location
+PASS Redirect 307 in "manual" mode with invalid location
+PASS Redirect 307 in "follow" mode with data location
+FAIL Redirect 307 in "manual" mode with data location promise_test: Unhandled rejection with value: object "TypeError: Type error"
+PASS Redirect 308 in "follow" mode without location
+PASS Redirect 308 in "manual" mode without location
+PASS Redirect 308 in "follow" mode with invalid location
+PASS Redirect 308 in "manual" mode with invalid location
+PASS Redirect 308 in "follow" mode with data location
+FAIL Redirect 308 in "manual" mode with data location promise_test: Unhandled rejection with value: object "TypeError: Type error"
+
</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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch in worker: handling Location header during redirection</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-network-or-cache-fetch">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ fetch_tests_from_worker(new Worker("redirect-location.js"));
+ </script>
+ </body>
+</html>
</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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch: handling Location header during redirection</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-network-or-cache-fetch">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script src="../resources/utils.js"></script>
+ <script src="redirect-location.js"></script>
+ </body>
+</html>
</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("/resources/testharness.js");
+ importScripts("../resources/utils.js");
+}
+
+function redirectLocation(desc, redirectUrl, redirectLocation, redirectStatus, redirectMode, shouldPass) {
+ var url = redirectUrl;
+ var urlParameters = "?redirect_status=" + redirectStatus;
+ if (redirectLocation)
+ urlParameters += "&location=" + encodeURIComponent(redirectLocation);
+
+ var requestInit = {"redirect": redirectMode};
+
+ promise_test(function(test) {
+ if (redirectMode === "error" || !shouldPass)
+ return promise_rejects(test, new TypeError(), fetch(url + urlParameters, requestInit));
+ if (redirectLocation && redirectMode === "manual")
+ return fetch(url + urlParameters, requestInit).then(function(resp) {
+ assert_equals(resp.status, 0, "Response's status is 0");
+ assert_equals(resp.type, "opaqueredirect", "Response's type is opaqueredirect");
+ assert_equals(resp.statusText, "", "Response's statusText is \"\"");
+ assert_true(resp.headers.entries().next().done, "Headers should be empty");
+ });
+
+ if (redirectMode === "manual" || redirectMode === "follow")
+ return fetch(url + urlParameters, requestInit).then(function(resp) {
+ assert_equals(resp.status, redirectStatus, "Response's status is " + redirectStatus);
+ });
+ assert_unreached(redirectMode + " is not a valid redirect mode");
+ }, desc);
+}
+
+var redirUrl = RESOURCES_DIR + "redirect.py";
+var locationUrl = "top.txt";
+var invalidLocationUrl = "#invalidurl:";
+var dataLocationUrl = "data:,data%20url";
+// FIXME: We may want to mix redirect-mode and cors-mode.
+// FIXME: Add tests for "error" redirect-mode.
+for (var statusCode of [301, 302, 303, 307, 308]) {
+ redirectLocation("Redirect " + statusCode + " in \"follow\" mode without location", redirUrl, undefined, statusCode, "follow", true);
+ redirectLocation("Redirect " + statusCode + " in \"manual\" mode without location", redirUrl, undefined, statusCode, "manual", true);
+
+ redirectLocation("Redirect " + statusCode + " in \"follow\" mode with invalid location", redirUrl, invalidLocationUrl, statusCode, "follow", false);
+ redirectLocation("Redirect " + statusCode + " in \"manual\" mode with invalid location", redirUrl, invalidLocationUrl, statusCode, "manual", false);
+
+ redirectLocation("Redirect " + statusCode + " in \"follow\" mode with data location", redirUrl, dataLocationUrl, statusCode, "follow", false);
+ redirectLocation("Redirect " + statusCode + " in \"manual\" mode with data location", redirUrl, dataLocationUrl, statusCode, "manual", 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 "HEAD" but got "GET"
+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 "HEAD" but got "GET"
+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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch in worker: request method handling when redirected</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-network-or-cache-fetch">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ fetch_tests_from_worker(new Worker("redirect-method.js"));
+ </script>
+ </body>
+</html>
</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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch: request method handling when redirected</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-network-or-cache-fetch">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script src="../resources/utils.js"></script>
+ <script src="redirect-method.js"></script>
+ </body>
+</html>
</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("/resources/testharness.js");
+ importScripts("../resources/utils.js");
+}
+
+function redirectMethod(desc, redirectUrl, redirectLocation, redirectStatus, method, expectedMethod) {
+ var url = redirectUrl;
+ var urlParameters = "?redirect_status=" + redirectStatus;
+ urlParameters += "&location=" + encodeURIComponent(redirectLocation);
+
+ var requestInit = {"method": method, "redirect": "follow"};
+ if (method != "GET" && method != "HEAD")
+ requestInit.body = "this is my body";
+
+ promise_test(function(test) {
+ return fetch(url + urlParameters, requestInit).then(function(resp) {
+ assert_equals(resp.status, 200, "Response's status is 200");
+ assert_equals(resp.type, "basic", "Response's type basic");
+ assert_equals(resp.headers.get("x-request-method"), expectedMethod, "Request method after redirection is " + expectedMethod);
+ return resp.text().then(function(text) {
+ assert_equals(text, expectedMethod == "POST" ? requestInit.body : "");
+ });
+ });
+ }, desc);
+}
+
+var redirUrl = RESOURCES_DIR + "redirect.py";
+var locationUrl = "method.py";
+
+redirectMethod("Redirect 301 with GET", redirUrl, locationUrl, 301, "GET", "GET");
+redirectMethod("Redirect 301 with POST", redirUrl, locationUrl, 301, "POST", "GET");
+redirectMethod("Redirect 301 with HEAD", redirUrl, locationUrl, 301, "HEAD", "HEAD");
+
+redirectMethod("Redirect 302 with GET", redirUrl, locationUrl, 302, "GET", "GET");
+redirectMethod("Redirect 302 with POST", redirUrl, locationUrl, 302, "POST", "GET");
+redirectMethod("Redirect 302 with HEAD", redirUrl, locationUrl, 302, "HEAD", "HEAD");
+
+redirectMethod("Redirect 303 with GET", redirUrl, locationUrl, 303, "GET", "GET");
+redirectMethod("Redirect 303 with POST", redirUrl, locationUrl, 303, "POST", "GET");
+redirectMethod("Redirect 303 with HEAD", redirUrl, locationUrl, 303, "HEAD", "HEAD");
+
+redirectMethod("Redirect 307 with GET", redirUrl, locationUrl, 307, "GET", "GET");
+redirectMethod("Redirect 307 with POST", redirUrl, locationUrl, 307, "POST", "POST");
+redirectMethod("Redirect 307 with HEAD", redirUrl, locationUrl, 307, "HEAD", "HEAD");
+
+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 "error" mode assert_unreached: Should have rejected. Reached unreachable code
+PASS Redirect 301 in "follow" mode
+FAIL Redirect 301 in "manual" mode assert_equals: Response's status is 0 expected 0 but got 200
+FAIL Redirect 302 in "error" mode assert_unreached: Should have rejected. Reached unreachable code
+PASS Redirect 302 in "follow" mode
+FAIL Redirect 302 in "manual" mode assert_equals: Response's status is 0 expected 0 but got 200
+FAIL Redirect 303 in "error" mode assert_unreached: Should have rejected. Reached unreachable code
+PASS Redirect 303 in "follow" mode
+FAIL Redirect 303 in "manual" mode assert_equals: Response's status is 0 expected 0 but got 200
+FAIL Redirect 307 in "error" mode assert_unreached: Should have rejected. Reached unreachable code
+PASS Redirect 307 in "follow" mode
+FAIL Redirect 307 in "manual" mode assert_equals: Response's status is 0 expected 0 but got 200
+FAIL Redirect 308 in "error" mode assert_unreached: Should have rejected. Reached unreachable code
+PASS Redirect 308 in "follow" mode
+FAIL Redirect 308 in "manual" 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 "error" mode assert_unreached: Should have rejected. Reached unreachable code
+PASS Redirect 301 in "follow" mode
+FAIL Redirect 301 in "manual" mode assert_equals: Response's status is 0 expected 0 but got 200
+FAIL Redirect 302 in "error" mode assert_unreached: Should have rejected. Reached unreachable code
+PASS Redirect 302 in "follow" mode
+FAIL Redirect 302 in "manual" mode assert_equals: Response's status is 0 expected 0 but got 200
+FAIL Redirect 303 in "error" mode assert_unreached: Should have rejected. Reached unreachable code
+PASS Redirect 303 in "follow" mode
+FAIL Redirect 303 in "manual" mode assert_equals: Response's status is 0 expected 0 but got 200
+FAIL Redirect 307 in "error" mode assert_unreached: Should have rejected. Reached unreachable code
+PASS Redirect 307 in "follow" mode
+FAIL Redirect 307 in "manual" mode assert_equals: Response's status is 0 expected 0 but got 200
+FAIL Redirect 308 in "error" mode assert_unreached: Should have rejected. Reached unreachable code
+PASS Redirect 308 in "follow" mode
+FAIL Redirect 308 in "manual" 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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch in worker: redirect mode handling</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#concept-filtered-response-opaque-redirect">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-network-or-cache-fetch">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ fetch_tests_from_worker(new Worker("redirect-mode.js"));
+ </script>
+ </body>
+</html>
</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>+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Fetch: redirect mode handling</title>
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#concept-filtered-response-opaque-redirect">
+ <meta name="help" href="https://fetch.spec.whatwg.org/#http-network-or-cache-fetch">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script src="../resources/utils.js"></script>
+ <script src="redirect-mode.js"></script>
+ </body>
+</html>
</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("/resources/testharness.js");
+ importScripts("../resources/utils.js");
+}
+
+function redirectMode(desc, redirectUrl, redirectLocation, redirectStatus, redirectMode) {
+ var url = redirectUrl;
+ var urlParameters = "?redirect_status=" + redirectStatus;
+ urlParameters += "&location=" + encodeURIComponent(redirectLocation);
+
+ var requestInit = {"redirect": redirectMode};
+
+ promise_test(function(test) {
+ if (redirectMode === "error")
+ return promise_rejects(test, new TypeError(), fetch(url + urlParameters, requestInit));
+ if (redirectMode === "manual")
+ return fetch(url + urlParameters, requestInit).then(function(resp) {
+ assert_equals(resp.status, 0, "Response's status is 0");
+ assert_equals(resp.type, "opaqueredirect", "Response's type is opaqueredirect");
+ assert_equals(resp.statusText, "", "Response's statusText is \"\"");
+ });
+ if (redirectMode === "follow")
+ return fetch(url + urlParameters, requestInit).then(function(resp) {
+ assert_true(new URL(resp.url).pathname.endsWith(locationUrl), "Response's url should be the redirected one");
+ assert_equals(resp.status, 200, "Response's status is 200");
+ });
+ assert_unreached(redirectMode + " is no a valid redirect mode");
+ }, desc);
+}
+
+var redirUrl = RESOURCES_DIR + "redirect.py";
+var locationUrl = "top.txt";
+
+for (var statusCode of [301, 302, 303, 307, 308]) {
+ redirectMode("Redirect " + statusCode + " in \"error\" mode ", redirUrl, locationUrl, statusCode, "error");
+ redirectMode("Redirect " + statusCode + " in \"follow\" mode ", redirUrl, locationUrl, statusCode, "follow");
+ redirectMode("Redirect " + statusCode + " in \"manual\" mode ", redirUrl, locationUrl, statusCode, "manual");
+}
+
+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>+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+ var fails = ["", "?type=", "?type=x", "?type=x/x"],
+ passes = ["?type=image/gif", "?type=image/png", "?type=image/png;blah"]
+
+ fails.forEach(function(urlpart) {
+ async_test(function(t) {
+ var img = document.createElement("img")
+ img.onerror = t.step_func_done(function(){})
+ img.onload = t.unreached_func("Unexpected load event")
+ img.src = "resources/image.py" + urlpart
+ document.body.appendChild(img)
+ }, "URL query: " + urlpart)
+ })
+
+ passes.forEach(function(urlpart) {
+ async_test(function(t) {
+ var img = document.createElement("img")
+ img.onerror = t.unreached_func("Unexpected error event")
+ img.onload = t.step_func_done(function(){
+ assert_equals(img.width, 96)
+ })
+ img.src = "resources/image.py" + urlpart
+ document.body.appendChild(img)
+ }, "URL query: " + urlpart)
+ })
+</script>
</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 "PASS" but got "FAIL: Content-Type missing"
+
</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>+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+ async_test(function(t) {
+ var w = new Worker("importscripts.js")
+ w.onmessage = t.step_func(function(e) {
+ if(e.data == "END")
+ t.done()
+ else
+ assert_equals(e.data, "PASS")
+ })
+ }, "Test importScripts()")
+</script>
</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("FAIL") }
+function p() { log("PASS") }
+
+["", "?type=", "?type=x", "?type=x/x"].forEach(function(urlpart) {
+ try {
+ importScripts("resources/js.py" + urlpart)
+ } catch(e) {
+ (e.name == "NetworkError") ? p() : log("FAIL (no NetworkError exception): " + urlpart)
+ }
+
+})
+importScripts("resources/js.py?type=text/javascript&outcome=p")
+importScripts("resources/js.py?type=text/ecmascript&outcome=p")
+importScripts("resources/js.py?type=text/ecmascript;blah&outcome=p")
+log("END")
</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>+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+ var fails = ["first", "uppercase"],
+ passes = ["last", "quoted", "quoted-single", "no-x"]
+
+ fails.forEach(function(urlpart) {
+ async_test(function(t) {
+ var script = document.createElement("script")
+ script.onerror = t.step_func_done(function(){})
+ script.onload = t.unreached_func("Unexpected load event")
+ script.src = "resources/nosniff-" + urlpart + ".asis"
+ document.body.appendChild(script)
+ }, "URL query: " + urlpart)
+ })
+
+ passes.forEach(function(urlpart) {
+ async_test(function(t) {
+ var script = document.createElement("script")
+ script.onerror = t.unreached_func("Unexpected error event")
+ script.onload = t.step_func_done(function(){})
+ script.src = "resources/nosniff-" + urlpart + ".asis"
+ document.body.appendChild(script)
+ }, "URL query: " + urlpart)
+ })
+
+</script>
</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("outcome", "f")
+ type = request.GET.first("type", None)
+
+ content = "/* nothing to see here */"
+
+ response.add_required_headers = False
+ response.writer.write_status(200)
+ response.writer.write_header("x-content-type-options", "nosniff")
+ response.writer.write_header("content-length", len(content))
+ if(type != None):
+ response.writer.write_header("content-type", 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("type", None)
+
+ body = open(os.path.join(os.path.dirname(__file__), "../../../images/blue96x96.png")).read()
+
+ response.add_required_headers = False
+ response.writer.write_status(200)
+ response.writer.write_header("x-content-type-options", "nosniff")
+ response.writer.write_header("content-length", len(body))
+ if(type != None):
+ response.writer.write_header("content-type", 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("outcome", "f")
+ type = request.GET.first("type", "Content-Type missing")
+
+ content = "// nothing to see here"
+ content += "\n"
+ content += "log('FAIL: " + type + "')" if (outcome == "f") else "p()"
+
+ response.add_required_headers = False
+ response.writer.write_status(200)
+ response.writer.write_header("x-content-type-options", "nosniff")
+ response.writer.write_header("content-length", len(content))
+ if(type != "Content-Type missing"):
+ response.writer.write_header("content-type", 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: "nosniFF"
+
+// 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("type", None)
+
+ content = "// nothing to see here"
+ content += "\n"
+ content += "this.postMessage('hi')"
+
+ response.add_required_headers = False
+ response.writer.write_status(200)
+ response.writer.write_header("x-content-type-options", "nosniff")
+ response.writer.write_header("content-length", len(content))
+ if(type != None):
+ response.writer.write_header("content-type", 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>+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+ var log = function() {}, // see comment below
+ p = function() {}, // see comment below
+ fails = ["", "?type=", "?type=x", "?type=x/x"],
+ passes = ["?type=text/javascript", "?type=text/ecmascript", "?type=text/ecmascript;blah"]
+
+ // 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("script")
+ script.onerror = t.step_func_done(function(){})
+ script.onload = t.unreached_func("Unexpected load event")
+ script.src = "resources/js.py" + urlpart
+ document.body.appendChild(script)
+ }, "URL query: " + urlpart)
+ })
+
+ passes.forEach(function(urlpart) {
+ async_test(function(t) {
+ var script = document.createElement("script")
+ script.onerror = t.unreached_func("Unexpected error event")
+ script.onload = t.step_func_done(function(){})
+ script.src = "resources/js.py" + urlpart + "&outcome=p"
+ document.body.appendChild(script)
+ }, "URL query: " + urlpart)
+ })
+</script>
</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>+<!-- quirks mode is important, text/css is already required otherwise -->
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+ var fails = ["", "?type=", "?type=x", "?type=x/x"],
+ passes = ["?type=text/css", "?type=text/css;blah"]
+
+ fails.forEach(function(urlpart) {
+ async_test(function(t) {
+ var link = document.createElement("link")
+ link.rel = "stylesheet"
+ link.onerror = t.step_func_done(function(){})
+ link.onload = t.unreached_func("Unexpected load event")
+ link.href = "resources/css.py" + urlpart
+ document.body.appendChild(link)
+ }, "URL query: " + urlpart)
+ })
+
+ passes.forEach(function(urlpart) {
+ async_test(function(t) {
+ var link = document.createElement("link")
+ link.rel = "stylesheet"
+ link.onerror = t.unreached_func("Unexpected error event")
+ link.onload = t.step_func_done(function(){
+ if(passes[passes.length-1] == urlpart) {
+ assert_equals(document.styleSheets.length, passes.length)
+ }
+ })
+ link.href = "resources/css.py" + urlpart
+ document.body.appendChild(link)
+ }, "URL query: " + urlpart)
+ })
+</script>
</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>+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+ var workers = [],
+ fails = ["", "?type=", "?type=x", "?type=x/x"],
+ passes = ["?type=text/javascript", "?type=text/ecmascript", "?type=text/ecmascript;yay"]
+
+ fails.forEach(function(urlpart) {
+ async_test(function(t) {
+ var w = new Worker("resources/worker.py" + urlpart)
+ w.onmessage = t.unreached_func("Unexpected message event")
+ w.onerror = t.step_func_done(function(){})
+ workers.push(w) // avoid GC
+ }, "URL query: " + urlpart)
+ })
+
+ passes.forEach(function(urlpart) {
+ async_test(function(t) {
+ var w = new Worker("resources/worker.py" + urlpart)
+ w.onmessage = t.step_func_done(function(e){
+ assert_equals(e.data, "hi")
+ })
+ w.onerror = t.unreached_func("Unexpected error event")
+ workers.push(w) // avoid GC
+ }, "URL query: " + urlpart)
+ })
+</script>
</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 "follow" mode without location
+PASS Redirect 301 in "manual" mode without location
+PASS Redirect 301 in "follow" mode with invalid location
+PASS Redirect 301 in "manual" mode with invalid location
+PASS Redirect 301 in "follow" mode with data location
+FAIL Redirect 301 in "manual" mode with data location promise_test: Unhandled rejection with value: object "TypeError: Type error"
+PASS Redirect 302 in "follow" mode without location
+PASS Redirect 302 in "manual" mode without location
+PASS Redirect 302 in "follow" mode with invalid location
+PASS Redirect 302 in "manual" mode with invalid location
+PASS Redirect 302 in "follow" mode with data location
+FAIL Redirect 302 in "manual" mode with data location promise_test: Unhandled rejection with value: object "TypeError: Type error"
+PASS Redirect 303 in "follow" mode without location
+PASS Redirect 303 in "manual" mode without location
+PASS Redirect 303 in "follow" mode with invalid location
+TIMEOUT Redirect 303 in "manual" mode with invalid location Test timed out
+TIMEOUT Redirect 303 in "follow" mode with data location Test timed out
+TIMEOUT Redirect 303 in "manual" mode with data location Test timed out
+TIMEOUT Redirect 307 in "follow" mode without location Test timed out
+TIMEOUT Redirect 307 in "manual" mode without location Test timed out
+TIMEOUT Redirect 307 in "follow" mode with invalid location Test timed out
+TIMEOUT Redirect 307 in "manual" mode with invalid location Test timed out
+TIMEOUT Redirect 307 in "follow" mode with data location Test timed out
+TIMEOUT Redirect 307 in "manual" mode with data location Test timed out
+TIMEOUT Redirect 308 in "follow" mode without location Test timed out
+TIMEOUT Redirect 308 in "manual" mode without location Test timed out
+TIMEOUT Redirect 308 in "follow" mode with invalid location Test timed out
+TIMEOUT Redirect 308 in "manual" mode with invalid location Test timed out
+TIMEOUT Redirect 308 in "follow" mode with data location Test timed out
+TIMEOUT Redirect 308 in "manual" 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>