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

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

Issue 1926813004: Replace assert_promise_rejects with upstream promise_rejects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove all testharness-helpers.js references Created 4 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 unified diff | Download patch
OLDNEW
1 importScripts('../../serviceworker/resources/worker-testharness.js'); 1 importScripts('../../serviceworker/resources/worker-testharness.js');
2 importScripts('/resources/testharness-helpers.js');
3 2
4 function createPushMessageData(data) 3 function createPushMessageData(data)
5 { 4 {
6 // The PushMessageData object does not expose a constructor, but we can get an object 5 // The PushMessageData object does not expose a constructor, but we can get an object
7 // initialized with our data by constructing a PushEvent. 6 // initialized with our data by constructing a PushEvent.
8 return new PushEvent('PushEvent', { data: data }).data; 7 return new PushEvent('PushEvent', { data: data }).data;
9 } 8 }
10 9
11 test(function() { 10 test(function() {
12 const textContents = 'Hello, world!'; 11 const textContents = 'Hello, world!';
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 assert_throws(null, () => new PushMessageData(new ArrayBuffer(8))); 101 assert_throws(null, () => new PushMessageData(new ArrayBuffer(8)));
103 102
104 }, 'PushMessageData should not be constructable.'); 103 }, 'PushMessageData should not be constructable.');
105 104
106 test(function() { 105 test(function() {
107 var s = "e\u0328"; // 'e' + COMBINING OGONEK 106 var s = "e\u0328"; // 'e' + COMBINING OGONEK
108 var data = createPushMessageData(s); 107 var data = createPushMessageData(s);
109 assert_equals(data.text(), s, 'String should not be NFC-normalized.'); 108 assert_equals(data.text(), s, 'String should not be NFC-normalized.');
110 109
111 }, 'PushEventInit data is not normalized'); 110 }, 'PushEventInit data is not normalized');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698