| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/prefs/pref_service.h" | 6 #include "base/prefs/pref_service.h" |
| 7 #include "chrome/browser/extensions/api/hotword_private/hotword_private_api.h" | 7 #include "chrome/browser/extensions/api/hotword_private/hotword_private_api.h" |
| 8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/history/web_history_service.h" | 10 #include "chrome/browser/history/web_history_service.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 recognized_count_(0) { | 117 recognized_count_(0) { |
| 118 } | 118 } |
| 119 | 119 |
| 120 ~MockHotwordClient() override {} | 120 ~MockHotwordClient() override {} |
| 121 | 121 |
| 122 void OnHotwordStateChanged(bool enabled) override { | 122 void OnHotwordStateChanged(bool enabled) override { |
| 123 last_enabled_ = enabled; | 123 last_enabled_ = enabled; |
| 124 state_changed_count_++; | 124 state_changed_count_++; |
| 125 } | 125 } |
| 126 | 126 |
| 127 void OnHotwordRecognized() override { recognized_count_++; } | 127 void OnHotwordRecognized( |
| 128 const scoped_refptr<content::SpeechRecognitionSessionPreamble>& preamble) |
| 129 override { recognized_count_++; } |
| 128 | 130 |
| 129 bool last_enabled() const { return last_enabled_; } | 131 bool last_enabled() const { return last_enabled_; } |
| 130 int state_changed_count() const { return state_changed_count_; } | 132 int state_changed_count() const { return state_changed_count_; } |
| 131 int recognized_count() const { return recognized_count_; } | 133 int recognized_count() const { return recognized_count_; } |
| 132 | 134 |
| 133 private: | 135 private: |
| 134 bool last_enabled_; | 136 bool last_enabled_; |
| 135 int state_changed_count_; | 137 int state_changed_count_; |
| 136 int recognized_count_; | 138 int recognized_count_; |
| 137 | 139 |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 ExtensionTestMessageListener setListenerT("set AH: false failure", false); | 473 ExtensionTestMessageListener setListenerT("set AH: false failure", false); |
| 472 ExtensionTestMessageListener setListenerF("set AH: false failure", false); | 474 ExtensionTestMessageListener setListenerF("set AH: false failure", false); |
| 473 ExtensionTestMessageListener getListener("get AH: false failure", false); | 475 ExtensionTestMessageListener getListener("get AH: false failure", false); |
| 474 | 476 |
| 475 ASSERT_TRUE(RunComponentExtensionTest("audioHistory")) << message_; | 477 ASSERT_TRUE(RunComponentExtensionTest("audioHistory")) << message_; |
| 476 | 478 |
| 477 EXPECT_TRUE(setListenerT.WaitUntilSatisfied()); | 479 EXPECT_TRUE(setListenerT.WaitUntilSatisfied()); |
| 478 EXPECT_TRUE(setListenerF.WaitUntilSatisfied()); | 480 EXPECT_TRUE(setListenerF.WaitUntilSatisfied()); |
| 479 EXPECT_TRUE(getListener.WaitUntilSatisfied()); | 481 EXPECT_TRUE(getListener.WaitUntilSatisfied()); |
| 480 } | 482 } |
| OLD | NEW |