| OLD | NEW |
| 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 | 4 |
| 5 const notifications = chrome.notifications; | 5 const notifications = chrome.notifications; |
| 6 | 6 |
| 7 function arrayEquals(a, b) { | 7 function arrayEquals(a, b) { |
| 8 if (a === b) return true; | 8 if (a === b) return true; |
| 9 if (a == null || b == null) return false; | 9 if (a == null || b == null) return false; |
| 10 if (a.length !== b.length) return false; | 10 if (a.length !== b.length) return false; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 var basicNotificationOptions = { | 117 var basicNotificationOptions = { |
| 118 type: "basic", | 118 type: "basic", |
| 119 title: "Basic title", | 119 title: "Basic title", |
| 120 message: "Basic message", | 120 message: "Basic message", |
| 121 iconUrl: red_dot, | 121 iconUrl: red_dot, |
| 122 buttons: [{title: "Button"}] | 122 buttons: [{title: "Button"}] |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 // Create a notification. | 125 // Create a notification. |
| 126 create("testId", basicNotificationOptions) | 126 create("testId", basicNotificationOptions) |
| 127 // Then update a few items | 127 // Then update a few items |
| 128 .then(function () { | 128 .then(function() { |
| 129 return update("testId", { | 129 return update("testId", { |
| 130 title: "Changed!", | 130 title: "Changed!", |
| 131 message: "Too late! The show ended yesterday" | 131 message: "Too late! The show ended yesterday" |
| 132 }); | 132 }); |
| 133 }) | 133 }) |
| 134 // Then update a few more items | 134 // Then update a few more items |
| 135 .then(function () { return update("testId", {priority:2, buttons: []}); }) | 135 .then(function() { |
| 136 // The test will continue in C++, checking that all the updates "took" | 136 return update("testId", {priority: 2, buttons: [{title: "NewButton"}]}); |
| 137 .then(chrome.test.succeed, chrome.test.fail); | 137 }) |
| 138 // The test will continue in C++, checking that all the updates "took" |
| 139 .then(chrome.test.succeed, chrome.test.fail); |
| 138 }; | 140 }; |
| 139 | 141 |
| 140 | 142 |
| 141 chrome.test.runTests([testPartialUpdate]); | 143 chrome.test.runTests([testPartialUpdate]); |
| OLD | NEW |