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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/notifications/resources/notification-data-reflection-test.js

Issue 1907443007: Use promises in notifications tests and enable controlling the page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Address peter's comments. Created 4 years, 8 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 // 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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698