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

Unified Diff: chrome/test/data/notifications/notification_tester.html

Issue 802753002: Revert of "Call the Close() event on a Notification when it's being replaced." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/notifications/notification_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/notifications/notification_tester.html
diff --git a/chrome/test/data/notifications/notification_tester.html b/chrome/test/data/notifications/notification_tester.html
index ff7ac2d450005fddb0cc41069a2287233c1559c1..abc17fd0721e85051f25c805db92022fb236b890 100644
--- a/chrome/test/data/notifications/notification_tester.html
+++ b/chrome/test/data/notifications/notification_tester.html
@@ -7,8 +7,6 @@ Also can be used to request permission for notifications.
// Array of all notifications this page has created.
var g_notifications = [];
-// Object of notifications which have been closed.
-var g_closed_notifications = {};
// Whether the site has requested and been granted permission.
var g_permissionGranted = false;
@@ -66,33 +64,20 @@ function onPermissionGranted() {
// back on error. If |waitForDisplay| is true, the response will not be sent
// until the notification is actually displayed.
function createNotificationHelper(note, waitForDisplay) {
- var notification_id = g_notifications.length;
-
- g_notifications.push(note);
- g_closed_notifications[notification_id] = false;
-
function sendNotificationIdToTest() {
- sendResultToTest(notification_id);
+ sendResultToTest(g_notifications.length - 1);
}
-
+ g_notifications.push(note);
if (waitForDisplay)
note.onshow = sendNotificationIdToTest;
note.onerror = function() {
sendResultToTest(-1);
}
- note.onclose = function() {
- g_closed_notifications[notification_id] = true;
- }
if (!waitForDisplay)
sendNotificationIdToTest();
}
-// Returns whether the notification with Id has been closed.
-function hasBeenClosed(notification_id) {
- sendResultToTest(g_closed_notifications[notification_id]);
-}
-
// Sends a result back to the main test logic.
function sendResultToTest(result) {
// Convert the result to a string.
« no previous file with comments | « chrome/browser/notifications/notification_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698