| OLD | NEW |
| 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 Loading... |
| 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 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1840 pending_rfh->GetSiteInstance())->increment_active_view_count(); | 1828 pending_rfh->GetSiteInstance())->increment_active_view_count(); |
| 1841 | 1829 |
| 1842 main_test_rfh()->OnMessageReceived( | 1830 main_test_rfh()->OnMessageReceived( |
| 1843 FrameHostMsg_BeforeUnload_ACK(0, false, now, now)); | 1831 FrameHostMsg_BeforeUnload_ACK(0, false, now, now)); |
| 1844 EXPECT_FALSE(contents()->cross_navigation_pending()); | 1832 EXPECT_FALSE(contents()->cross_navigation_pending()); |
| 1845 EXPECT_FALSE(rvh_deleted_observer.deleted()); | 1833 EXPECT_FALSE(rvh_deleted_observer.deleted()); |
| 1846 } | 1834 } |
| 1847 } | 1835 } |
| 1848 | 1836 |
| 1849 } // namespace content | 1837 } // namespace content |
| OLD | NEW |