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

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
719 // Tests for requests context.
720 promise_test(function(t) {
721 var req = new Request('http://localhost/',
722 {method: 'POST', body: ''});
723 return req.blob()
jsbell 2015/04/06 17:04:15 Extracting the body of the request here should not
shiva.jm 2015/04/09 09:16:22 Done.
724 .then(function(blob) {
725 assert_equals(req.context, '');
jsbell 2015/04/06 17:04:14 Please add a message to the assertion, e.g. "Reque
shiva.jm 2015/04/09 09:16:22 Done.
726 });
727 }, 'requests context');
jsbell 2015/04/06 17:04:14 Please give the test a more descriptive name, e.g.
shiva.jm 2015/04/09 09:16:22 Done.
728
729 promise_test(function(t) {
jsbell 2015/04/06 17:04:14 What is this test verifying that's different than
shiva.jm 2015/04/09 09:16:22 Done.
730 var req = new Request('http://localhost/',
731 {method: 'POST',
732 body: new Blob([''], {type: 'Text/Plain'}),
733 headers: [['Content-Type', 'Text/Html']]});
734 return req.blob()
735 .then(function(blob) {
736 assert_equals(req.context, '');
737 });
738 }, 'requests context');
739
718 done(); 740 done();
OLDNEW
« no previous file with comments | « no previous file | Source/modules/fetch/FetchManager.cpp » ('j') | Source/modules/fetch/FetchManager.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698