| 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 147 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 } |
| 168 |
| 169 TEST_F(InstantServiceTest, GetSuggestionFromServiceSide) { |
| 170 auto profile = suggestions::SuggestionsProfile(); |
| 171 profile.add_suggestions(); |
| 172 |
| 173 instant_service_->OnSuggestionsAvailable(profile); |
| 174 |
| 175 auto items = instant_service_->suggestions_items_; |
| 176 ASSERT_EQ(1, (int)items.size()); |
| 177 ASSERT_TRUE(items[0].is_server_side_suggestion); |
| 178 } |
| 179 |
| 180 TEST_F(InstantServiceTest, GetSuggestionFromClientSide) { |
| 181 history::MostVisitedURLList url_list; |
| 182 url_list.push_back(history::MostVisitedURL()); |
| 183 |
| 184 instant_service_->OnMostVisitedItemsReceived(url_list); |
| 185 |
| 186 auto items = instant_service_->most_visited_items_; |
| 187 ASSERT_EQ(1, (int)items.size()); |
| 188 ASSERT_FALSE(items[0].is_server_side_suggestion); |
| 189 } |
| OLD | NEW |