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

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

Issue 2591753003: Fix a promise_test misuse in http/tests/fetch/ layout tests (Closed)
Patch Set: Created 4 years 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 | third_party/WebKit/LayoutTests/http/tests/fetch/serviceworker/request-base-https-other-https-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 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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 'origin', 'kept original policy'); 498 'origin', 'kept original policy');
499 assert_equals(new Request(r, {mode: 44}).referrerPolicy, 499 assert_equals(new Request(r, {mode: 44}).referrerPolicy,
500 '', 'cleared policy'); 500 '', 'cleared policy');
501 assert_equals(new Request(r, {referrerPolicy: 'unsafe-url'}).referrerPolicy, 501 assert_equals(new Request(r, {referrerPolicy: 'unsafe-url'}).referrerPolicy,
502 'unsafe-url', 'overriden policy'); 502 'unsafe-url', 'overriden policy');
503 }, 'Referrer policy should be cleared when any members are set'); 503 }, 'Referrer policy should be cleared when any members are set');
504 504
505 // Spec: https://fetch.spec.whatwg.org/#dom-request 505 // Spec: https://fetch.spec.whatwg.org/#dom-request
506 // Step 21: 506 // Step 21:
507 // If request's method is `GET` or `HEAD`, throw a TypeError. 507 // If request's method is `GET` or `HEAD`, throw a TypeError.
508 promise_test(function() { 508 test(function() {
509 var headers = new Headers; 509 var headers = new Headers;
510 headers.set('Content-Language', 'ja'); 510 headers.set('Content-Language', 'ja');
511 ['GET', 'HEAD'].forEach(function(method) { 511 ['GET', 'HEAD'].forEach(function(method) {
512 assert_throws( 512 assert_throws(
513 {name: 'TypeError'}, 513 {name: 'TypeError'},
514 function() { 514 function() {
515 new Request(URL, 515 new Request(URL,
516 {method: method, 516 {method: method,
517 body: new Blob(['Test Blob'], {type: 'test/type'}) 517 body: new Blob(['Test Blob'], {type: 'test/type'})
518 }); 518 });
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 credentials: 'include', 813 credentials: 'include',
814 body: 'this is a body'}); 814 body: 'this is a body'});
815 815
816 return req.text() 816 return req.text()
817 .then(t => { 817 .then(t => {
818 assert_equals(t, 'this is a body'); 818 assert_equals(t, 'this is a body');
819 }); 819 });
820 }, 'Credentials and body can both be set.'); 820 }, 'Credentials and body can both be set.');
821 821
822 done(); 822 done();
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/fetch/serviceworker/request-base-https-other-https-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698