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

Side by Side Diff: chrome/browser/ui/search/search_model_unittest.cc

Issue 17132011: Add setVoiceSearchSupported to the searchbox API. This will be used to determine whether to show a … (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Rebase past 16035020, add test. Created 7 years, 6 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/search/search_model.cc ('k') | chrome/browser/ui/search/search_tab_helper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 151
152 TEST_F(SearchModelTest, UpdateSearchModelState) { 152 TEST_F(SearchModelTest, UpdateSearchModelState) {
153 SearchModel::State expected_new_state(model->state()); 153 SearchModel::State expected_new_state(model->state());
154 expected_new_state.top_bars_visible = false; 154 expected_new_state.top_bars_visible = false;
155 expected_new_state.instant_support = INSTANT_SUPPORT_NO; 155 expected_new_state.instant_support = INSTANT_SUPPORT_NO;
156 EXPECT_FALSE(model->state() == expected_new_state); 156 EXPECT_FALSE(model->state() == expected_new_state);
157 model->SetState(expected_new_state); 157 model->SetState(expected_new_state);
158 mock_observer.VerifyNotificationCount(1); 158 mock_observer.VerifyNotificationCount(1);
159 EXPECT_TRUE(model->state() == expected_new_state); 159 EXPECT_TRUE(model->state() == expected_new_state);
160 } 160 }
161
162 TEST_F(SearchModelTest, UpdateVoiceSearchSupported) {
163 mock_observer.VerifyNotificationCount(0);
164 EXPECT_FALSE(model->voice_search_supported());
165
166 SearchModel::State expected_old_state = model->state();
167 SearchModel::State expected_new_state(model->state());
168 expected_new_state.voice_search_supported = true;
169
170 model->SetVoiceSearchSupported(true);
171 mock_observer.VerifySearchModelStates(expected_old_state, expected_new_state);
172 mock_observer.VerifyNotificationCount(1);
173 EXPECT_TRUE(model->voice_search_supported());
174 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/search/search_model.cc ('k') | chrome/browser/ui/search/search_tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698