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

Unified Diff: chrome/test/data/extensions/api_test/notification/api/by_user/background.js

Issue 12313115: Take notification API out of experimental. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge conflict. Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/notification/api/by_user/background.js
diff --git a/chrome/test/data/extensions/api_test/notification/api/by_user/background.js b/chrome/test/data/extensions/api_test/notification/api/by_user/background.js
deleted file mode 100644
index e87490556bb0fa8b56e52225234ca368a5a9b3ca..0000000000000000000000000000000000000000
--- a/chrome/test/data/extensions/api_test/notification/api/by_user/background.js
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-const notification = chrome.experimental.notification;
-var theOnlyTestDone = null;
-
-var notificationData = {
- templateType: "basic",
- iconUrl: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAA" +
- "CNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHw" +
- "AAAABJRU5ErkJggg==",
- title: "Attention!",
- message: "Check out Cirque du Soleil"
-};
-
-var results = {
- FOO: false,
- BAR: true,
- BAT: false,
- BIFF: false,
- BLAT: true,
- BLOT: true
-};
-
-function createCallback(id) { }
-
-var onClosedHooks = {
- BIFF: function() {
- notification.create("BLAT", notificationData, createCallback);
- notification.create("BLOT", notificationData, createCallback);
- },
-};
-
-function onClosedListener(id, by_user) {
- if (results[id] !== by_user) {
- chrome.test.notifyFail("Notification " + id +
- " closed with bad by_user param ( "+ by_user +" )");
- return;
- }
- chrome.test.notifyPass();
- delete results[id];
-
- if (typeof onClosedHooks[id] === "function")
- onClosedHooks[id]();
-
- if (Object.keys(results).length === 0)
- theOnlyTestDone();
-}
-
-notification.onClosed.addListener(onClosedListener);
-
-function theOnlyTest() {
- theOnlyTestDone = chrome.test.callbackAdded();
-
- notification.create("FOO", notificationData, createCallback);
- notification.create("BAR", notificationData, createCallback);
- notification.create("BAT", notificationData, createCallback);
- notification.create("BIFF", notificationData, createCallback);
-}
-
-chrome.test.runTests([ theOnlyTest ]);

Powered by Google App Engine
This is Rietveld 408576698