| OLD | NEW |
| 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 "content/browser/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <tuple> | 10 #include <tuple> |
| (...skipping 1667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1678 return frame; | 1678 return frame; |
| 1679 } | 1679 } |
| 1680 | 1680 |
| 1681 // If the ui::Compositor has been reset then resources are returned back to the | 1681 // If the ui::Compositor has been reset then resources are returned back to the |
| 1682 // client in response to the swap. This test verifies that the returned | 1682 // client in response to the swap. This test verifies that the returned |
| 1683 // resources are indeed reported as being in response to a swap. | 1683 // resources are indeed reported as being in response to a swap. |
| 1684 TEST_F(RenderWidgetHostViewAuraTest, ResettingCompositorReturnsResources) { | 1684 TEST_F(RenderWidgetHostViewAuraTest, ResettingCompositorReturnsResources) { |
| 1685 FakeSurfaceObserver manager_observer; | 1685 FakeSurfaceObserver manager_observer; |
| 1686 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); | 1686 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); |
| 1687 cc::SurfaceManager* manager = | 1687 cc::SurfaceManager* manager = |
| 1688 factory->GetContextFactory()->GetSurfaceManager(); | 1688 factory->GetContextFactoryPrivate()->GetSurfaceManager(); |
| 1689 manager->AddObserver(&manager_observer); | 1689 manager->AddObserver(&manager_observer); |
| 1690 | 1690 |
| 1691 gfx::Size view_size(100, 100); | 1691 gfx::Size view_size(100, 100); |
| 1692 gfx::Rect view_rect(view_size); | 1692 gfx::Rect view_rect(view_size); |
| 1693 | 1693 |
| 1694 view_->InitAsChild(nullptr); | 1694 view_->InitAsChild(nullptr); |
| 1695 aura::client::ParentWindowWithContext( | 1695 aura::client::ParentWindowWithContext( |
| 1696 view_->GetNativeView(), parent_view_->GetNativeView()->GetRootWindow(), | 1696 view_->GetNativeView(), parent_view_->GetNativeView()->GetRootWindow(), |
| 1697 gfx::Rect()); | 1697 gfx::Rect()); |
| 1698 view_->SetSize(view_size); | 1698 view_->SetSize(view_size); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1746 EXPECT_FALSE(std::get<1>(params)); // is_swap_ack | 1746 EXPECT_FALSE(std::get<1>(params)); // is_swap_ack |
| 1747 } | 1747 } |
| 1748 } | 1748 } |
| 1749 | 1749 |
| 1750 // This test verifies that when the compositor_frame_sink_id changes, then | 1750 // This test verifies that when the compositor_frame_sink_id changes, then |
| 1751 // DelegateFrameHost returns compositor resources without a swap ack. | 1751 // DelegateFrameHost returns compositor resources without a swap ack. |
| 1752 TEST_F(RenderWidgetHostViewAuraTest, TwoOutputSurfaces) { | 1752 TEST_F(RenderWidgetHostViewAuraTest, TwoOutputSurfaces) { |
| 1753 FakeSurfaceObserver manager_observer; | 1753 FakeSurfaceObserver manager_observer; |
| 1754 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); | 1754 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); |
| 1755 cc::SurfaceManager* manager = | 1755 cc::SurfaceManager* manager = |
| 1756 factory->GetContextFactory()->GetSurfaceManager(); | 1756 factory->GetContextFactoryPrivate()->GetSurfaceManager(); |
| 1757 manager->AddObserver(&manager_observer); | 1757 manager->AddObserver(&manager_observer); |
| 1758 | 1758 |
| 1759 gfx::Size view_size(100, 100); | 1759 gfx::Size view_size(100, 100); |
| 1760 gfx::Rect view_rect(view_size); | 1760 gfx::Rect view_rect(view_size); |
| 1761 | 1761 |
| 1762 view_->InitAsChild(nullptr); | 1762 view_->InitAsChild(nullptr); |
| 1763 aura::client::ParentWindowWithContext( | 1763 aura::client::ParentWindowWithContext( |
| 1764 view_->GetNativeView(), parent_view_->GetNativeView()->GetRootWindow(), | 1764 view_->GetNativeView(), parent_view_->GetNativeView()->GetRootWindow(), |
| 1765 gfx::Rect()); | 1765 gfx::Rect()); |
| 1766 view_->SetSize(view_size); | 1766 view_->SetSize(view_size); |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1912 | 1912 |
| 1913 view_->OnSwapCompositorFrame(0, | 1913 view_->OnSwapCompositorFrame(0, |
| 1914 MakeDelegatedFrame(1.f, view_size, view_rect)); | 1914 MakeDelegatedFrame(1.f, view_size, view_rect)); |
| 1915 std::unique_ptr<ui::LayerTreeOwner> mirror(wm::MirrorLayers( | 1915 std::unique_ptr<ui::LayerTreeOwner> mirror(wm::MirrorLayers( |
| 1916 view_->GetNativeView(), false /* sync_bounds */)); | 1916 view_->GetNativeView(), false /* sync_bounds */)); |
| 1917 | 1917 |
| 1918 cc::SurfaceId id = view_->GetDelegatedFrameHost()->SurfaceIdForTesting(); | 1918 cc::SurfaceId id = view_->GetDelegatedFrameHost()->SurfaceIdForTesting(); |
| 1919 if (id.is_valid()) { | 1919 if (id.is_valid()) { |
| 1920 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); | 1920 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); |
| 1921 cc::SurfaceManager* manager = | 1921 cc::SurfaceManager* manager = |
| 1922 factory->GetContextFactory()->GetSurfaceManager(); | 1922 factory->GetContextFactoryPrivate()->GetSurfaceManager(); |
| 1923 cc::Surface* surface = manager->GetSurfaceForId(id); | 1923 cc::Surface* surface = manager->GetSurfaceForId(id); |
| 1924 EXPECT_TRUE(surface); | 1924 EXPECT_TRUE(surface); |
| 1925 | 1925 |
| 1926 // An orphaned mirror should not be a destruction dependency. | 1926 // An orphaned mirror should not be a destruction dependency. |
| 1927 EXPECT_EQ(1u, surface->GetDestructionDependencyCount()); | 1927 EXPECT_EQ(1u, surface->GetDestructionDependencyCount()); |
| 1928 | 1928 |
| 1929 // Both layers should be destruction dependencies. | 1929 // Both layers should be destruction dependencies. |
| 1930 root->layer()->Add(mirror->root()); | 1930 root->layer()->Add(mirror->root()); |
| 1931 EXPECT_EQ(2u, surface->GetDestructionDependencyCount()); | 1931 EXPECT_EQ(2u, surface->GetDestructionDependencyCount()); |
| 1932 root->layer()->Remove(mirror->root()); | 1932 root->layer()->Remove(mirror->root()); |
| (...skipping 2743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4676 | 4676 |
| 4677 // Retrieve the selected text from clipboard and verify it is as expected. | 4677 // Retrieve the selected text from clipboard and verify it is as expected. |
| 4678 base::string16 result_text; | 4678 base::string16 result_text; |
| 4679 clipboard->ReadText(ui::CLIPBOARD_TYPE_SELECTION, &result_text); | 4679 clipboard->ReadText(ui::CLIPBOARD_TYPE_SELECTION, &result_text); |
| 4680 EXPECT_EQ(expected_text, result_text); | 4680 EXPECT_EQ(expected_text, result_text); |
| 4681 } | 4681 } |
| 4682 } | 4682 } |
| 4683 #endif | 4683 #endif |
| 4684 | 4684 |
| 4685 } // namespace content | 4685 } // namespace content |
| OLD | NEW |