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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/google_now/unit_test/background_globals.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/google_now/unit_test/background.gtestjs
diff --git a/chrome/browser/resources/google_now/unit_test/background.gtestjs b/chrome/browser/resources/google_now/unit_test/background.gtestjs
new file mode 100644
index 0000000000000000000000000000000000000000..97b8c21a9de7430ab4a5b74c65a1de343f9d09e0
--- /dev/null
+++ b/chrome/browser/resources/google_now/unit_test/background.gtestjs
@@ -0,0 +1,42 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * Test fixture for ../background.js.
+ * @constructor
+ * @extends {testing.Test}
+ */
+function GoogleNowBackgroundUnitTest () {
+ testing.Test.call(this);
+}
+
+GoogleNowBackgroundUnitTest.prototype = {
+ __proto__: testing.Test.prototype,
+
+ /** @override */
+ extraLibraries: [
+ 'background_globals.js',
+ '../background.js'
+ ]
+};
+
+TEST_F('GoogleNowBackgroundUnitTest', 'AreTasksConflicting', function() {
+ function testTaskPair(newTaskName, scheduledTaskName, expected) {
+ assertTrue(areTasksConflicting(newTaskName, scheduledTaskName) == expected,
+ '(' + newTaskName + ', ' + scheduledTaskName + ')');
+ }
+
+ 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.
+ testTaskPair(UPDATE_CARDS_TASK_NAME, DISMISS_CARD_TASK_NAME, false);
+ testTaskPair(UPDATE_CARDS_TASK_NAME, RETRY_DISMISS_TASK_NAME, false);
+
+ testTaskPair(DISMISS_CARD_TASK_NAME, UPDATE_CARDS_TASK_NAME, false);
+ testTaskPair(DISMISS_CARD_TASK_NAME, DISMISS_CARD_TASK_NAME, false);
+ testTaskPair(DISMISS_CARD_TASK_NAME, RETRY_DISMISS_TASK_NAME, false);
+
+ testTaskPair(RETRY_DISMISS_TASK_NAME, UPDATE_CARDS_TASK_NAME, true);
+ testTaskPair(RETRY_DISMISS_TASK_NAME, DISMISS_CARD_TASK_NAME, true);
+ testTaskPair(RETRY_DISMISS_TASK_NAME, RETRY_DISMISS_TASK_NAME, true);
+});
+
« 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