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

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

Issue 1043133002: [Fetch] Remove Request.body. (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
« no previous file with comments | « no previous file | LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 body: new Blob([''], {type: 'Text/Plain'})}); 682 body: new Blob([''], {type: 'Text/Plain'})});
683 req.headers.set('Content-Type', 'Text/Html'); 683 req.headers.set('Content-Type', 'Text/Html');
684 return req.blob() 684 return req.blob()
685 .then(function(blob) { 685 .then(function(blob) {
686 assert_equals(blob.type, 'text/plain'); 686 assert_equals(blob.type, 'text/plain');
687 assert_equals(req.headers.get('Content-Type'), 'Text/Html'); 687 assert_equals(req.headers.get('Content-Type'), 'Text/Html');
688 }); 688 });
689 }, 689 },
690 'MIME type unchanged if headers are modified after Request() constructor'); 690 'MIME type unchanged if headers are modified after Request() constructor');
691 691
692 // The following two tests follow different code paths in Body::readAsync().
693 promise_test(function(t) { 692 promise_test(function(t) {
694 var req = new Request('http://localhost/', 693 var req = new Request('http://localhost/',
695 {method: 'POST', 694 {method: 'POST',
696 body: new Blob([''], {type: 'Text/Plain'}), 695 body: new Blob([''], {type: 'Text/Plain'}),
697 headers: [['Content-Type', 'Text/Html']]}); 696 headers: [['Content-Type', 'Text/Html']]});
698 return req.blob() 697 return req.blob()
699 .then(function(blob) { 698 .then(function(blob) {
700 assert_equals(blob.type, 'text/html'); 699 assert_equals(blob.type, 'text/html');
701 assert_equals(req.headers.get('Content-Type'), 'Text/Html'); 700 assert_equals(req.headers.get('Content-Type'), 'Text/Html');
702 }); 701 });
703 }, 'Extract a MIME type (1)'); 702 }, 'Extract a MIME type (1)');
704 703
705 promise_test(function(t) {
706 var req = new Request('http://localhost/',
707 {method: 'POST',
708 body: new Blob([''], {type: 'Text/Plain'}),
709 headers: [['Content-Type', 'Text/Html']]});
710 req.body.cancel();
711 return req.blob()
712 .then(function(blob) {
713 assert_equals(blob.type, 'text/html');
714 assert_equals(req.headers.get('Content-Type'), 'Text/Html');
715 });
716 }, 'Extract a MIME type (2)');
717
718 done(); 704 done();
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698