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

Side by Side Diff: chrome/browser/resources/google_now/background_unittest.gtestjs

Issue 23477006: Unit tests for utility.js (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing unit test + more arv@ comments Created 7 years, 3 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
OLDNEW
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
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 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/google_now/background_test_util.js ('k') | chrome/browser/resources/google_now/common_test_util.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698