OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <memory> | 5 #include <memory> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 : HotwordService(profile), service_available_(true) {} | 97 : HotwordService(profile), service_available_(true) {} |
98 ~MockHotwordService() override {} | 98 ~MockHotwordService() override {} |
99 | 99 |
100 bool IsServiceAvailable() override { return service_available_; } | 100 bool IsServiceAvailable() override { return service_available_; } |
101 | 101 |
102 void setServiceAvailable(bool available) { | 102 void setServiceAvailable(bool available) { |
103 service_available_ = available; | 103 service_available_ = available; |
104 } | 104 } |
105 | 105 |
106 static std::unique_ptr<KeyedService> Build(content::BrowserContext* profile) { | 106 static std::unique_ptr<KeyedService> Build(content::BrowserContext* profile) { |
107 return base::WrapUnique( | 107 return base::MakeUnique<MockHotwordService>(static_cast<Profile*>(profile)); |
108 new MockHotwordService(static_cast<Profile*>(profile))); | |
109 } | 108 } |
110 | 109 |
111 LaunchMode GetHotwordAudioVerificationLaunchMode() override { | 110 LaunchMode GetHotwordAudioVerificationLaunchMode() override { |
112 return launch_mode_; | 111 return launch_mode_; |
113 } | 112 } |
114 | 113 |
115 void SetHotwordAudioVerificationLaunchMode(const LaunchMode& launch_mode) { | 114 void SetHotwordAudioVerificationLaunchMode(const LaunchMode& launch_mode) { |
116 launch_mode_ = launch_mode; | 115 launch_mode_ = launch_mode; |
117 } | 116 } |
118 | 117 |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 ExtensionTestMessageListener setListenerF("set AH False: false failure", | 535 ExtensionTestMessageListener setListenerF("set AH False: false failure", |
537 false); | 536 false); |
538 ExtensionTestMessageListener getListener("get AH: false failure", false); | 537 ExtensionTestMessageListener getListener("get AH: false failure", false); |
539 | 538 |
540 ASSERT_TRUE(RunComponentExtensionTest("audioHistory")) << message_; | 539 ASSERT_TRUE(RunComponentExtensionTest("audioHistory")) << message_; |
541 | 540 |
542 EXPECT_TRUE(setListenerT.WaitUntilSatisfied()); | 541 EXPECT_TRUE(setListenerT.WaitUntilSatisfied()); |
543 EXPECT_TRUE(setListenerF.WaitUntilSatisfied()); | 542 EXPECT_TRUE(setListenerF.WaitUntilSatisfied()); |
544 EXPECT_TRUE(getListener.WaitUntilSatisfied()); | 543 EXPECT_TRUE(getListener.WaitUntilSatisfied()); |
545 } | 544 } |
OLD | NEW |