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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "chrome/browser/search/instant_service.h" | 12 #include "chrome/browser/search/instant_service.h" |
13 #include "chrome/browser/search/instant_service_observer.h" | 13 #include "chrome/browser/search/instant_service_observer.h" |
14 #include "chrome/browser/search/instant_unittest_base.h" | 14 #include "chrome/browser/search/instant_unittest_base.h" |
15 #include "chrome/browser/search/search.h" | 15 #include "chrome/browser/search/search.h" |
16 #include "chrome/browser/ui/browser.h" | 16 #include "chrome/browser/ui/browser.h" |
17 #include "chrome/browser/ui/browser_window.h" | 17 #include "chrome/browser/ui/browser_window.h" |
18 #include "chrome/browser/ui/host_desktop.h" | |
19 #include "chrome/browser/ui/search/instant_search_prerenderer.h" | 18 #include "chrome/browser/ui/search/instant_search_prerenderer.h" |
20 #include "chrome/common/render_messages.h" | 19 #include "chrome/common/render_messages.h" |
21 #include "components/variations/entropy_provider.h" | 20 #include "components/variations/entropy_provider.h" |
22 #include "content/public/browser/notification_service.h" | 21 #include "content/public/browser/notification_service.h" |
23 #include "content/public/browser/notification_types.h" | 22 #include "content/public/browser/notification_types.h" |
24 #include "content/public/test/mock_render_process_host.h" | 23 #include "content/public/test/mock_render_process_host.h" |
25 #include "ipc/ipc_message.h" | 24 #include "ipc/ipc_message.h" |
26 #include "ipc/ipc_test_sink.h" | 25 #include "ipc/ipc_test_sink.h" |
27 #include "testing/gmock/include/gmock/gmock.h" | 26 #include "testing/gmock/include/gmock/gmock.h" |
| 27 #include "ui/gfx/host_desktop_type.h" |
28 #include "url/gurl.h" | 28 #include "url/gurl.h" |
29 | 29 |
30 class MockInstantServiceObserver : public InstantServiceObserver { | 30 class MockInstantServiceObserver : public InstantServiceObserver { |
31 public: | 31 public: |
32 MOCK_METHOD1(DefaultSearchProviderChanged, void(bool)); | 32 MOCK_METHOD1(DefaultSearchProviderChanged, void(bool)); |
33 MOCK_METHOD1(OmniboxStartMarginChanged, void(int)); | 33 MOCK_METHOD1(OmniboxStartMarginChanged, void(int)); |
34 }; | 34 }; |
35 | 35 |
36 class InstantServiceTest : public InstantUnitTestBase { | 36 class InstantServiceTest : public InstantUnitTestBase { |
37 protected: | 37 protected: |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 NotifyGoogleBaseURLUpdate(new_base_url); | 158 NotifyGoogleBaseURLUpdate(new_base_url); |
159 EXPECT_NE(old_prerenderer, GetInstantSearchPrerenderer()); | 159 EXPECT_NE(old_prerenderer, GetInstantSearchPrerenderer()); |
160 } | 160 } |
161 | 161 |
162 TEST_F(InstantServiceTest, OmniboxStartMarginChanged) { | 162 TEST_F(InstantServiceTest, OmniboxStartMarginChanged) { |
163 int new_start_margin = 92; | 163 int new_start_margin = 92; |
164 EXPECT_CALL(*instant_service_observer_.get(), | 164 EXPECT_CALL(*instant_service_observer_.get(), |
165 OmniboxStartMarginChanged(new_start_margin)).Times(1); | 165 OmniboxStartMarginChanged(new_start_margin)).Times(1); |
166 UpdateOmniboxStartMargin(new_start_margin); | 166 UpdateOmniboxStartMargin(new_start_margin); |
167 } | 167 } |
OLD | NEW |