OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/search/search_model.h" | 5 #include "chrome/browser/ui/search/search_model.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/ui/search/search_model_observer.h" | 8 #include "chrome/browser/ui/search/search_model_observer.h" |
9 #include "chrome/browser/ui/search/search_tab_helper.h" | 9 #include "chrome/browser/ui/search/search_tab_helper.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 } | 134 } |
135 | 135 |
136 TEST_F(SearchModelTest, UpdateSearchModelState) { | 136 TEST_F(SearchModelTest, UpdateSearchModelState) { |
137 SearchModel::State expected_new_state(model->state()); | 137 SearchModel::State expected_new_state(model->state()); |
138 expected_new_state.instant_support = INSTANT_SUPPORT_NO; | 138 expected_new_state.instant_support = INSTANT_SUPPORT_NO; |
139 EXPECT_FALSE(model->state() == expected_new_state); | 139 EXPECT_FALSE(model->state() == expected_new_state); |
140 model->SetState(expected_new_state); | 140 model->SetState(expected_new_state); |
141 mock_observer.VerifyNotificationCount(1); | 141 mock_observer.VerifyNotificationCount(1); |
142 EXPECT_TRUE(model->state() == expected_new_state); | 142 EXPECT_TRUE(model->state() == expected_new_state); |
143 } | 143 } |
144 | |
145 TEST_F(SearchModelTest, UpdateVoiceSearchSupported) { | |
146 mock_observer.VerifyNotificationCount(0); | |
147 EXPECT_FALSE(model->voice_search_supported()); | |
148 | |
149 SearchModel::State expected_old_state = model->state(); | |
150 SearchModel::State expected_new_state(model->state()); | |
151 expected_new_state.voice_search_supported = true; | |
152 | |
153 model->SetVoiceSearchSupported(true); | |
154 mock_observer.VerifySearchModelStates(expected_old_state, expected_new_state); | |
155 mock_observer.VerifyNotificationCount(1); | |
156 EXPECT_TRUE(model->voice_search_supported()); | |
157 } | |
OLD | NEW |