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

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 function size(headers) { 7 function size(headers) {
8 var count = 0; 8 var count = 0;
9 for (var header of headers) { 9 for (var header of headers) {
10 ++count; 10 ++count;
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 body: new Blob([''], {type: 'Text/Plain'}), 708 body: new Blob([''], {type: 'Text/Plain'}),
709 headers: [['Content-Type', 'Text/Html']]}); 709 headers: [['Content-Type', 'Text/Html']]});
710 req.body.cancel(); 710 req.body.cancel();
711 return req.blob() 711 return req.blob()
712 .then(function(blob) { 712 .then(function(blob) {
713 assert_equals(blob.type, 'text/html'); 713 assert_equals(blob.type, 'text/html');
714 assert_equals(req.headers.get('Content-Type'), 'Text/Html'); 714 assert_equals(req.headers.get('Content-Type'), 'Text/Html');
715 }); 715 });
716 }, 'Extract a MIME type (2)'); 716 }, 'Extract a MIME type (2)');
717 717
718 // Tests for requests context.
719 test(function() {
720 var request = new Request('http://localhost/', {method: 'POST', body: ''});
721 assert_equals(request.context, '',
722 'Request.context should be empty string for synthetic Request object');
hiroshige 2015/04/09 17:43:21 nit: please wrap to 80 columns, e.g.
shiva.jm 2015/04/10 09:27:10 Done.
723 }, 'RequestContext of a synthetic Request object');
724
718 done(); 725 done();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698