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

Side by Side Diff: content/browser/host_zoom_map_impl_browsertest.cc

Issue 2515823002: Remove WebContents::GetRoutingID(). (Closed)
Patch Set: add render_view_host.h include in resource_dispatcher_host_unittest.cc Created 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "content/browser/host_zoom_map_impl.h" 5 #include "content/browser/host_zoom_map_impl.h"
6 6
7 #include "content/public/browser/render_process_host.h" 7 #include "content/public/browser/render_process_host.h"
8 #include "content/public/browser/render_view_host.h" 8 #include "content/public/browser/render_view_host.h"
9 #include "content/public/browser/web_contents.h" 9 #include "content/public/browser/web_contents.h"
10 #include "content/public/test/content_browser_test.h" 10 #include "content/public/test/content_browser_test.h"
(...skipping 14 matching lines...) Expand all
25 25
26 void RunTestForURL(const GURL& url, 26 void RunTestForURL(const GURL& url,
27 Shell* shell, 27 Shell* shell,
28 double host_zoom_level, 28 double host_zoom_level,
29 double temp_zoom_level) { 29 double temp_zoom_level) {
30 WebContents* web_contents = shell->web_contents(); 30 WebContents* web_contents = shell->web_contents();
31 31
32 HostZoomMapImpl* host_zoom_map = static_cast<HostZoomMapImpl*>( 32 HostZoomMapImpl* host_zoom_map = static_cast<HostZoomMapImpl*>(
33 HostZoomMap::GetForWebContents(web_contents)); 33 HostZoomMap::GetForWebContents(web_contents));
34 34
35 int view_id = web_contents->GetRoutingID(); 35 int view_id = web_contents->GetRenderViewHost()->GetRoutingID();
36 int render_process_id = web_contents->GetRenderProcessHost()->GetID(); 36 int render_process_id = web_contents->GetRenderProcessHost()->GetID();
37 37
38 // Assume caller has set the zoom level to |host_zoom_level| using 38 // Assume caller has set the zoom level to |host_zoom_level| using
39 // either a host or host+scheme entry in the HostZoomMap prior to 39 // either a host or host+scheme entry in the HostZoomMap prior to
40 // calling this function. 40 // calling this function.
41 EXPECT_DOUBLE_EQ(host_zoom_level, host_zoom_map->GetZoomLevelForView( 41 EXPECT_DOUBLE_EQ(host_zoom_level, host_zoom_map->GetZoomLevelForView(
42 url, render_process_id, view_id)); 42 url, render_process_id, view_id));
43 43
44 // Make sure that GetZoomLevelForView() works for temporary zoom levels. 44 // Make sure that GetZoomLevelForView() works for temporary zoom levels.
45 host_zoom_map->SetTemporaryZoomLevel(render_process_id, view_id, 45 host_zoom_map->SetTemporaryZoomLevel(render_process_id, view_id,
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 double host_zoom_level = default_zoom_level + 1.0; 89 double host_zoom_level = default_zoom_level + 1.0;
90 double temp_zoom_level = default_zoom_level + 2.0; 90 double temp_zoom_level = default_zoom_level + 2.0;
91 91
92 host_zoom_map->SetZoomLevelForHostAndScheme(url.scheme(), url.host(), 92 host_zoom_map->SetZoomLevelForHostAndScheme(url.scheme(), url.host(),
93 host_zoom_level); 93 host_zoom_level);
94 94
95 RunTestForURL(url, shell(), host_zoom_level, temp_zoom_level); 95 RunTestForURL(url, shell(), host_zoom_level, temp_zoom_level);
96 } 96 }
97 97
98 } // namespace content 98 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/host_zoom_map_impl.cc ('k') | content/browser/loader/resource_dispatcher_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698