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

Side by Side Diff: content/renderer/render_frame_impl_browsertest.cc

Issue 1750863002: Revert of Separate RenderView from RenderWidget, part 1: inheritance. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@renderwidgettest
Patch Set: Created 4 years, 9 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 | « content/renderer/render_frame_impl.cc ('k') | content/renderer/render_frame_proxy.cc » ('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 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/debug/leak_annotations.h" 8 #include "base/debug/leak_annotations.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "content/common/frame_messages.h" 10 #include "content/common/frame_messages.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 #define MAYBE_SubframeWidget SubframeWidget 118 #define MAYBE_SubframeWidget SubframeWidget
119 #define MAYBE_FrameResize FrameResize 119 #define MAYBE_FrameResize FrameResize
120 #define MAYBE_FrameWasShown FrameWasShown 120 #define MAYBE_FrameWasShown FrameWasShown
121 #define MAYBE_FrameWasShownAfterWidgetClose FrameWasShownAfterWidgetClose 121 #define MAYBE_FrameWasShownAfterWidgetClose FrameWasShownAfterWidgetClose
122 #endif 122 #endif
123 123
124 // Verify that a frame with a RenderFrameProxy as a parent has its own 124 // Verify that a frame with a RenderFrameProxy as a parent has its own
125 // RenderWidget. 125 // RenderWidget.
126 TEST_F(RenderFrameImplTest, MAYBE_SubframeWidget) { 126 TEST_F(RenderFrameImplTest, MAYBE_SubframeWidget) {
127 EXPECT_TRUE(frame_widget()); 127 EXPECT_TRUE(frame_widget());
128 EXPECT_NE(frame_widget(), view_->GetWidget()); 128 // We can't convert to RenderWidget* directly, because
129 // it and RenderView are two unrelated base classes
130 // of RenderViewImpl. If a class has multiple base classes,
131 // each base class pointer will be distinct, and direct casts
132 // between unrelated base classes are undefined, even if they share
133 // a common derived class. The compiler has no way in general of
134 // determining the displacement between the two classes, so these
135 // types of casts cannot be implemented in a type safe way.
136 // To overcome this, we make two legal static casts:
137 // first, downcast from RenderView* to RenderViewImpl*,
138 // then upcast from RenderViewImpl* to RenderWidget*.
139 EXPECT_NE(frame_widget(),
140 static_cast<content::RenderWidget*>(
141 static_cast<content::RenderViewImpl*>((view_))));
129 } 142 }
130 143
131 // Verify a subframe RenderWidget properly processes its viewport being 144 // Verify a subframe RenderWidget properly processes its viewport being
132 // resized. 145 // resized.
133 TEST_F(RenderFrameImplTest, MAYBE_FrameResize) { 146 TEST_F(RenderFrameImplTest, MAYBE_FrameResize) {
134 ResizeParams resize_params; 147 ResizeParams resize_params;
135 gfx::Size size(200, 200); 148 gfx::Size size(200, 200);
136 resize_params.screen_info = blink::WebScreenInfo(); 149 resize_params.screen_info = blink::WebScreenInfo();
137 resize_params.new_size = size; 150 resize_params.new_size = size;
138 resize_params.physical_backing_size = size; 151 resize_params.physical_backing_size = size;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 // but serves the purpose of testing the LoFi state logic. 227 // but serves the purpose of testing the LoFi state logic.
215 GetMainRenderFrame()->didCommitProvisionalLoad( 228 GetMainRenderFrame()->didCommitProvisionalLoad(
216 GetMainRenderFrame()->GetWebFrame(), item, blink::WebStandardCommit); 229 GetMainRenderFrame()->GetWebFrame(), item, blink::WebStandardCommit);
217 EXPECT_FALSE(GetMainRenderFrame()->IsUsingLoFi()); 230 EXPECT_FALSE(GetMainRenderFrame()->IsUsingLoFi());
218 // The subframe would be deleted here after a cross-document navigation. It 231 // The subframe would be deleted here after a cross-document navigation. It
219 // happens to be left around in this test because this does not simulate the 232 // happens to be left around in this test because this does not simulate the
220 // frame detach. 233 // frame detach.
221 } 234 }
222 235
223 } // namespace 236 } // namespace
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/renderer/render_frame_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698