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

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

Issue 528113003: Hotword Audio Verification App: Adds to hotwordPrivate API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@page-one
Patch Set: Review comments 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..6917f59f1f48f643da8da83c9f4b4781a6ac3b50 100644
--- a/chrome/browser/extensions/api/hotword_private/hotword_private_apitest.cc
+++ b/chrome/browser/extensions/api/hotword_private/hotword_private_apitest.cc
@@ -38,8 +38,17 @@ class MockHotwordService : public HotwordService {
return new MockHotwordService(static_cast<Profile*>(profile));
}
+ virtual LaunchMode GetHotwordAudioVerificationLaunchMode() OVERRIDE {
+ return launch_mode_;
+ }
+
+ void SetHotwordAudioVerificationLaunchMode(const LaunchMode& launch_mode) {
+ launch_mode_ = launch_mode;
+ }
+
private:
bool service_available_;
+ LaunchMode launch_mode_;
DISALLOW_COPY_AND_ASSIGN(MockHotwordService);
};
@@ -217,3 +226,20 @@ IN_PROC_BROWSER_TEST_F(HotwordPrivateApiTest, HotwordSession) {
EXPECT_EQ(1, client.state_changed_count());
EXPECT_EQ(1, client.recognized_count());
}
+
+IN_PROC_BROWSER_TEST_F(HotwordPrivateApiTest, GetLaunchStateHotwordOnly) {
+ service()->SetHotwordAudioVerificationLaunchMode(
+ HotwordService::HOTWORD_ONLY);
+ ExtensionTestMessageListener listener("launchMode: 1", false);
+ ASSERT_TRUE(RunComponentExtensionTest("getLaunchState")) << message_;
+ EXPECT_TRUE(listener.WaitUntilSatisfied());
+}
+
+IN_PROC_BROWSER_TEST_F(HotwordPrivateApiTest,
+ GetLaunchStateHotwordAudioHistory) {
+ service()->SetHotwordAudioVerificationLaunchMode(
+ HotwordService::HOTWORD_AND_AUDIO_HISTORY);
+ ExtensionTestMessageListener listener("launchMode: 2", false);
+ ASSERT_TRUE(RunComponentExtensionTest("getLaunchState")) << message_;
+ EXPECT_TRUE(listener.WaitUntilSatisfied());
+}

Powered by Google App Engine
This is Rietveld 408576698