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

Side by Side Diff: chrome/browser/resources/google_now/unit_test/background.gtestjs

Issue 17125003: First unit test for Google Now extension (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/resources/google_now/unit_test/background_globals.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 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 /**
6 * Test fixture for ../background.js.
7 * @constructor
8 * @extends {testing.Test}
9 */
10 function GoogleNowBackgroundUnitTest () {
11 testing.Test.call(this);
12 }
13
14 GoogleNowBackgroundUnitTest.prototype = {
15 __proto__: testing.Test.prototype,
16
17 /** @override */
18 extraLibraries: [
19 'background_globals.js',
20 '../background.js'
21 ]
22 };
23
24 TEST_F('GoogleNowBackgroundUnitTest', 'AreTasksConflicting', function() {
25 function testTaskPair(newTaskName, scheduledTaskName, expected) {
26 assertTrue(areTasksConflicting(newTaskName, scheduledTaskName) == expected,
27 '(' + newTaskName + ', ' + scheduledTaskName + ')');
28 }
29
30 testTaskPair(UPDATE_CARDS_TASK_NAME, UPDATE_CARDS_TASK_NAME, true);
Jeffrey Yasskin 2013/06/16 21:36:50 These should be indented 2 spaces, not 1, right?
vadimt 2013/06/17 18:00:18 Done.
31 testTaskPair(UPDATE_CARDS_TASK_NAME, DISMISS_CARD_TASK_NAME, false);
32 testTaskPair(UPDATE_CARDS_TASK_NAME, RETRY_DISMISS_TASK_NAME, false);
33
34 testTaskPair(DISMISS_CARD_TASK_NAME, UPDATE_CARDS_TASK_NAME, false);
35 testTaskPair(DISMISS_CARD_TASK_NAME, DISMISS_CARD_TASK_NAME, false);
36 testTaskPair(DISMISS_CARD_TASK_NAME, RETRY_DISMISS_TASK_NAME, false);
37
38 testTaskPair(RETRY_DISMISS_TASK_NAME, UPDATE_CARDS_TASK_NAME, true);
39 testTaskPair(RETRY_DISMISS_TASK_NAME, DISMISS_CARD_TASK_NAME, true);
40 testTaskPair(RETRY_DISMISS_TASK_NAME, RETRY_DISMISS_TASK_NAME, true);
41 });
42
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/google_now/unit_test/background_globals.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698