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

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

Issue 274163004: Remove browser-side tracking of accelerated compositing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 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 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 "base/files/file_path.h" 5 #include "base/files/file_path.h"
6 #include "base/strings/utf_string_conversions.h" 6 #include "base/strings/utf_string_conversions.h"
7 #include "content/browser/frame_host/cross_site_transferring_request.h" 7 #include "content/browser/frame_host/cross_site_transferring_request.h"
8 #include "content/browser/frame_host/navigation_controller_impl.h" 8 #include "content/browser/frame_host/navigation_controller_impl.h"
9 #include "content/browser/frame_host/navigation_entry_impl.h" 9 #include "content/browser/frame_host/navigation_entry_impl.h"
10 #include "content/browser/frame_host/navigator.h" 10 #include "content/browser/frame_host/navigator.h"
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 static_cast<MockRenderProcessHost*>(swapped_out_rvh->GetProcess()); 487 static_cast<MockRenderProcessHost*>(swapped_out_rvh->GetProcess());
488 process_host->sink().ClearMessages(); 488 process_host->sink().ClearMessages();
489 489
490 cc::CompositorFrame frame; 490 cc::CompositorFrame frame;
491 ViewHostMsg_SwapCompositorFrame msg(rvh()->GetRoutingID(), 0, frame); 491 ViewHostMsg_SwapCompositorFrame msg(rvh()->GetRoutingID(), 0, frame);
492 492
493 EXPECT_TRUE(swapped_out_rvh->OnMessageReceived(msg)); 493 EXPECT_TRUE(swapped_out_rvh->OnMessageReceived(msg));
494 EXPECT_TRUE(swapped_out_rwhv->did_swap_compositor_frame()); 494 EXPECT_TRUE(swapped_out_rwhv->did_swap_compositor_frame());
495 } 495 }
496 496
497 TEST_F(RenderFrameHostManagerTest, WhiteListDidActivateAcceleratedCompositing) {
498 TestRenderViewHost* swapped_out_rvh = CreateSwappedOutRenderViewHost();
499
500 MockRenderProcessHost* process_host =
501 static_cast<MockRenderProcessHost*>(swapped_out_rvh->GetProcess());
502 process_host->sink().ClearMessages();
503 ViewHostMsg_DidActivateAcceleratedCompositing msg(
504 rvh()->GetRoutingID(), true);
505 EXPECT_TRUE(swapped_out_rvh->OnMessageReceived(msg));
506 EXPECT_TRUE(swapped_out_rvh->is_accelerated_compositing_active());
507 }
508
509 // Test if RenderViewHost::GetRenderWidgetHosts() only returns active 497 // Test if RenderViewHost::GetRenderWidgetHosts() only returns active
510 // widgets. 498 // widgets.
511 TEST_F(RenderFrameHostManagerTest, GetRenderWidgetHostsReturnsActiveViews) { 499 TEST_F(RenderFrameHostManagerTest, GetRenderWidgetHostsReturnsActiveViews) {
512 TestRenderViewHost* swapped_out_rvh = CreateSwappedOutRenderViewHost(); 500 TestRenderViewHost* swapped_out_rvh = CreateSwappedOutRenderViewHost();
513 EXPECT_TRUE(swapped_out_rvh->IsSwappedOut()); 501 EXPECT_TRUE(swapped_out_rvh->IsSwappedOut());
514 502
515 scoped_ptr<RenderWidgetHostIterator> widgets( 503 scoped_ptr<RenderWidgetHostIterator> widgets(
516 RenderWidgetHost::GetRenderWidgetHosts()); 504 RenderWidgetHost::GetRenderWidgetHosts());
517 // We know that there is the only one active widget. Another view is 505 // We know that there is the only one active widget. Another view is
518 // now swapped out, so the swapped out view is not included in the 506 // now swapped out, so the swapped out view is not included in the
(...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after
1792 pending_rfh->GetSiteInstance())->increment_active_view_count(); 1780 pending_rfh->GetSiteInstance())->increment_active_view_count();
1793 1781
1794 main_test_rfh()->OnMessageReceived( 1782 main_test_rfh()->OnMessageReceived(
1795 FrameHostMsg_BeforeUnload_ACK(0, false, now, now)); 1783 FrameHostMsg_BeforeUnload_ACK(0, false, now, now));
1796 EXPECT_FALSE(contents()->cross_navigation_pending()); 1784 EXPECT_FALSE(contents()->cross_navigation_pending());
1797 EXPECT_FALSE(rvh_deleted_observer.deleted()); 1785 EXPECT_FALSE(rvh_deleted_observer.deleted());
1798 } 1786 }
1799 } 1787 }
1800 1788
1801 } // namespace content 1789 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/compositor/delegated_frame_host.cc ('k') | content/browser/frame_host/render_widget_host_view_child_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698