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

Unified Diff: chrome/browser/extensions/api/hotword_private/hotword_private_apitest.cc

Issue 555423002: Expose always-on hotword preference via hotwordPrivate API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/browser/extensions/api/hotword_private/hotword_private_apitest.cc
diff --git a/chrome/browser/extensions/api/hotword_private/hotword_private_apitest.cc b/chrome/browser/extensions/api/hotword_private/hotword_private_apitest.cc
index b77f09d492d673dd51a97bdede87c1509e88aa07..0cf395a36fe554501cd43e0c95502ce2588f7631 100644
--- a/chrome/browser/extensions/api/hotword_private/hotword_private_apitest.cc
+++ b/chrome/browser/extensions/api/hotword_private/hotword_private_apitest.cc
@@ -165,6 +165,25 @@ IN_PROC_BROWSER_TEST_F(HotwordPrivateApiTest, IsAvailableFalse) {
EXPECT_TRUE(listener.WaitUntilSatisfied());
}
+IN_PROC_BROWSER_TEST_F(HotwordPrivateApiTest, AlwaysOnEnabled) {
+ {
+ ExtensionTestMessageListener listener("alwaysOnEnabled: false",
+ false);
+ ASSERT_TRUE(RunComponentExtensionTest("alwaysOnEnabled"))
+ << message_;
+ EXPECT_TRUE(listener.WaitUntilSatisfied());
+ }
+
+ profile()->GetPrefs()->SetBoolean(prefs::kHotwordAlwaysOnSearchEnabled, true);
+ {
+ ExtensionTestMessageListener listener("alwaysOnEnabled: true",
+ false);
+ ASSERT_TRUE(RunComponentExtensionTest("alwaysOnEnabled"))
+ << message_;
+ EXPECT_TRUE(listener.WaitUntilSatisfied());
+ }
+}
+
IN_PROC_BROWSER_TEST_F(HotwordPrivateApiTest, ExperimentalHotwordEnabled) {
// Disabled by default.
ExtensionTestMessageListener listener("experimentalHotwordEnabled: false",
@@ -196,6 +215,11 @@ IN_PROC_BROWSER_TEST_F(HotwordPrivateApiTest, OnEnabledChanged) {
ExtensionTestMessageListener listenerNotification("notification", false);
profile()->GetPrefs()->SetBoolean(prefs::kHotwordSearchEnabled, true);
EXPECT_TRUE(listenerNotification.WaitUntilSatisfied());
+
+ listenerNotification.Reset();
+ profile()->GetPrefs()->SetBoolean(prefs::kHotwordAlwaysOnSearchEnabled,
+ true);
+ EXPECT_TRUE(listenerNotification.WaitUntilSatisfied());
}
IN_PROC_BROWSER_TEST_F(HotwordPrivateApiTest, HotwordSession) {
« no previous file with comments | « chrome/browser/extensions/api/hotword_private/hotword_private_api.cc ('k') | chrome/common/extensions/api/hotword_private.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698