Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / chrome / test / data / extensions / api_test / notification_provider / events / test.js
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
3 // found in the LICENSE file.
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);
18
19   chrome.notificationProvider.onCreated.addListener(function(senderId,
20                                                              notificationId,
21                                                              options) {
22     var str = notificationId.split("-");
23     chrome.test.assertEq(idString, str[1]);
24     chrome.test.assertEq(options.title, content.title);
25     chrome.test.assertEq(options.message, content.message);
26     chrome.test.succeed();
27   });
28 };
29
30 chrome.test.runTests([ testOnCreated ]);