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

Side by Side Diff: LayoutTests/http/tests/serviceworker/resources/response-content-worker.js

Issue 647493002: Move promise_test and assert_promise_rejects out of worker-test-harness. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@geofencing_serviceworker
Patch Set: rebase Created 6 years, 2 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 importScripts('worker-test-harness.js'); 1 importScripts('worker-testharness.js');
2 importScripts('../../resources/testharness-helpers.js');
2 3
3 promise_test(function() { 4 promise_test(function() {
4 var response = new Response('test string'); 5 var response = new Response('test string');
5 assert_equals( 6 assert_equals(
6 response.headers.get('Content-Type'), 7 response.headers.get('Content-Type'),
7 'text/plain;charset=UTF-8', 8 'text/plain;charset=UTF-8',
8 'A Response constructed with a string should have a Content-Type.'); 9 'A Response constructed with a string should have a Content-Type.');
9 return response.text() 10 return response.text()
10 .then(function(text) { 11 .then(function(text) {
11 assert_equals(text, 'test string', 12 assert_equals(text, 'test string',
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 response3 = response.clone(); 92 response3 = response.clone();
92 assert_true(response3.bodyUsed, 93 assert_true(response3.bodyUsed,
93 "bodyUsed should be true in clone of consumed response."); 94 "bodyUsed should be true in clone of consumed response.");
94 return response2.text(); 95 return response2.text();
95 }) 96 })
96 .then(function(text) { 97 .then(function(text) {
97 assert_equals(text, 'test string', 98 assert_equals(text, 'test string',
98 'Response clone response body text should match.'); 99 'Response clone response body text should match.');
99 }); 100 });
100 }, 'Behavior of bodyUsed in Response and clone behavior.'); 101 }, 'Behavior of bodyUsed in Response and clone behavior.');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698