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

Unified Diff: chrome/test/data/webui/settings/test_search_engines_browser_proxy.js

Issue 2507363002: MD Settings: Add Hotword (OK Google) section to search_page (Closed)
Patch Set: Nit Created 4 years, 1 month 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
« no previous file with comments | « chrome/test/data/webui/settings/search_page_test.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/settings/test_search_engines_browser_proxy.js
diff --git a/chrome/test/data/webui/settings/test_search_engines_browser_proxy.js b/chrome/test/data/webui/settings/test_search_engines_browser_proxy.js
index 1055eefc91dc75580114722315b15ea41f1ce44d..a42bb95ff89360a8954e5bfe9c77f696c35fbf9b 100644
--- a/chrome/test/data/webui/settings/test_search_engines_browser_proxy.js
+++ b/chrome/test/data/webui/settings/test_search_engines_browser_proxy.js
@@ -21,10 +21,25 @@ cr.define('settings_search', function() {
'searchEngineEditStarted',
'setDefaultSearchEngine',
'validateSearchEngineInput',
+ 'getHotwordInfo',
+ 'setHotwordSearchEnabled',
]);
+ /** @type {boolean} */
+ this.hotwordSearchEnabled = false;
+
/** @private {!SearchEnginesInfo} */
this.searchEnginesInfo_ = {defaults: [], others: [], extensions: []};
+
+ /** @private {!SearchPageHotwordInfo} */
+ this.hotwordInfo_ = {
+ allowed: true,
+ enabled: false,
+ alwaysOn: true,
+ errorMessage: '',
+ userName: 'user@test.org',
+ historyEnabled: false,
+ };
};
TestSearchEnginesBrowserProxy.prototype = {
@@ -55,14 +70,6 @@ cr.define('settings_search', function() {
this.methodCalled('searchEngineEditCompleted');
},
- /**
- * Sets the response to be returned by |getSearchEnginesList|.
- * @param {!SearchEnginesInfo}
- */
- setSearchEnginesInfo: function(searchEnginesInfo) {
- this.searchEnginesInfo_ = searchEnginesInfo;
- },
-
/** @override */
getSearchEnginesList: function() {
this.methodCalled('getSearchEnginesList');
@@ -74,6 +81,37 @@ cr.define('settings_search', function() {
this.methodCalled('validateSearchEngineInput');
return Promise.resolve(true);
},
+
+ /** @override */
+ getHotwordInfo: function() {
+ this.methodCalled('getHotwordInfo');
+ return Promise.resolve(this.hotwordInfo_);
+ },
+
+ /** @override */
+ setHotwordSearchEnabled: function(enabled) {
+ this.hotwordSearchEnabled = enabled;
+ this.hotwordInfo_.enabled = true;
+ this.hotwordInfo_.historyEnabled = this.hotwordInfo_.alwaysOn;
+ this.methodCalled('setHotwordSearchEnabled');
+ },
+
+ /**
+ * Sets the response to be returned by |getSearchEnginesList|.
+ * @param {!SearchEnginesInfo} searchEnginesInfo
+ */
+ setSearchEnginesInfo: function(searchEnginesInfo) {
+ this.searchEnginesInfo_ = searchEnginesInfo;
+ },
+
+ /**
+ * Sets the response to be returned by |getSearchEnginesList|.
+ * @param {!SearchPageHotwordInfo} hotwordInfo
+ */
+ setHotwordInfo: function(hotwordInfo) {
+ this.hotwordInfo_ = hotwordInfo;
+ cr.webUIListenerCallback('hotword-info-update', this.hotwordInfo_);
+ },
};
/**
« no previous file with comments | « chrome/test/data/webui/settings/search_page_test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698