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

Side by Side Diff: chrome/test/data/extensions/api_test/search_engines_private/test.js

Issue 1096143003: Add chrome.searchEnginesPrivate API and Search Settings page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename some things on the idl to match latest api spec. Created 5 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 unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698