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

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

Issue 821453003: Update legacy Tuple-using code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: media Created 6 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
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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 rph->sink().ClearMessages(); 101 rph->sink().ClearMessages();
102 instant_service_->Observe( 102 instant_service_->Observe(
103 content::NOTIFICATION_RENDERER_PROCESS_CREATED, 103 content::NOTIFICATION_RENDERER_PROCESS_CREATED,
104 content::Source<content::MockRenderProcessHost>(rph.get()), 104 content::Source<content::MockRenderProcessHost>(rph.get()),
105 content::NotificationService::NoDetails()); 105 content::NotificationService::NoDetails());
106 EXPECT_EQ(1U, rph->sink().message_count()); 106 EXPECT_EQ(1U, rph->sink().message_count());
107 const IPC::Message* msg = rph->sink().GetMessageAt(0); 107 const IPC::Message* msg = rph->sink().GetMessageAt(0);
108 ASSERT_TRUE(msg); 108 ASSERT_TRUE(msg);
109 ChromeViewMsg_SetSearchURLs::Param params; 109 ChromeViewMsg_SetSearchURLs::Param params;
110 ChromeViewMsg_SetSearchURLs::Read(msg, &params); 110 ChromeViewMsg_SetSearchURLs::Read(msg, &params);
111 std::vector<GURL> search_urls = params.a; 111 std::vector<GURL> search_urls = get<0>(params);
112 GURL new_tab_page_url = params.b; 112 GURL new_tab_page_url = get<1>(params);
113 EXPECT_EQ(2U, search_urls.size()); 113 EXPECT_EQ(2U, search_urls.size());
114 EXPECT_EQ("https://www.google.com/alt#quux=", search_urls[0].spec()); 114 EXPECT_EQ("https://www.google.com/alt#quux=", search_urls[0].spec());
115 EXPECT_EQ("https://www.google.com/url?bar=", search_urls[1].spec()); 115 EXPECT_EQ("https://www.google.com/url?bar=", search_urls[1].spec());
116 EXPECT_EQ("https://www.google.com/newtab", new_tab_page_url.spec()); 116 EXPECT_EQ("https://www.google.com/newtab", new_tab_page_url.spec());
117 } 117 }
118 118
119 TEST_F(InstantServiceTest, InstantSearchEnabled) { 119 TEST_F(InstantServiceTest, InstantSearchEnabled) {
120 EXPECT_NE(static_cast<InstantSearchPrerenderer*>(NULL), 120 EXPECT_NE(static_cast<InstantSearchPrerenderer*>(NULL),
121 GetInstantSearchPrerenderer()); 121 GetInstantSearchPrerenderer());
122 } 122 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 NotifyGoogleBaseURLUpdate(new_base_url); 156 NotifyGoogleBaseURLUpdate(new_base_url);
157 EXPECT_NE(old_prerenderer, GetInstantSearchPrerenderer()); 157 EXPECT_NE(old_prerenderer, GetInstantSearchPrerenderer());
158 } 158 }
159 159
160 TEST_F(InstantServiceTest, OmniboxStartMarginChanged) { 160 TEST_F(InstantServiceTest, OmniboxStartMarginChanged) {
161 int new_start_margin = 92; 161 int new_start_margin = 92;
162 EXPECT_CALL(*instant_service_observer_.get(), 162 EXPECT_CALL(*instant_service_observer_.get(),
163 OmniboxStartMarginChanged(new_start_margin)).Times(1); 163 OmniboxStartMarginChanged(new_start_margin)).Times(1);
164 UpdateOmniboxStartMargin(new_start_margin); 164 UpdateOmniboxStartMargin(new_start_margin);
165 } 165 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698