| OLD | NEW |
| 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 Loading... |
| 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'); |
| OLD | NEW |