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

Unified Diff: chrome/test/data/webui/settings/search_page_test.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
Index: chrome/test/data/webui/settings/search_page_test.js
diff --git a/chrome/test/data/webui/settings/search_page_test.js b/chrome/test/data/webui/settings/search_page_test.js
index fec19629c506957a61a5d396b3d7457c9b71e56c..95d3c82d55462fe38103480f2e9986fe070ad2db 100644
--- a/chrome/test/data/webui/settings/search_page_test.js
+++ b/chrome/test/data/webui/settings/search_page_test.js
@@ -98,6 +98,56 @@ cr.define('settings_search_page', function() {
assertTrue(!!page.$$('extension-controlled-indicator'));
});
});
+
+ // Tests the UI when Hotword 'alwaysOn' is true.
+ test('HotwordAlwaysOn', function() {
+ return browserProxy.whenCalled('getHotwordInfo').then(function() {
+ Polymer.dom.flush();
+ assertTrue(page.hotwordInfo_.allowed);
+ assertTrue(page.hotwordInfo_.alwaysOn);
+ assertFalse(page.hotwordInfo_.enabled);
+ assertFalse(browserProxy.hotwordSearchEnabled);
+ assertFalse(page.hotwordSearchEnablePref_.value);
+
+ var checkbox = page.$$('#hotwordSearchEnable');
+ assertTrue(!!checkbox);
+ assertFalse(checkbox.disabled);
+ assertFalse(checkbox.checked);
+ MockInteractions.tap(checkbox.$.checkbox);
+ Polymer.dom.flush();
+ return browserProxy.whenCalled('setHotwordSearchEnabled');
+ }).then(function() {
+ assertTrue(browserProxy.hotwordSearchEnabled);
+ });
+ });
+
+ // Tests the UI when Hotword 'alwaysOn' is false.
+ test('HotwordNotAlwaysOn', function() {
+ return browserProxy.whenCalled('getHotwordInfo').then(function() {
+ browserProxy.setHotwordInfo({
+ allowed: true,
+ enabled: false,
+ alwaysOn: false,
+ errorMessage: '',
+ userName: '',
+ historyEnabled: false,
+ });
+ Polymer.dom.flush();
+ assertTrue(page.hotwordInfo_.allowed);
+ assertFalse(page.hotwordInfo_.alwaysOn);
+ assertFalse(page.hotwordInfo_.enabled);
+
+ var checkbox = page.$$('#hotwordSearchEnable');
+ assertTrue(!!checkbox);
+ assertFalse(checkbox.disabled);
+ assertFalse(checkbox.checked);
+ MockInteractions.tap(checkbox.$.checkbox);
+ Polymer.dom.flush();
+ return browserProxy.whenCalled('setHotwordSearchEnabled');
+ }).then(function() {
+ assertTrue(browserProxy.hotwordSearchEnabled);
+ });
+ });
});
}

Powered by Google App Engine
This is Rietveld 408576698