Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(860)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/workers/resources/referer-test.js

Issue 2651943002: Block subresource requests whose URLs include credentials. (Closed)
Patch Set: Test. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 if (window.testRunner) { 1 if (window.testRunner) {
2 testRunner.dumpAsText(); 2 testRunner.dumpAsText();
3 testRunner.waitUntilDone(); 3 testRunner.waitUntilDone();
4 } 4 }
5 5
6 var console_messages = document.createElement("ul"); 6 var console_messages = document.createElement("ul");
7 document.body.appendChild(console_messages); 7 document.body.appendChild(console_messages);
8 8
9 function log(message) 9 function log(message)
10 { 10 {
11 var item = document.createElement("li"); 11 var item = document.createElement("li");
12 item.appendChild(document.createTextNode(message)); 12 item.appendChild(document.createTextNode(message));
13 console_messages.appendChild(item); 13 console_messages.appendChild(item);
14 } 14 }
15 15
16 var workerUrl = location.protocol + "//MyUserName:MySecurePassword@" + location. host + location.pathname.replace(/\/[^\/]*$/, "") + '/resources/referer.js#ref'; 16 var workerUrl = location.protocol + "//" + location.host + location.pathname.rep lace(/\/[^\/]*$/, "") + '/resources/referer.js#ref';
17 var worker = createWorker(workerUrl); 17 var worker = createWorker(workerUrl);
18 18
19 worker.onmessage = function(evt) 19 worker.onmessage = function(evt)
20 { 20 {
21 if (/log .+/.test(evt.data)) 21 if (/log .+/.test(evt.data))
22 log(evt.data.substr(4)); 22 log(evt.data.substr(4));
23 else if (/DONE/.test(evt.data)) { 23 else if (/DONE/.test(evt.data)) {
24 if (window.testRunner) 24 if (window.testRunner)
25 testRunner.notifyDone(); 25 testRunner.notifyDone();
26 } else { 26 } else {
27 log("ERROR"); 27 log("ERROR");
28 if (window.testRunner) 28 if (window.testRunner)
29 testRunner.notifyDone(); 29 testRunner.notifyDone();
30 } 30 }
31 } 31 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698