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

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

Issue 287363004: ServiceWorker: support Response.{status,statusText,headers} [blink] (2/3) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/serviceworker/resources/response-worker.js
diff --git a/LayoutTests/http/tests/serviceworker/resources/response-worker.js b/LayoutTests/http/tests/serviceworker/resources/response-worker.js
new file mode 100644
index 0000000000000000000000000000000000000000..a55dba64db4f9ad299827d7a5d3a708309dae0cf
--- /dev/null
+++ b/LayoutTests/http/tests/serviceworker/resources/response-worker.js
@@ -0,0 +1,22 @@
+importScripts('worker-test-helpers.js');
+
+test(function() {
+ var headers = new HeaderMap;
+ headers.set('Content-Language', 'ja');
+ headers.set('Content-Type', 'text/html; charset=UTF-8');
+ headers.set('X-ServiceWorker-Test', 'response test field');
+
+ var response = new Response({
+ status: 303,
+ statusText: 'See Other',
+ headers: headers
+ });
+
+ assert_equals(response.status, 303, 'Response.status should match');
+ assert_equals(response.statusText, 'See Other', 'Response.statusText should match');
+ assert_true(response.headers instanceof HeaderMap, 'Response.headers should be HeaderMap');
+ assert_equals(response.headers.size, 3, 'Response.headers.size should match');
+ // Note: detailed behavioral tests for HeaderMap are in another test,
+ // http/tests/serviceworker/headermap.html.
+
+}, 'Response in ServiceWorkerGlobalScope');
« no previous file with comments | « LayoutTests/http/tests/serviceworker/resources/headermap-worker.js ('k') | LayoutTests/http/tests/serviceworker/response.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698