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

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

Issue 2259533003: Use bounds instead of size for prerender requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments nit Created 4 years, 4 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 public: 57 public:
58 DummyPrerenderContents( 58 DummyPrerenderContents(
59 PrerenderManager* prerender_manager, 59 PrerenderManager* prerender_manager,
60 Profile* profile, 60 Profile* profile,
61 const GURL& url, 61 const GURL& url,
62 const Referrer& referrer, 62 const Referrer& referrer,
63 Origin origin, 63 Origin origin,
64 bool call_did_finish_load); 64 bool call_did_finish_load);
65 65
66 void StartPrerendering( 66 void StartPrerendering(
67 const gfx::Size& size, 67 const gfx::Rect& bounds,
68 content::SessionStorageNamespace* session_storage_namespace) override; 68 content::SessionStorageNamespace* session_storage_namespace) override;
69 bool GetChildId(int* child_id) const override; 69 bool GetChildId(int* child_id) const override;
70 bool GetRouteId(int* route_id) const override; 70 bool GetRouteId(int* route_id) const override;
71 71
72 private: 72 private:
73 Profile* profile_; 73 Profile* profile_;
74 const GURL url_; 74 const GURL url_;
75 bool call_did_finish_load_; 75 bool call_did_finish_load_;
76 76
77 DISALLOW_COPY_AND_ASSIGN(DummyPrerenderContents); 77 DISALLOW_COPY_AND_ASSIGN(DummyPrerenderContents);
(...skipping 25 matching lines...) Expand all
103 const Referrer& referrer, 103 const Referrer& referrer,
104 Origin origin, 104 Origin origin,
105 bool call_did_finish_load) 105 bool call_did_finish_load)
106 : PrerenderContents(prerender_manager, profile, url, referrer, origin), 106 : PrerenderContents(prerender_manager, profile, url, referrer, origin),
107 profile_(profile), 107 profile_(profile),
108 url_(url), 108 url_(url),
109 call_did_finish_load_(call_did_finish_load) { 109 call_did_finish_load_(call_did_finish_load) {
110 } 110 }
111 111
112 void DummyPrerenderContents::StartPrerendering( 112 void DummyPrerenderContents::StartPrerendering(
113 const gfx::Size& size, 113 const gfx::Rect& bounds,
114 content::SessionStorageNamespace* session_storage_namespace) { 114 content::SessionStorageNamespace* session_storage_namespace) {
115 content::SessionStorageNamespaceMap session_storage_namespace_map; 115 content::SessionStorageNamespaceMap session_storage_namespace_map;
116 session_storage_namespace_map[std::string()] = session_storage_namespace; 116 session_storage_namespace_map[std::string()] = session_storage_namespace;
117 prerender_contents_.reset(content::WebContents::CreateWithSessionStorage( 117 prerender_contents_.reset(content::WebContents::CreateWithSessionStorage(
118 content::WebContents::CreateParams(profile_), 118 content::WebContents::CreateParams(profile_),
119 session_storage_namespace_map)); 119 session_storage_namespace_map));
120 PrerenderTabHelper::CreateForWebContents(prerender_contents_.get()); 120 PrerenderTabHelper::CreateForWebContents(prerender_contents_.get());
121 content::NavigationController::LoadURLParams params(url_); 121 content::NavigationController::LoadURLParams params(url_);
122 prerender_contents_->GetController().LoadURLWithParams(params); 122 prerender_contents_->GetController().LoadURLWithParams(params);
123 SearchTabHelper::CreateForWebContents(prerender_contents_.get()); 123 SearchTabHelper::CreateForWebContents(prerender_contents_.get());
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 std::tuple<base::string16, EmbeddedSearchRequestParams> params; 521 std::tuple<base::string16, EmbeddedSearchRequestParams> params;
522 ChromeViewMsg_SearchBoxSubmit::Read(message, &params); 522 ChromeViewMsg_SearchBoxSubmit::Read(message, &params);
523 EXPECT_EQ("foo", base::UTF16ToASCII(std::get<0>(params))); 523 EXPECT_EQ("foo", base::UTF16ToASCII(std::get<0>(params)));
524 EXPECT_EQ("f", base::UTF16ToASCII(std::get<1>(params).original_query)); 524 EXPECT_EQ("f", base::UTF16ToASCII(std::get<1>(params).original_query));
525 EXPECT_EQ("utf-8", base::UTF16ToASCII(std::get<1>(params).input_encoding)); 525 EXPECT_EQ("utf-8", base::UTF16ToASCII(std::get<1>(params).input_encoding));
526 EXPECT_EQ("", base::UTF16ToASCII(std::get<1>(params).rlz_parameter_value)); 526 EXPECT_EQ("", base::UTF16ToASCII(std::get<1>(params).rlz_parameter_value));
527 EXPECT_EQ("chrome...0", 527 EXPECT_EQ("chrome...0",
528 base::UTF16ToASCII(std::get<1>(params).assisted_query_stats)); 528 base::UTF16ToASCII(std::get<1>(params).assisted_query_stats));
529 } 529 }
530 #endif 530 #endif
OLDNEW
« no previous file with comments | « chrome/browser/ui/exclusive_access/fullscreen_controller.cc ('k') | chrome/browser/ui/tabs/tab_strip_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698