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

Side by Side Diff: chrome/test/data/extensions/api_test/notification_provider/events/test.js

Issue 441753002: Route newly created notifications to notification provider API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments, deleted browser tests for onUpdated and onCleared Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/test/data/extensions/api_test/notification_provider/events/manifest.json ('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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 var testEvents = function() { 4
5 var idString = "id1";
6
7 function testOnCreated() {
8
9 var content = {
10 type: "basic",
11 iconUrl: "icon.png",
12 title: "Title",
13 message: "This is the message."
14 };
15
16 var createCallback = function (id) {}
17 chrome.notifications.create(idString, content, createCallback);
5 18
6 chrome.notificationProvider.onCreated.addListener(function(senderId, 19 chrome.notificationProvider.onCreated.addListener(function(senderId,
7 notificationId, 20 notificationId,
8 options) { 21 options) {
9 chrome.test.succeed(); 22 var str = notificationId.split("-");
10 }); 23 chrome.test.assertEq(idString, str[1]);
11 24 chrome.test.assertEq(options.title, content.title);
12 chrome.notificationProvider.onUpdated.addListener(function(senderId, 25 chrome.test.assertEq(options.message, content.message);
13 notificationId,
14 options) {
15 chrome.test.succeed();
16 });
17
18 chrome.notificationProvider.onCleared.addListener(function(senderId,
19 notificationId) {
20 chrome.test.succeed(); 26 chrome.test.succeed();
21 }); 27 });
22 }; 28 };
23 29
24 chrome.test.runTests([ testEvents ]); 30 chrome.test.runTests([ testOnCreated ]);
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/notification_provider/events/manifest.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698