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