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

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

Issue 307063002: ServiceWorker: Add a Response ctor that accepts the body as a Blob (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: don't crash on null body Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/modules/serviceworkers/Response.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 importScripts('worker-test-helpers.js'); 1 importScripts('worker-test-helpers.js');
2 2
3 test(function() { 3 test(function() {
4 var headers = new HeaderMap; 4 var headers = new HeaderMap;
5 headers.set('Content-Language', 'ja'); 5 headers.set('Content-Language', 'ja');
6 headers.set('Content-Type', 'text/html; charset=UTF-8'); 6 headers.set('Content-Type', 'text/html; charset=UTF-8');
7 headers.set('X-ServiceWorker-Test', 'response test field'); 7 headers.set('X-ServiceWorker-Test', 'response test field');
8 8
9 var response = new Response({ 9 var response = new Response(new Blob(), {
10 status: 303, 10 status: 303,
11 statusText: 'See Other', 11 statusText: 'See Other',
12 headers: headers 12 headers: headers
13 }); 13 });
14 14
15 assert_equals(response.status, 303, 'Response.status should match'); 15 assert_equals(response.status, 303, 'Response.status should match');
16 assert_equals(response.statusText, 'See Other', 'Response.statusText should match'); 16 assert_equals(response.statusText, 'See Other', 'Response.statusText should match');
17 assert_true(response.headers instanceof HeaderMap, 'Response.headers should be HeaderMap'); 17 assert_true(response.headers instanceof HeaderMap, 'Response.headers should be HeaderMap');
18 assert_equals(response.headers.size, 3, 'Response.headers.size should match' ); 18 assert_equals(response.headers.size, 3, 'Response.headers.size should match' );
19 // Note: detailed behavioral tests for HeaderMap are in another test, 19 // Note: detailed behavioral tests for HeaderMap are in another test,
20 // http/tests/serviceworker/headermap.html. 20 // http/tests/serviceworker/headermap.html.
21 21
22 }, 'Response in ServiceWorkerGlobalScope'); 22 }, 'Response in ServiceWorkerGlobalScope');
OLDNEW
« no previous file with comments | « no previous file | Source/modules/serviceworkers/Response.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698