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" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 } | 124 } |
125 | 125 |
126 TEST_F(InstantServiceEnabledTest, | 126 TEST_F(InstantServiceEnabledTest, |
127 ResetInstantSearchPrerenderer_DefaultProviderChanged) { | 127 ResetInstantSearchPrerenderer_DefaultProviderChanged) { |
128 EXPECT_CALL(*instant_service_observer_.get(), DefaultSearchProviderChanged()) | 128 EXPECT_CALL(*instant_service_observer_.get(), DefaultSearchProviderChanged()) |
129 .Times(2); | 129 .Times(2); |
130 | 130 |
131 // Set a default search provider that doesn't support Instant. | 131 // Set a default search provider that doesn't support Instant. |
132 TemplateURLData data; | 132 TemplateURLData data; |
133 data.SetURL("https://foobar.com/url?bar={searchTerms}"); | 133 data.SetURL("https://foobar.com/url?bar={searchTerms}"); |
134 TemplateURL* template_url = new TemplateURL(profile(), data); | 134 TemplateURL* template_url = new TemplateURL(data); |
135 // Takes ownership of |template_url|. | 135 // Takes ownership of |template_url|. |
136 template_url_service_->Add(template_url); | 136 template_url_service_->Add(template_url); |
137 template_url_service_->SetUserSelectedDefaultSearchProvider(template_url); | 137 template_url_service_->SetUserSelectedDefaultSearchProvider(template_url); |
138 | 138 |
139 EXPECT_EQ(static_cast<InstantSearchPrerenderer*>(NULL), | 139 EXPECT_EQ(static_cast<InstantSearchPrerenderer*>(NULL), |
140 GetInstantSearchPrerenderer()); | 140 GetInstantSearchPrerenderer()); |
141 | 141 |
142 // Set a default search provider that supports Instant and make sure | 142 // Set a default search provider that supports Instant and make sure |
143 // InstantSearchPrerenderer is valid. | 143 // InstantSearchPrerenderer is valid. |
144 SetUserSelectedDefaultSearchProvider("https://google.com/"); | 144 SetUserSelectedDefaultSearchProvider("https://google.com/"); |
(...skipping 13 matching lines...) Expand all 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 |