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

Side by Side Diff: chrome/browser/search/instant_service_unittest.cc

Issue 1396143002: Emit correct NewTabPage.SuggestionsType metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/search/instant_service.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 <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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/search/instant_service.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