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

Unified 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: Address nits 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/search_engines_private/test.js
diff --git a/chrome/test/data/extensions/api_test/search_engines_private/test.js b/chrome/test/data/extensions/api_test/search_engines_private/test.js
new file mode 100644
index 0000000000000000000000000000000000000000..574be8fb8464be96d515a37bd1f5119549cd0500
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/search_engines_private/test.js
@@ -0,0 +1,33 @@
+// Copyright 2015 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.
+
+// This just tests the interface. It does not test for specific results, only
+// that callbacks are correctly invoked, expected parameters are correct,
+// and failures are detected.
+
+function callbackResult(result) {
+ if (chrome.runtime.lastError)
+ chrome.test.fail(chrome.runtime.lastError.message);
+ else if (result == false)
+ chrome.test.fail('Failed: ' + result);
+}
+
+var availableTests = [
+ function setDefaultSearchEngine() {
+ chrome.searchEnginesPrivate.getDefaultSearchEngines(function(engines) {
+ chrome.searchEnginesPrivate.setDefaultSearchEngine(
+ engines[engines.length - 1].guid);
+ chrome.searchEnginesPrivate.getDefaultSearchEngines(function(newEngines) {
+ chrome.test.assertTrue(newEngines[newEngines.length - 1].isDefault);
+ chrome.test.succeed();
+ });
+ });
+ },
+];
+
+var testToRun = window.location.search.substring(1);
+chrome.test.runTests(availableTests.filter(function(op) {
+ return op.name == testToRun;
+}));
+

Powered by Google App Engine
This is Rietveld 408576698