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

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

Issue 556563002: Adding ArrayBuffer support to ServiceWorker Response and tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Uncommented assert Created 6 years, 3 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
(Empty)
1 importScripts('worker-test-harness.js');
2
3 promise_test(function() {
4 var response = new Response("test string");
5 assert_equals(response.headers.get('Content-Type'), 'text/plain;charset=UTF-8' );
jsbell 2014/09/08 20:32:48 style: wrap to 80 characters See: http://www.chro
jsbell 2014/09/08 20:32:48 Always have an assertion message; ideally, phrased
dmurph 2014/09/08 20:59:29 Done.
dmurph 2014/09/08 20:59:30 Done.
6 return response.body.asText().then(function(text) {
jsbell 2014/09/08 20:32:48 style: wrap before .then
dmurph 2014/09/08 20:59:30 Done.
7 assert_equals(text, "test string");
jsbell 2014/09/08 20:32:48 Add message to assertion
dmurph 2014/09/08 20:59:30 Done.
8 });
9 }, 'Behavior of Response with string content.');
10
11 promise_test(function() {
12 var intView = new Int32Array([0,1,2,3,4,5,6,7,8,9]);
13 var buffer = intView.buffer;
14
15 var response = new Response(buffer);
16 assert_false(response.headers.has('Content-Type'));
jsbell 2014/09/08 20:32:48 Add message to assertion
dmurph 2014/09/08 20:59:29 Done.
17 return response.body.asArrayBuffer().then(function(buffer) {
jsbell 2014/09/08 20:32:48 style: wrap before the .then
dmurph 2014/09/08 20:59:30 Done.
18 var resultIntView = new Int32Array(buffer);
jsbell 2014/09/08 20:32:48 nit: extra space before the =
dmurph 2014/09/08 20:59:29 Done.
19 assert_array_equals(resultIntView, [0,1,2,3,4,5,6,7,8,9]);
jsbell 2014/09/08 20:32:48 Add message to assertion
dmurph 2014/09/08 20:59:30 Done.
20 });
21 }, 'Behavior of Response with arraybuffer content.');
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/response-content.html » ('j') | Source/modules/serviceworkers/Response.idl » ('J')

Powered by Google App Engine
This is Rietveld 408576698