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 "base/macros.h" | 8 #include "base/macros.h" |
9 #include "chrome/browser/ui/search/search_model_observer.h" | 9 #include "chrome/browser/ui/search/search_model_observer.h" |
10 #include "chrome/browser/ui/search/search_tab_helper.h" | 10 #include "chrome/browser/ui/search/search_tab_helper.h" |
11 #include "chrome/common/chrome_switches.h" | 11 #include "chrome/common/chrome_switches.h" |
12 #include "chrome/common/search_types.h" | 12 #include "chrome/common/search/search_types.h" |
13 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 13 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 class MockSearchModelObserver : public SearchModelObserver { | 17 class MockSearchModelObserver : public SearchModelObserver { |
18 public: | 18 public: |
19 MockSearchModelObserver(); | 19 MockSearchModelObserver(); |
20 ~MockSearchModelObserver() override; | 20 ~MockSearchModelObserver() override; |
21 | 21 |
22 void ModelChanged(const SearchModel::State& old_state, | 22 void ModelChanged(const SearchModel::State& old_state, |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 } | 135 } |
136 | 136 |
137 TEST_F(SearchModelTest, UpdateSearchModelState) { | 137 TEST_F(SearchModelTest, UpdateSearchModelState) { |
138 SearchModel::State expected_new_state(model->state()); | 138 SearchModel::State expected_new_state(model->state()); |
139 expected_new_state.instant_support = INSTANT_SUPPORT_NO; | 139 expected_new_state.instant_support = INSTANT_SUPPORT_NO; |
140 EXPECT_FALSE(model->state() == expected_new_state); | 140 EXPECT_FALSE(model->state() == expected_new_state); |
141 model->SetState(expected_new_state); | 141 model->SetState(expected_new_state); |
142 mock_observer.VerifyNotificationCount(1); | 142 mock_observer.VerifyNotificationCount(1); |
143 EXPECT_TRUE(model->state() == expected_new_state); | 143 EXPECT_TRUE(model->state() == expected_new_state); |
144 } | 144 } |
OLD | NEW |