OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 /** | 5 /** |
6 * Test fixture for background.js. | 6 * Test fixture for background.js. |
7 * @constructor | 7 * @constructor |
8 * @extends {testing.Test} | 8 * @extends {testing.Test} |
9 */ | 9 */ |
10 function GoogleNowBackgroundUnitTest () { | 10 function GoogleNowBackgroundUnitTest () { |
11 testing.Test.call(this); | 11 testing.Test.call(this); |
12 } | 12 } |
13 | 13 |
14 GoogleNowBackgroundUnitTest.prototype = { | 14 GoogleNowBackgroundUnitTest.prototype = { |
15 __proto__: testing.Test.prototype, | 15 __proto__: testing.Test.prototype, |
16 | 16 |
17 /** @override */ | 17 /** @override */ |
18 extraLibraries: [ | 18 extraLibraries: [ |
| 19 'common_test_util.js', |
19 'background_test_util.js', | 20 'background_test_util.js', |
20 'background.js' | 21 'background.js' |
21 ] | 22 ] |
22 }; | 23 }; |
23 | 24 |
24 TEST_F('GoogleNowBackgroundUnitTest', 'AreTasksConflicting', function() { | 25 TEST_F('GoogleNowBackgroundUnitTest', 'AreTasksConflicting', function() { |
25 function testTaskPair(newTaskName, scheduledTaskName, expected) { | 26 function testTaskPair(newTaskName, scheduledTaskName, expected) { |
26 assertTrue(areTasksConflicting(newTaskName, scheduledTaskName) == expected, | 27 assertTrue(areTasksConflicting(newTaskName, scheduledTaskName) == expected, |
27 '(' + newTaskName + ', ' + scheduledTaskName + ')'); | 28 '(' + newTaskName + ', ' + scheduledTaskName + ')'); |
28 } | 29 } |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 chromeTabsCreateSavedArgs.match(eqJSON({url: testActionUrl})), | 519 chromeTabsCreateSavedArgs.match(eqJSON({url: testActionUrl})), |
519 chromeTabsCreateSavedArgs.match(ANYTHING)). | 520 chromeTabsCreateSavedArgs.match(ANYTHING)). |
520 will(invokeCallback(chromeTabsCreateSavedArgs, 1, testCreatedTab)); | 521 will(invokeCallback(chromeTabsCreateSavedArgs, 1, testCreatedTab)); |
521 this.mockApis.expects(once()).chrome_windows_create( | 522 this.mockApis.expects(once()).chrome_windows_create( |
522 eqJSON({url: testActionUrl, focused: true})); | 523 eqJSON({url: testActionUrl, focused: true})); |
523 | 524 |
524 // Invoking the tested function. | 525 // Invoking the tested function. |
525 onNotificationClicked( | 526 onNotificationClicked( |
526 testNotificationId, this.mockLocalFunctions.functions().selector); | 527 testNotificationId, this.mockLocalFunctions.functions().selector); |
527 }); | 528 }); |
OLD | NEW |