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; |
+})); |
+ |