summaryrefslogtreecommitdiffstats
path: root/chrome/test/data
diff options
context:
space:
mode:
authorkkania@chromium.org <kkania@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-29 20:38:49 +0000
committerkkania@chromium.org <kkania@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-29 20:38:49 +0000
commit1e55a10eb4cd8a39edfb8c06c80b7c24e70d3fce (patch)
tree0c2f0b745a2f895872a3db0ec400447a65b8aa2b /chrome/test/data
parent5ef980a5d66feacec7bbdc9e3972bc56d7f3e420 (diff)
downloadchromium_src-1e55a10eb4cd8a39edfb8c06c80b7c24e70d3fce.zip
chromium_src-1e55a10eb4cd8a39edfb8c06c80b7c24e70d3fce.tar.gz
chromium_src-1e55a10eb4cd8a39edfb8c06c80b7c24e70d3fce.tar.bz2
Fix flaky notification.NotificationsTest.testCancelNotification test.
BUG=none TEST=none Review URL: http://codereview.chromium.org/4140010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64479 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/data')
-rw-r--r--chrome/test/data/notifications/notification_tester.html11
1 files changed, 7 insertions, 4 deletions
diff --git a/chrome/test/data/notifications/notification_tester.html b/chrome/test/data/notifications/notification_tester.html
index 7a4aec3..0b6904c 100644
--- a/chrome/test/data/notifications/notification_tester.html
+++ b/chrome/test/data/notifications/notification_tester.html
@@ -41,16 +41,19 @@ function createHTMLNotification(contentUrl, replaceId) {
sendResultToTest(createNotificationHelper(note, replaceId));
}
-// Cancels a notification with the given id. Returns 1 on success.
+// Cancels a notification with the given id. The notification must be showing,
+// as opposed to waiting to be shown in the display queue.
+// Returns '1' on success.
function cancelNotification(id) {
if (id < 0 || id > g_notifications.length) {
var errorMsg = "Attempted to cancel notification with invalid ID.\n" +
"ID: " + id + "\n# of notifications: " + g_notifications.length;
- window.domAutomationController.send(errorMsg);
- alert(errorMsg);
+ sendResultToTest(errorMsg);
+ }
+ g_notifications[id].onclose = function() {
+ sendResultToTest(1);
}
g_notifications[id].cancel();
- sendResultToTest(1);
}
// Requests permission for this origin to create notifications.