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

Side by Side Diff: content/browser/web_contents/render_view_host_manager_unittest.cc

Issue 19331002: Associate an id with the output surface to handle lost contexts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android, tests Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/strings/utf_string_conversions.h" 5 #include "base/strings/utf_string_conversions.h"
6 #include "content/browser/renderer_host/test_render_view_host.h" 6 #include "content/browser/renderer_host/test_render_view_host.h"
7 #include "content/browser/site_instance_impl.h" 7 #include "content/browser/site_instance_impl.h"
8 #include "content/browser/web_contents/navigation_controller_impl.h" 8 #include "content/browser/web_contents/navigation_controller_impl.h"
9 #include "content/browser/web_contents/navigation_entry_impl.h" 9 #include "content/browser/web_contents/navigation_entry_impl.h"
10 #include "content/browser/web_contents/render_view_host_manager.h" 10 #include "content/browser/web_contents/render_view_host_manager.h"
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 TestRenderViewHost* swapped_out_rvh = CreateSwappedOutRenderViewHost(); 314 TestRenderViewHost* swapped_out_rvh = CreateSwappedOutRenderViewHost();
315 TestRenderWidgetHostView* swapped_out_rwhv = 315 TestRenderWidgetHostView* swapped_out_rwhv =
316 static_cast<TestRenderWidgetHostView*>(swapped_out_rvh->GetView()); 316 static_cast<TestRenderWidgetHostView*>(swapped_out_rvh->GetView());
317 EXPECT_FALSE(swapped_out_rwhv->did_swap_compositor_frame()); 317 EXPECT_FALSE(swapped_out_rwhv->did_swap_compositor_frame());
318 318
319 MockRenderProcessHost* process_host = 319 MockRenderProcessHost* process_host =
320 static_cast<MockRenderProcessHost*>(swapped_out_rvh->GetProcess()); 320 static_cast<MockRenderProcessHost*>(swapped_out_rvh->GetProcess());
321 process_host->sink().ClearMessages(); 321 process_host->sink().ClearMessages();
322 322
323 cc::CompositorFrame frame; 323 cc::CompositorFrame frame;
324 ViewHostMsg_SwapCompositorFrame msg(rvh()->GetRoutingID(), frame); 324 ViewHostMsg_SwapCompositorFrame msg(rvh()->GetRoutingID(), 0, frame);
325 325
326 EXPECT_TRUE(swapped_out_rvh->OnMessageReceived(msg)); 326 EXPECT_TRUE(swapped_out_rvh->OnMessageReceived(msg));
327 EXPECT_TRUE(swapped_out_rwhv->did_swap_compositor_frame()); 327 EXPECT_TRUE(swapped_out_rwhv->did_swap_compositor_frame());
328 } 328 }
329 329
330 TEST_F(RenderViewHostManagerTest, WhiteListDidActivateAcceleratedCompositing) { 330 TEST_F(RenderViewHostManagerTest, WhiteListDidActivateAcceleratedCompositing) {
331 TestRenderViewHost* swapped_out_rvh = CreateSwappedOutRenderViewHost(); 331 TestRenderViewHost* swapped_out_rvh = CreateSwappedOutRenderViewHost();
332 332
333 MockRenderProcessHost* process_host = 333 MockRenderProcessHost* process_host =
334 static_cast<MockRenderProcessHost*>(swapped_out_rvh->GetProcess()); 334 static_cast<MockRenderProcessHost*>(swapped_out_rvh->GetProcess());
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after
1198 1198
1199 // Commit. 1199 // Commit.
1200 manager.DidNavigateMainFrame(host); 1200 manager.DidNavigateMainFrame(host);
1201 EXPECT_EQ(host, manager.current_host()); 1201 EXPECT_EQ(host, manager.current_host());
1202 ASSERT_TRUE(host); 1202 ASSERT_TRUE(host);
1203 EXPECT_EQ(static_cast<SiteInstanceImpl*>(host->GetSiteInstance()), 1203 EXPECT_EQ(static_cast<SiteInstanceImpl*>(host->GetSiteInstance()),
1204 instance); 1204 instance);
1205 } 1205 }
1206 1206
1207 } // namespace content 1207 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/test_render_view_host.cc ('k') | content/common/browser_plugin/browser_plugin_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698