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

Unified Diff: LayoutTests/http/tests/serviceworker/resources/fetch-body-mixin-worker.js

Issue 555443002: [Fetch API] Put body members directly on Response/Request (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incorporated yhirano's comment 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/serviceworker/resources/fetch-body-mixin-worker.js
diff --git a/LayoutTests/http/tests/serviceworker/resources/fetch-body-stream-worker.js b/LayoutTests/http/tests/serviceworker/resources/fetch-body-mixin-worker.js
similarity index 88%
rename from LayoutTests/http/tests/serviceworker/resources/fetch-body-stream-worker.js
rename to LayoutTests/http/tests/serviceworker/resources/fetch-body-mixin-worker.js
index f3f47f9cf305dfef135da96456efc603ddaf5841..f53811da0ed62fc2a05f2722232e3175918ef3ac 100644
--- a/LayoutTests/http/tests/serviceworker/resources/fetch-body-stream-worker.js
+++ b/LayoutTests/http/tests/serviceworker/resources/fetch-body-mixin-worker.js
@@ -15,8 +15,8 @@ function doFetchTwiceTest(port) {
fetch('doctype.html')
.then(function(response) {
- var p1 = response.body.asText();
- var p2 = response.body.asText();
+ var p1 = response.text();
+ var p2 = response.text();
p1.then(function(obj) {
p1Out = obj;
@@ -41,7 +41,7 @@ function doFetchTwiceTest(port) {
function doArrayBufferTest(port) {
fetch('doctype.html')
.then(function(response) {
- response.body.asArrayBuffer()
+ response.arrayBuffer()
.then(function(b) {
port.postMessage('ArrayBuffer: ' + b.byteLength);
doFetchTwiceTest(port);
@@ -52,7 +52,7 @@ function doArrayBufferTest(port) {
function doBlobTest(port) {
fetch('doctype.html')
.then(function(response) {
- response.body.asBlob()
+ response.blob()
.then(function(blob) {
port.postMessage('Blob: ' + blob.size + " : " + blob.type);
doArrayBufferTest(port);
@@ -63,7 +63,7 @@ function doBlobTest(port) {
function doJSONFailedTest(port) {
fetch('doctype.html')
.then(function(response) {
- response.body.asJSON()
+ response.json()
.catch(function(e) {
port.postMessage('JSON: ' + e.name);
doBlobTest(port);
@@ -74,7 +74,7 @@ function doJSONFailedTest(port) {
function doJSONTest(port) {
fetch('simple.json')
.then(function(response) {
- response.body.asJSON()
+ response.json()
.then(function(json) {
port.postMessage('JSON: ' + json['a'] + ' ' + json['b']);
doJSONFailedTest(port);
@@ -85,7 +85,7 @@ function doJSONTest(port) {
function doTextTest(port) {
fetch('doctype.html')
.then(function(response) {
- response.body.asText()
+ response.text()
.then(function(txt) {
port.postMessage('Text: ' + txt);
doJSONTest(port);

Powered by Google App Engine
This is Rietveld 408576698