OLD | NEW |
1 // Tests that the notification available after the given operation is executed | 1 // Tests that the notification available after the given operation is executed |
2 // accurately reflects the data attributes of several types with which the | 2 // accurately reflects the data attributes of several types with which the |
3 // notification was created in the document. | 3 // notification was created in the document. |
4 function runNotificationDataReflectionTest(test, notificationOperation) { | 4 function runNotificationDataReflectionTest(test, notificationOperation) { |
5 var scope = 'resources/scope/' + location.pathname, | 5 var scope = 'resources/scope/' + location.pathname, |
6 script = 'resources/instrumentation-service-worker.js'; | 6 script = 'instrumentation-service-worker.js'; |
7 | 7 |
8 // Set notification's data of several types to a structured clone of options
's data. | 8 // Set notification's data of several types to a structured clone of options
's data. |
9 var notificationDataList = new Array( | 9 var notificationDataList = new Array( |
10 true, // Check Boolean type | 10 true, // Check Boolean type |
11 1024, // Check Number type | 11 1024, // Check Number type |
12 Number.NaN, // Check Number.NaN type | 12 Number.NaN, // Check Number.NaN type |
13 'any data', // Check String type | 13 'any data', // Check String type |
14 null, // Check null | 14 null, // Check null |
15 new Array('Saab', 'Volvo', 'BMW'), // Check Array type | 15 new Array('Saab', 'Volvo', 'BMW'), // Check Array type |
16 { first: 'first', second: 'second' } // Check object | 16 { first: 'first', second: 'second' } // Check object |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 if (++pos < notificationDataList.length) | 61 if (++pos < notificationDataList.length) |
62 assertNotificationDataReflects(pos); | 62 assertNotificationDataReflects(pos); |
63 else | 63 else |
64 test.done(); | 64 test.done(); |
65 }); | 65 }); |
66 | 66 |
67 assertNotificationDataReflects(0); | 67 assertNotificationDataReflects(0); |
68 }).catch(unreached_rejection(test)); | 68 }).catch(unreached_rejection(test)); |
69 }); | 69 }); |
70 } | 70 } |
OLD | NEW |