|
OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 // These string constants should be consistent with those in | |
6 // chrome/browser/extensions/api/command_line_private/. | |
7 var kTestCommandLineSwitch = 'command-line-private-api-test-foo'; | |
8 var kEmptySwitchName = 'Switch name is empty.'; | |
9 | |
10 var kNonExistingSwitch = 'foo-bar-non-existing-switch'; | |
11 | |
12 var pass = chrome.test.callbackPass; | |
13 var fail = chrome.test.callbackFail; | |
14 var assertEq = chrome.test.assertEq; | |
15 | |
16 chrome.tests.runTests([ | |
17 | |
18 function testHaveSwitch() { | |
19 chrome.commandLinePrivate.hasSwitch(kTestCommandLineSwitch, | |
20 pass(function(result) { | |
21 assertEq(result, true); | |
not at google - send to devlin
2013/04/15 12:20:15
assertTrue(result)?
方觉(Fang Jue)
2013/04/15 23:25:03
Done.
| |
22 })); | |
23 }, | |
24 | |
25 function testNotHaveSwitch() { | |
26 chrome.commandLinePrivate.hasSwitch(kNonExistingSwitch, | |
27 pass(function(result) { | |
28 assertEq(result, false); | |
not at google - send to devlin
2013/04/15 12:20:15
assertFalse(result)?
方觉(Fang Jue)
2013/04/15 23:25:03
Done.
| |
29 })); | |
30 }, | |
31 | |
32 function testInvalidArgs() { | |
33 chrome.commandLinePrivate.hasSwitch('', fail(kEmptySwitchName)); | |
34 } | |
35 | |
36 ]); | |
OLD | NEW |