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

Side by Side Diff: chrome/browser/ui/search/instant_search_prerenderer_unittest.cc

Issue 2321083002: [NoStatePrefetch] Add performance histograms. (Closed)
Patch Set: Review comments Created 4 years, 3 months 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 "chrome/browser/ui/search/instant_search_prerenderer.h" 5 #include "chrome/browser/ui/search/instant_search_prerenderer.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <tuple> 10 #include <tuple>
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 void SetUp() override { 162 void SetUp() override {
163 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial("EmbeddedSearch", 163 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial("EmbeddedSearch",
164 "Group1 strk:20")); 164 "Group1 strk:20"));
165 InstantUnitTestBase::SetUp(); 165 InstantUnitTestBase::SetUp();
166 } 166 }
167 167
168 void Init(bool prerender_search_results_base_page, 168 void Init(bool prerender_search_results_base_page,
169 bool call_did_finish_load) { 169 bool call_did_finish_load) {
170 AddTab(browser(), GURL(url::kAboutBlankURL)); 170 AddTab(browser(), GURL(url::kAboutBlankURL));
171 171
172 PrerenderManagerFactory::GetForProfile(browser()->profile())-> 172 PrerenderManagerFactory::GetForBrowserContext(browser()->profile())
173 SetPrerenderContentsFactoryForTest( 173 ->SetPrerenderContentsFactoryForTest(
174 new DummyPrerenderContentsFactory(call_did_finish_load)); 174 new DummyPrerenderContentsFactory(call_did_finish_load));
175 if (prerender_search_results_base_page) { 175 if (prerender_search_results_base_page) {
176 content::SessionStorageNamespace* session_storage_namespace = 176 content::SessionStorageNamespace* session_storage_namespace =
177 GetActiveWebContents()->GetController(). 177 GetActiveWebContents()->GetController().
178 GetDefaultSessionStorageNamespace(); 178 GetDefaultSessionStorageNamespace();
179 InstantSearchPrerenderer* prerenderer = GetInstantSearchPrerenderer(); 179 InstantSearchPrerenderer* prerenderer = GetInstantSearchPrerenderer();
180 prerenderer->Init(session_storage_namespace, gfx::Size(640, 480)); 180 prerenderer->Init(session_storage_namespace, gfx::Size(640, 480));
181 EXPECT_NE(static_cast<PrerenderHandle*>(NULL), prerender_handle()); 181 EXPECT_NE(static_cast<PrerenderHandle*>(NULL), prerender_handle());
182 } 182 }
183 } 183 }
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 std::tuple<base::string16, EmbeddedSearchRequestParams> params; 522 std::tuple<base::string16, EmbeddedSearchRequestParams> params;
523 ChromeViewMsg_SearchBoxSubmit::Read(message, &params); 523 ChromeViewMsg_SearchBoxSubmit::Read(message, &params);
524 EXPECT_EQ("foo", base::UTF16ToASCII(std::get<0>(params))); 524 EXPECT_EQ("foo", base::UTF16ToASCII(std::get<0>(params)));
525 EXPECT_EQ("f", base::UTF16ToASCII(std::get<1>(params).original_query)); 525 EXPECT_EQ("f", base::UTF16ToASCII(std::get<1>(params).original_query));
526 EXPECT_EQ("utf-8", base::UTF16ToASCII(std::get<1>(params).input_encoding)); 526 EXPECT_EQ("utf-8", base::UTF16ToASCII(std::get<1>(params).input_encoding));
527 EXPECT_EQ("", base::UTF16ToASCII(std::get<1>(params).rlz_parameter_value)); 527 EXPECT_EQ("", base::UTF16ToASCII(std::get<1>(params).rlz_parameter_value));
528 EXPECT_EQ("chrome...0", 528 EXPECT_EQ("chrome...0",
529 base::UTF16ToASCII(std::get<1>(params).assisted_query_stats)); 529 base::UTF16ToASCII(std::get<1>(params).assisted_query_stats));
530 } 530 }
531 #endif 531 #endif
OLDNEW
« no previous file with comments | « chrome/browser/ui/search/instant_search_prerenderer.cc ('k') | chrome/browser/ui/webui/net_internals/net_internals_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698