{"action":"created","comment":{"url":"https://api.github.com/repos/w3c/web-platform-tests/pulls/comments/50017928","id":50017928,"diff_hunk":"@@ -0,0 +1,45 @@\n+if (this.document === undefined) {\n+  importScripts(\"/resources/testharness.js\");\n+  importScripts(\"../resources/utils.js\");\n+}\n+\n+function integrity(desc, url, integrity, shouldPass) {\n+   if (shouldPass) {\n+    promise_test(function(test) {\n+      return fetch(url, {'integrity': integrity}).then(function(resp) {\n+        assert_equals(resp.status, 200, \"Response's status is 200\");\n+      });\n+    }, desc);\n+  } else {\n+    promise_test(function(test) {\n+      return promise_rejects(test, new TypeError(), fetch(url, {'integrity': integrity}));\n+    }, desc);\n+  }\n+}\n+\n+var topSha256 = \"sha256-KHIDZcXnR2oBHk9DrAA+5fFiR6JjudYjqoXtMR1zvzk=\";\n+var topSha384 = \"sha384-MgZYnnAzPM/MjhqfOIMfQK5qcFvGZsGLzx4Phd7/A8fHTqqLqXqKo8cNzY3xEPTL\";\n+var topSha512 = \"sha512-D6yns0qxG0E7+TwkevZ4Jt5t7Iy3ugmAajG/dlf6Pado1JqTyneKXICDiqFIkLMRExgtvg8PlxbKTkYfRejSOg==\";\n+var invalidSha256 = \"sha256-dKUcPOn/AlUjWIwcHeHNqYXPlvyGiq+2dWOdFcE+24I=\";\n+var invalidSha512 = \"sha512-oUceBRNxPxnY60g/VtPCj2syT4wo4EZh2CgYdWy9veW8+OsReTXoh7dizMGZafvx9+QhMS39L/gIkxnPIn41Zg==\";\n+\n+var url = \"../resources/top.txt\";\n+var corsUrl = \"http://www1.{{host}}:{{ports[http][0]}}\" + dirname(location.pathname) + RESOURCES_DIR + \"top.txt\";\n+/* Enable CORS*/\n+corsUrl += \"?pipe=header(Access-Control-Allow-Origin,*)\";\n+\n+integrity(\"Empty string integrity\", url, \"\", true);\n+integrity(\"SHA-256 integrity\", url, topSha256, true);\n+integrity(\"SHA-384 integrity\", url, topSha384, true);\n+integrity(\"SHA-512 integrity\", url, topSha512, true);\n+integrity(\"Invalid integrity\", url, invalidSha256, false);\n+integrity(\"Multiple integrities: valid stronger than invalid\", url, invalidSha256 + \" \" + topSha384, true);\n+integrity(\"Multiple integrities: invalid stronger than valid\", url, invalidSha512 + \" \" + topSha384, false);\n+integrity(\"Multiple integrities: invalid as strong as valid\", url, invalidSha512 + \" \" + topSha512, true);\n+integrity(\"Multiple integrities: both are valid\", url,  topSha384 + \" \" + topSha512, true);\n+integrity(\"Multiple integrities: both are invalid\", url, invalidSha256 + \" \" + invalidSha512, false);\n+integrity(\"CORS empty integrity\", corsUrl, \"\", true);\n+integrity(\"CORS SHA-512 integrity\", corsUrl, topSha512, true);\n+integrity(\"CORS invalid integrity\", corsUrl, invalidSha512, false);\n+","path":"fetch/api/basic/integrity.js","position":44,"original_position":44,"commit_id":"f55e51f67ea8ff206db48ad4d96d02da608b70dd","original_commit_id":"f55e51f67ea8ff206db48ad4d96d02da608b70dd","user":{"login":"jdm","id":27658,"avatar_url":"https://avatars.githubusercontent.com/u/27658?v=3","gravatar_id":"","url":"https://api.github.com/users/jdm","html_url":"https://github.com/jdm","followers_url":"https://api.github.com/users/jdm/followers","following_url":"https://api.github.com/users/jdm/following{/other_user}","gists_url":"https://api.github.com/users/jdm/gists{/gist_id}","starred_url":"https://api.github.com/users/jdm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdm/subscriptions","organizations_url":"https://api.github.com/users/jdm/orgs","repos_url":"https://api.github.com/users/jdm/repos","events_url":"https://api.github.com/users/jdm/events{/privacy}","received_events_url":"https://api.github.com/users/jdm/received_events","type":"User","site_admin":false},"body":"Shall we test that a no-cors request with an integrity string throws, per https://fetch.spec.whatwg.org/#dom-request 29.2?","created_at":"2016-01-18T16:28:59Z","updated_at":"2016-01-18T16:28:59Z","html_url":"https://github.com/w3c/web-platform-tests/pull/2454#discussion_r50017928","pull_request_url":"https://api.github.com/repos/w3c/web-platform-tests/pulls/2454","_links":{"self":{"href":"https://api.github.com/repos/w3c/web-platform-tests/pulls/comments/50017928"},"html":{"href":"https://github.com/w3c/web-platform-tests/pull/2454#discussion_r50017928"},"pull_request":{"href":"https://api.github.com/repos/w3c/web-platform-tests/pulls/2454"}}},"pull_request":{"url":"https://api.github.com/repos/w3c/web-platform-tests/pulls/2454","id":55315001,"html_url":"https://github.com/w3c/web-platform-tests/pull/2454","diff_url":"https://github.com/w3c/web-platform-tests/pull/2454.diff","patch_url":"https://github.com/w3c/web-platform-tests/pull/2454.patch","issue_url":"https://api.github.com/repos/w3c/web-platform-tests/issues/2454","number":2454,"state":"open","locked":false,"title":"Some Fetch API Tests.","user":{"login":"youennf","id":5575980,"avatar_url":"https://avatars.githubusercontent.com/u/5575980?v=3","gravatar_id":"","url":"https://api.github.com/users/youennf","html_url":"https://github.com/youennf","followers_url":"https://api.github.com/users/youennf/followers","following_url":"https://api.github.com/users/youennf/following{/other_user}","gists_url":"https://api.github.com/users/youennf/gists{/gist_id}","starred_url":"https://api.github.com/users/youennf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/youennf/subscriptions","organizations_url":"https://api.github.com/users/youennf/orgs","repos_url":"https://api.github.com/users/youennf/repos","events_url":"https://api.github.com/users/youennf/events{/privacy}","received_events_url":"https://api.github.com/users/youennf/received_events","type":"User","site_admin":false},"body":"From Antoine Breton's work.","created_at":"2016-01-07T09:13:23Z","updated_at":"2016-01-18T16:28:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6810c870bc7018649321382d9cb2f7dd4e317637","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/w3c/web-platform-tests/pulls/2454/commits","review_comments_url":"https://api.github.com/repos/w3c/web-platform-tests/pulls/2454/comments","review_comment_url":"https://api.github.com/repos/w3c/web-platform-tests/pulls/comments{/number}","comments_url":"https://api.github.com/repos/w3c/web-platform-tests/issues/2454/comments","statuses_url":"https://api.github.com/repos/w3c/web-platform-tests/statuses/f55e51f67ea8ff206db48ad4d96d02da608b70dd","head":{"label":"canonresearchfrance:fetch-api-tests","ref":"fetch-api-tests","sha":"f55e51f67ea8ff206db48ad4d96d02da608b70dd","user":{"login":"canonresearchfrance","id":7011097,"avatar_url":"https://avatars.githubusercontent.com/u/7011097?v=3","gravatar_id":"","url":"https://api.github.com/users/canonresearchfrance","html_url":"https://github.com/canonresearchfrance","followers_url":"https://api.github.com/users/canonresearchfrance/followers","following_url":"https://api.github.com/users/canonresearchfrance/following{/other_user}","gists_url":"https://api.github.com/users/canonresearchfrance/gists{/gist_id}","starred_url":"https://api.github.com/users/canonresearchfrance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/canonresearchfrance/subscriptions","organizations_url":"https://api.github.com/users/canonresearchfrance/orgs","repos_url":"https://api.github.com/users/canonresearchfrance/repos","events_url":"https://api.github.com/users/canonresearchfrance/events{/privacy}","received_events_url":"https://api.github.com/users/canonresearchfrance/received_events","type":"Organization","site_admin":false},"repo":{"id":49193087,"name":"web-platform-tests","full_name":"canonresearchfrance/web-platform-tests","owner":{"login":"canonresearchfrance","id":7011097,"avatar_url":"https://avatars.githubusercontent.com/u/7011097?v=3","gravatar_id":"","url":"https://api.github.com/users/canonresearchfrance","html_url":"https://github.com/canonresearchfrance","followers_url":"https://api.github.com/users/canonresearchfrance/followers","following_url":"https://api.github.com/users/canonresearchfrance/following{/other_user}","gists_url":"https://api.github.com/users/canonresearchfrance/gists{/gist_id}","starred_url":"https://api.github.com/users/canonresearchfrance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/canonresearchfrance/subscriptions","organizations_url":"https://api.github.com/users/canonresearchfrance/orgs","repos_url":"https://api.github.com/users/canonresearchfrance/repos","events_url":"https://api.github.com/users/canonresearchfrance/events{/privacy}","received_events_url":"https://api.github.com/users/canonresearchfrance/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/canonresearchfrance/web-platform-tests","description":"Test Suites for Web Platform specifications—including WHATWG, W3C and others","fork":true,"url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests","forks_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/forks","keys_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/teams","hooks_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/hooks","issue_events_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/issues/events{/number}","events_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/events","assignees_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/assignees{/user}","branches_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/branches{/branch}","tags_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/tags","blobs_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/git/refs{/sha}","trees_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/statuses/{sha}","languages_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/languages","stargazers_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/stargazers","contributors_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/contributors","subscribers_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/subscribers","subscription_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/subscription","commits_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/commits{/sha}","git_commits_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/git/commits{/sha}","comments_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/comments{/number}","issue_comment_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/issues/comments{/number}","contents_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/contents/{+path}","compare_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/merges","archive_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/downloads","issues_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/issues{/number}","pulls_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/pulls{/number}","milestones_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/milestones{/number}","notifications_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/labels{/name}","releases_url":"https://api.github.com/repos/canonresearchfrance/web-platform-tests/releases{/id}","created_at":"2016-01-07T08:53:17Z","updated_at":"2016-01-07T08:53:36Z","pushed_at":"2016-01-07T09:11:45Z","git_url":"git://github.com/canonresearchfrance/web-platform-tests.git","ssh_url":"git@github.com:canonresearchfrance/web-platform-tests.git","clone_url":"https://github.com/canonresearchfrance/web-platform-tests.git","svn_url":"https://github.com/canonresearchfrance/web-platform-tests","homepage":"http://irc.w3.org/?channels=testing","size":147818,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"w3c:master","ref":"master","sha":"d196d99810ab73369a1ac0e54b9f429eacbb6cd4","user":{"login":"w3c","id":379216,"avatar_url":"https://avatars.githubusercontent.com/u/379216?v=3","gravatar_id":"","url":"https://api.github.com/users/w3c","html_url":"https://github.com/w3c","followers_url":"https://api.github.com/users/w3c/followers","following_url":"https://api.github.com/users/w3c/following{/other_user}","gists_url":"https://api.github.com/users/w3c/gists{/gist_id}","starred_url":"https://api.github.com/users/w3c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/w3c/subscriptions","organizations_url":"https://api.github.com/users/w3c/orgs","repos_url":"https://api.github.com/users/w3c/repos","events_url":"https://api.github.com/users/w3c/events{/privacy}","received_events_url":"https://api.github.com/users/w3c/received_events","type":"Organization","site_admin":false},"repo":{"id":3618133,"name":"web-platform-tests","full_name":"w3c/web-platform-tests","owner":{"login":"w3c","id":379216,"avatar_url":"https://avatars.githubusercontent.com/u/379216?v=3","gravatar_id":"","url":"https://api.github.com/users/w3c","html_url":"https://github.com/w3c","followers_url":"https://api.github.com/users/w3c/followers","following_url":"https://api.github.com/users/w3c/following{/other_user}","gists_url":"https://api.github.com/users/w3c/gists{/gist_id}","starred_url":"https://api.github.com/users/w3c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/w3c/subscriptions","organizations_url":"https://api.github.com/users/w3c/orgs","repos_url":"https://api.github.com/users/w3c/repos","events_url":"https://api.github.com/users/w3c/events{/privacy}","received_events_url":"https://api.github.com/users/w3c/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/w3c/web-platform-tests","description":"Test Suites for Web Platform specifications—including WHATWG, W3C and others","fork":false,"url":"https://api.github.com/repos/w3c/web-platform-tests","forks_url":"https://api.github.com/repos/w3c/web-platform-tests/forks","keys_url":"https://api.github.com/repos/w3c/web-platform-tests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/w3c/web-platform-tests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/w3c/web-platform-tests/teams","hooks_url":"https://api.github.com/repos/w3c/web-platform-tests/hooks","issue_events_url":"https://api.github.com/repos/w3c/web-platform-tests/issues/events{/number}","events_url":"https://api.github.com/repos/w3c/web-platform-tests/events","assignees_url":"https://api.github.com/repos/w3c/web-platform-tests/assignees{/user}","branches_url":"https://api.github.com/repos/w3c/web-platform-tests/branches{/branch}","tags_url":"https://api.github.com/repos/w3c/web-platform-tests/tags","blobs_url":"https://api.github.com/repos/w3c/web-platform-tests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/w3c/web-platform-tests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/w3c/web-platform-tests/git/refs{/sha}","trees_url":"https://api.github.com/repos/w3c/web-platform-tests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/w3c/web-platform-tests/statuses/{sha}","languages_url":"https://api.github.com/repos/w3c/web-platform-tests/languages","stargazers_url":"https://api.github.com/repos/w3c/web-platform-tests/stargazers","contributors_url":"https://api.github.com/repos/w3c/web-platform-tests/contributors","subscribers_url":"https://api.github.com/repos/w3c/web-platform-tests/subscribers","subscription_url":"https://api.github.com/repos/w3c/web-platform-tests/subscription","commits_url":"https://api.github.com/repos/w3c/web-platform-tests/commits{/sha}","git_commits_url":"https://api.github.com/repos/w3c/web-platform-tests/git/commits{/sha}","comments_url":"https://api.github.com/repos/w3c/web-platform-tests/comments{/number}","issue_comment_url":"https://api.github.com/repos/w3c/web-platform-tests/issues/comments{/number}","contents_url":"https://api.github.com/repos/w3c/web-platform-tests/contents/{+path}","compare_url":"https://api.github.com/repos/w3c/web-platform-tests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/w3c/web-platform-tests/merges","archive_url":"https://api.github.com/repos/w3c/web-platform-tests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/w3c/web-platform-tests/downloads","issues_url":"https://api.github.com/repos/w3c/web-platform-tests/issues{/number}","pulls_url":"https://api.github.com/repos/w3c/web-platform-tests/pulls{/number}","milestones_url":"https://api.github.com/repos/w3c/web-platform-tests/milestones{/number}","notifications_url":"https://api.github.com/repos/w3c/web-platform-tests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/w3c/web-platform-tests/labels{/name}","releases_url":"https://api.github.com/repos/w3c/web-platform-tests/releases{/id}","created_at":"2012-03-04T12:58:11Z","updated_at":"2016-01-14T05:13:55Z","pushed_at":"2016-01-18T15:49:07Z","git_url":"git://github.com/w3c/web-platform-tests.git","ssh_url":"git@github.com:w3c/web-platform-tests.git","clone_url":"https://github.com/w3c/web-platform-tests.git","svn_url":"https://github.com/w3c/web-platform-tests","homepage":"http://irc.w3.org/?channels=testing","size":293033,"stargazers_count":707,"watchers_count":707,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":786,"mirror_url":null,"open_issues_count":264,"forks":786,"open_issues":264,"watchers":707,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/w3c/web-platform-tests/pulls/2454"},"html":{"href":"https://github.com/w3c/web-platform-tests/pull/2454"},"issue":{"href":"https://api.github.com/repos/w3c/web-platform-tests/issues/2454"},"comments":{"href":"https://api.github.com/repos/w3c/web-platform-tests/issues/2454/comments"},"review_comments":{"href":"https://api.github.com/repos/w3c/web-platform-tests/pulls/2454/comments"},"review_comment":{"href":"https://api.github.com/repos/w3c/web-platform-tests/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/w3c/web-platform-tests/pulls/2454/commits"},"statuses":{"href":"https://api.github.com/repos/w3c/web-platform-tests/statuses/f55e51f67ea8ff206db48ad4d96d02da608b70dd"}}}}