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

Unified Diff: chrome/test/data/extensions/api_test/command_line/basics/test.js

Issue 14027005: Implement Command Line Private extension API (Closed) Base URL: https://src.chromium.org/svn/trunk/src/
Patch Set: rebase Created 7 years, 8 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 | « chrome/test/data/extensions/api_test/command_line/basics/manifest.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/command_line/basics/test.js
===================================================================
--- chrome/test/data/extensions/api_test/command_line/basics/test.js (revision 0)
+++ chrome/test/data/extensions/api_test/command_line/basics/test.js (revision 0)
@@ -0,0 +1,37 @@
+// Copyright 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.
+
+// These string constants should be consistent with those in
+// chrome/browser/extensions/api/command_line_private/.
+var kTestCommandLineSwitch = 'command-line-private-api-test-foo';
+var kEmptySwitchName = 'Switch name is empty.';
+
+var kNonExistingSwitch = 'foo-bar-non-existing-switch';
+
+var pass = chrome.test.callbackPass;
+var fail = chrome.test.callbackFail;
+var assertTrue = chrome.test.assertTrue;
+var assertFalse = chrome.test.assertFalse;
+
+chrome.test.runTests([
+
+ function testHaveSwitch() {
+ chrome.commandLinePrivate.hasSwitch(kTestCommandLineSwitch,
+ pass(function(result) {
+ assertTrue(result);
+ }));
+ },
+
+ function testNotHaveSwitch() {
+ chrome.commandLinePrivate.hasSwitch(kNonExistingSwitch,
+ pass(function(result) {
+ assertFalse(result);
+ }));
+ },
+
+ function testInvalidArgs() {
+ chrome.commandLinePrivate.hasSwitch('', fail(kEmptySwitchName));
+ }
+
+]);
Property changes on: chrome/test/data/extensions/api_test/command_line/basics/test.js
___________________________________________________________________
Added: svn:eol-style
+ LF
Added: svn:mime-type
+ text/javascript
« no previous file with comments | « chrome/test/data/extensions/api_test/command_line/basics/manifest.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698