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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/push_messaging/resources/pushmessagedata-worker.js

Issue 1784583002: PushEvent.data should be NULL for empty payloads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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: third_party/WebKit/LayoutTests/http/tests/push_messaging/resources/pushmessagedata-worker.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/push_messaging/resources/pushmessagedata-worker.js b/third_party/WebKit/LayoutTests/http/tests/push_messaging/resources/pushmessagedata-worker.js
index 16fa54b771c909e7486a68d1267b9552749db560..39f484a890d0041ce19beb433b6d390dc5dee753 100644
--- a/third_party/WebKit/LayoutTests/http/tests/push_messaging/resources/pushmessagedata-worker.js
+++ b/third_party/WebKit/LayoutTests/http/tests/push_messaging/resources/pushmessagedata-worker.js
@@ -27,30 +27,7 @@ test(function() {
}, 'PushEvent can be initialized from ArrayBuffer, ArrayBufferView and USVStrings.');
test(function() {
- var pushMessageData = createPushMessageData();
-
- assert_equals(pushMessageData.arrayBuffer().byteLength, 0);
-
- assert_equals(pushMessageData.blob().size, 0);
- assert_equals(pushMessageData.blob().type, '');
-
- // PushMessageData.json() is specified to be identical to JSON.parse() with
- // the message's data as the argument. JSON.parse('') throws an exception,
- // so verify that calling json() without a body throws the same exception.
- try {
- pushMessageData.json();
- assert_unreached('Expected an exception to be thrown.');
- } catch (eventDataException) {
- try {
- JSON.parse('');
- assert_unreached('Expected an exception to be thrown.');
- } catch (jsonParseException) {
- assert_equals(eventDataException.name, jsonParseException.name);
- assert_equals(eventDataException.message, jsonParseException.message);
- }
- }
-
- assert_equals(pushMessageData.text().length, 0);
+ assert_equals(createPushMessageData(undefined), null);
}, 'PushMessageData is empty by default.');
dgn 2016/03/09 21:22:25 null instead of empty?
Peter Beverloo 2016/03/09 21:28:29 Done.

Powered by Google App Engine
This is Rietveld 408576698