Chromium Code Reviews| Index: chrome/test/data/extensions/api_test/notification_provider/events/test.js |
| diff --git a/chrome/test/data/extensions/api_test/notification_provider/events/test.js b/chrome/test/data/extensions/api_test/notification_provider/events/test.js |
| index 215699db68f71df9265eb195dcb99ccb159258d0..f4ae525bc4629cabf9eb9a884cbce0e36ed6be6e 100644 |
| --- a/chrome/test/data/extensions/api_test/notification_provider/events/test.js |
| +++ b/chrome/test/data/extensions/api_test/notification_provider/events/test.js |
| @@ -1,24 +1,48 @@ |
| // Copyright 2014 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. |
| -var testEvents = function() { |
| + |
| +var idString = "id1"; |
| + |
| +function testOnCreated() { |
| + |
|
dewittj
2014/08/13 18:30:17
nit: no blank line
|
| + var content = { |
| + type: "basic", |
| + iconUrl: "icon.png", |
| + title: "Title", |
| + message: "This is the message." |
| + }; |
| + |
| + var createCallback = function (id) {} |
| + chrome.notifications.create(idString, content, createCallback); |
| chrome.notificationProvider.onCreated.addListener(function(senderId, |
| notificationId, |
| options) { |
| + var str = notificationId.split("-"); |
| + chrome.test.assertEq(idString, str[1]); |
| + chrome.test.assertEq(options.title, content.title); |
| + chrome.test.assertEq(options.message, content.message); |
| chrome.test.succeed(); |
| }); |
| + chrome.test.succeed(); |
| +}; |
| +function testOnUpdated() { |
| chrome.notificationProvider.onUpdated.addListener(function(senderId, |
| notificationId, |
| options) { |
| chrome.test.succeed(); |
| }); |
| + chrome.test.succeed(); |
| +} |
| +function testOnCleared() { |
| chrome.notificationProvider.onCleared.addListener(function(senderId, |
| notificationId) { |
| chrome.test.succeed(); |
| }); |
| -}; |
| + chrome.test.succeed(); |
| +} |
| -chrome.test.runTests([ testEvents ]); |
| +chrome.test.runTests([ testOnCreated, testOnUpdated, testOnCleared ]); |