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

Side by Side Diff: LayoutTests/http/tests/fetch/script-tests/request.js

Issue 1060033002: Implement Request.context for Fetch API (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 (self.importScripts) { 1 if (self.importScripts) {
2 importScripts('../resources/fetch-test-helpers.js'); 2 importScripts('../resources/fetch-test-helpers.js');
3 } 3 }
4 4
5 var URL = 'https://www.example.com/test.html'; 5 var URL = 'https://www.example.com/test.html';
6 6
7 test(function() { 7 test(function() {
8 var headers = new Headers; 8 var headers = new Headers;
9 headers.set('User-Agent', 'Mozilla/5.0'); 9 headers.set('User-Agent', 'Mozilla/5.0');
10 headers.set('Accept', 'text/html'); 10 headers.set('Accept', 'text/html');
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 assert_equals(text, 'hello'); 563 assert_equals(text, 'hello');
564 var req2 = new Request(req); 564 var req2 = new Request(req);
565 assert_true(req.bodyUsed); 565 assert_true(req.bodyUsed);
566 assert_false(req2.bodyUsed); 566 assert_false(req2.bodyUsed);
567 return req2.text(); 567 return req2.text();
568 }).then(function(text) { 568 }).then(function(text) {
569 assert_equals(text, ''); 569 assert_equals(text, '');
570 }); 570 });
571 }, 'Consume and pass'); 571 }, 'Consume and pass');
572 572
573 // Tests for requests context.
574 test(function() {
575 var request = new Request('http://localhost/', {method: 'POST', body: ''});
576 assert_equals(request.context, '',
577 'Request.context should be empty string ' +
578 'for synthetic Request object');
579 }, 'RequestContext of a synthetic Request object');
580
573 done(); 581 done();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698