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

Side by Side Diff: content/browser/frame_host/render_widget_host_view_guest_unittest.cc

Issue 2385333002: RenderWidgetHostViewChildFrame's called a virtual in its ctor. (Closed)
Patch Set: Move guest ctor to private Created 4 years, 2 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/frame_host/render_widget_host_view_guest.h" 5 #include "content/browser/frame_host/render_widget_host_view_guest.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 ContextProviderFactoryImpl::Initialize(&gpu_channel_factory_); 63 ContextProviderFactoryImpl::Initialize(&gpu_channel_factory_);
64 ui::ContextProviderFactory::SetInstance( 64 ui::ContextProviderFactory::SetInstance(
65 ContextProviderFactoryImpl::GetInstance()); 65 ContextProviderFactoryImpl::GetInstance());
66 #endif 66 #endif
67 browser_context_.reset(new TestBrowserContext); 67 browser_context_.reset(new TestBrowserContext);
68 MockRenderProcessHost* process_host = 68 MockRenderProcessHost* process_host =
69 new MockRenderProcessHost(browser_context_.get()); 69 new MockRenderProcessHost(browser_context_.get());
70 int32_t routing_id = process_host->GetNextRoutingID(); 70 int32_t routing_id = process_host->GetNextRoutingID();
71 widget_host_ = 71 widget_host_ =
72 new RenderWidgetHostImpl(&delegate_, process_host, routing_id, false); 72 new RenderWidgetHostImpl(&delegate_, process_host, routing_id, false);
73 view_ = new RenderWidgetHostViewGuest( 73 view_ = RenderWidgetHostViewGuest::Create(
74 widget_host_, NULL, 74 widget_host_, NULL,
75 (new TestRenderWidgetHostView(widget_host_))->GetWeakPtr()); 75 (new TestRenderWidgetHostView(widget_host_))->GetWeakPtr());
76 } 76 }
77 77
78 void TearDown() override { 78 void TearDown() override {
79 if (view_) 79 if (view_)
80 view_->Destroy(); 80 view_->Destroy();
81 delete widget_host_; 81 delete widget_host_;
82 82
83 browser_context_.reset(); 83 browser_context_.reset();
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 new MockRenderProcessHost(browser_context_.get()); 183 new MockRenderProcessHost(browser_context_.get());
184 web_contents_.reset( 184 web_contents_.reset(
185 TestWebContents::Create(browser_context_.get(), nullptr)); 185 TestWebContents::Create(browser_context_.get(), nullptr));
186 // We don't own the BPG, the WebContents does. 186 // We don't own the BPG, the WebContents does.
187 browser_plugin_guest_ = new TestBrowserPluginGuest( 187 browser_plugin_guest_ = new TestBrowserPluginGuest(
188 web_contents_.get(), &browser_plugin_guest_delegate_); 188 web_contents_.get(), &browser_plugin_guest_delegate_);
189 189
190 int32_t routing_id = process_host->GetNextRoutingID(); 190 int32_t routing_id = process_host->GetNextRoutingID();
191 widget_host_ = 191 widget_host_ =
192 new RenderWidgetHostImpl(&delegate_, process_host, routing_id, false); 192 new RenderWidgetHostImpl(&delegate_, process_host, routing_id, false);
193 view_ = new RenderWidgetHostViewGuest( 193 view_ = RenderWidgetHostViewGuest::Create(
194 widget_host_, browser_plugin_guest_, 194 widget_host_, browser_plugin_guest_,
195 (new TestRenderWidgetHostView(widget_host_))->GetWeakPtr()); 195 (new TestRenderWidgetHostView(widget_host_))->GetWeakPtr());
196 } 196 }
197 197
198 void TearDown() override { 198 void TearDown() override {
199 if (view_) 199 if (view_)
200 view_->Destroy(); 200 view_->Destroy();
201 delete widget_host_; 201 delete widget_host_;
202 202
203 // It's important to make sure that the view finishes destructing before 203 // It's important to make sure that the view finishes destructing before
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 311
312 browser_plugin_guest_->set_attached(false); 312 browser_plugin_guest_->set_attached(false);
313 browser_plugin_guest_->ResetTestData(); 313 browser_plugin_guest_->ResetTestData();
314 314
315 view_->OnSwapCompositorFrame( 315 view_->OnSwapCompositorFrame(
316 0, CreateDelegatedFrame(scale_factor, view_size, view_rect)); 316 0, CreateDelegatedFrame(scale_factor, view_size, view_rect));
317 EXPECT_TRUE(surface_id().is_null()); 317 EXPECT_TRUE(surface_id().is_null());
318 } 318 }
319 319
320 } // namespace content 320 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698