OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 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 // This just tests the interface. It does not test for specific results, only | |
6 // that callbacks are correctly invoked, expected parameters are correct, | |
7 // and failures are detected. | |
8 | |
9 function callbackResult(result) { | |
10 if (chrome.runtime.lastError) | |
11 chrome.test.fail(chrome.runtime.lastError.message); | |
12 else if (result == false) | |
13 chrome.test.fail('Failed: ' + result); | |
14 } | |
15 | |
16 var availableTests = [ | |
17 function setSelectedSearchEngine() { | |
18 chrome.searchEnginesPrivate.getDefaultSearchEngines(function(engines) { | |
19 chrome.searchEnginesPrivate.setSelectedSearchEngine( | |
20 engines[engines.length - 1].guid); | |
21 chrome.searchEnginesPrivate.getDefaultSearchEngines(function(newEngines) { | |
22 chrome.test.assertTrue(newEngines[newEngines.length - 1].isSelected); | |
23 chrome.test.succeed(); | |
24 }); | |
25 }); | |
stevenjb
2015/04/23 17:26:01
We should test the changed event also.
Oren Blasberg
2015/04/23 21:31:51
Done.
| |
26 }, | |
27 ]; | |
28 | |
29 var testToRun = window.location.search.substring(1); | |
30 chrome.test.runTests(availableTests.filter(function(op) { | |
31 return op.name == testToRun; | |
32 })); | |
33 | |
OLD | NEW |