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

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

Issue 2044613003: Adds unit tests for offline_pages::PrerenderAdapter calling PrerenderManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated DCHECK to ASSERT Created 4 years, 6 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
« no previous file with comments | « chrome/browser/prerender/prerender_manager.cc ('k') | chrome/chrome_tests_unit.gypi » ('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 "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 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial("EmbeddedSearch", 162 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial("EmbeddedSearch",
163 "Group1 strk:20")); 163 "Group1 strk:20"));
164 InstantUnitTestBase::SetUp(); 164 InstantUnitTestBase::SetUp();
165 } 165 }
166 166
167 void Init(bool prerender_search_results_base_page, 167 void Init(bool prerender_search_results_base_page,
168 bool call_did_finish_load) { 168 bool call_did_finish_load) {
169 AddTab(browser(), GURL(url::kAboutBlankURL)); 169 AddTab(browser(), GURL(url::kAboutBlankURL));
170 170
171 PrerenderManagerFactory::GetForProfile(browser()->profile())-> 171 PrerenderManagerFactory::GetForProfile(browser()->profile())->
172 SetPrerenderContentsFactory( 172 SetPrerenderContentsFactoryForTest(
173 new DummyPrerenderContentsFactory(call_did_finish_load)); 173 new DummyPrerenderContentsFactory(call_did_finish_load));
174 if (prerender_search_results_base_page) { 174 if (prerender_search_results_base_page) {
175 content::SessionStorageNamespace* session_storage_namespace = 175 content::SessionStorageNamespace* session_storage_namespace =
176 GetActiveWebContents()->GetController(). 176 GetActiveWebContents()->GetController().
177 GetDefaultSessionStorageNamespace(); 177 GetDefaultSessionStorageNamespace();
178 InstantSearchPrerenderer* prerenderer = GetInstantSearchPrerenderer(); 178 InstantSearchPrerenderer* prerenderer = GetInstantSearchPrerenderer();
179 prerenderer->Init(session_storage_namespace, gfx::Size(640, 480)); 179 prerenderer->Init(session_storage_namespace, gfx::Size(640, 480));
180 EXPECT_NE(static_cast<PrerenderHandle*>(NULL), prerender_handle()); 180 EXPECT_NE(static_cast<PrerenderHandle*>(NULL), prerender_handle());
181 } 181 }
182 } 182 }
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 std::tuple<base::string16, EmbeddedSearchRequestParams> params; 538 std::tuple<base::string16, EmbeddedSearchRequestParams> params;
539 ChromeViewMsg_SearchBoxSubmit::Read(message, &params); 539 ChromeViewMsg_SearchBoxSubmit::Read(message, &params);
540 EXPECT_EQ("foo", base::UTF16ToASCII(std::get<0>(params))); 540 EXPECT_EQ("foo", base::UTF16ToASCII(std::get<0>(params)));
541 EXPECT_EQ("f", base::UTF16ToASCII(std::get<1>(params).original_query)); 541 EXPECT_EQ("f", base::UTF16ToASCII(std::get<1>(params).original_query));
542 EXPECT_EQ("utf-8", base::UTF16ToASCII(std::get<1>(params).input_encoding)); 542 EXPECT_EQ("utf-8", base::UTF16ToASCII(std::get<1>(params).input_encoding));
543 EXPECT_EQ("", base::UTF16ToASCII(std::get<1>(params).rlz_parameter_value)); 543 EXPECT_EQ("", base::UTF16ToASCII(std::get<1>(params).rlz_parameter_value));
544 EXPECT_EQ("chrome...0", 544 EXPECT_EQ("chrome...0",
545 base::UTF16ToASCII(std::get<1>(params).assisted_query_stats)); 545 base::UTF16ToASCII(std::get<1>(params).assisted_query_stats));
546 } 546 }
547 #endif 547 #endif
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_manager.cc ('k') | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698