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

Side by Side Diff: LayoutTests/http/tests/notifications/serviceworker-notificationclick-event-reflection.html

Issue 1321643002: Fix notifications tests' use of assert_object_equals (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address review comments Created 5 years, 3 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
« no previous file with comments | « LayoutTests/http/tests/notifications/serviceworker-notificationclick-event-data-reflection.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Notifications: Property reflection in the "notificationclick" event.< /title> 4 <title>Notifications: Property reflection in the "notificationclick" event.< /title>
5 <script src="../resources/testharness.js"></script> 5 <script src="../resources/testharness.js"></script>
6 <script src="../resources/testharnessreport.js"></script> 6 <script src="../resources/testharnessreport.js"></script>
7 <script src="../serviceworker/resources/test-helpers.js"></script> 7 <script src="../serviceworker/resources/test-helpers.js"></script>
8 <script src="resources/test-helpers.js"></script> 8 <script src="resources/test-helpers.js"></script>
9 </head> 9 </head>
10 <body> 10 <body>
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 assert_true(event.data.success, 'The notification must hav e been displayed.'); 61 assert_true(event.data.success, 'The notification must hav e been displayed.');
62 testRunner.simulateWebNotificationClick(scope); 62 testRunner.simulateWebNotificationClick(scope);
63 return; 63 return;
64 } 64 }
65 65
66 // (3) Listen for confirmation from the Service Worker that th e 66 // (3) Listen for confirmation from the Service Worker that th e
67 // notification has been clicked on. Make sure that all proper ties 67 // notification has been clicked on. Make sure that all proper ties
68 // set on the Notification object are as expected. 68 // set on the Notification object are as expected.
69 assert_equals(event.data.command, 'click', 'The notification w as expected to be clicked.'); 69 assert_equals(event.data.command, 'click', 'The notification w as expected to be clicked.');
70 70
71 options.actions = options.actions.slice(0, Notification.maxAct ions);
71 Object.keys(options).forEach(function(key) { 72 Object.keys(options).forEach(function(key) {
72 if (key == 'actions') 73 if (typeof options[key] == 'object')
73 assert_object_equals(event.data.notification.actions, options.actions.slice(0, Notification.maxActions)); 74 assert_object_equals(event.data.notification[key], opt ions[key], 'The ' + key + ' field must be the same.');
74 else 75 else
75 assert_object_equals(event.data.notification[key], opt ions[key], 'The ' + key + ' field must be the same.'); 76 assert_equals(event.data.notification[key], options[ke y], 'The ' + key + ' field must be the same.');
76 }); 77 });
77 78
78 test.done(); 79 test.done();
79 }); 80 });
80 }).catch(unreached_rejection(test)); 81 }).catch(unreached_rejection(test));
81 82
82 }, 'Clicking on a notification displayed by a Service Worker the notificat ionclick event.'); 83 }, 'Clicking on a notification displayed by a Service Worker the notificat ionclick event.');
83 </script> 84 </script>
84 </body> 85 </body>
85 </html> 86 </html>
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/notifications/serviceworker-notificationclick-event-data-reflection.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698