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 1768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1779 // Call WasResized to flush the old screen info. | 1779 // Call WasResized to flush the old screen info. |
1780 view_->GetRenderWidgetHost()->WasResized(); | 1780 view_->GetRenderWidgetHost()->WasResized(); |
1781 { | 1781 { |
1782 // 0 is CreatingNew message. | 1782 // 0 is CreatingNew message. |
1783 const IPC::Message* msg = sink_->GetMessageAt(0); | 1783 const IPC::Message* msg = sink_->GetMessageAt(0); |
1784 EXPECT_EQ(ViewMsg_Resize::ID, msg->type()); | 1784 EXPECT_EQ(ViewMsg_Resize::ID, msg->type()); |
1785 ViewMsg_Resize::Param params; | 1785 ViewMsg_Resize::Param params; |
1786 ViewMsg_Resize::Read(msg, ¶ms); | 1786 ViewMsg_Resize::Read(msg, ¶ms); |
1787 EXPECT_EQ( | 1787 EXPECT_EQ( |
1788 "0,0 800x600", | 1788 "0,0 800x600", |
1789 gfx::Rect(std::get<0>(params).screen_info.availableRect).ToString()); | 1789 std::get<0>(params).screen_info.available_rect.ToString()); |
1790 EXPECT_EQ("800x600", std::get<0>(params).new_size.ToString()); | 1790 EXPECT_EQ("800x600", std::get<0>(params).new_size.ToString()); |
1791 // Resizes are blocked until we swapped a frame of the correct size, and | 1791 // Resizes are blocked until we swapped a frame of the correct size, and |
1792 // we've committed it. | 1792 // we've committed it. |
1793 view_->OnSwapCompositorFrame( | 1793 view_->OnSwapCompositorFrame( |
1794 0, MakeDelegatedFrame(1.f, std::get<0>(params).new_size, | 1794 0, MakeDelegatedFrame(1.f, std::get<0>(params).new_size, |
1795 gfx::Rect(std::get<0>(params).new_size))); | 1795 gfx::Rect(std::get<0>(params).new_size))); |
1796 ui::DrawWaiterForTest::WaitForCommit( | 1796 ui::DrawWaiterForTest::WaitForCommit( |
1797 root_window->GetHost()->compositor()); | 1797 root_window->GetHost()->compositor()); |
1798 } | 1798 } |
1799 | 1799 |
1800 widget_host_->ResetSizeAndRepaintPendingFlags(); | 1800 widget_host_->ResetSizeAndRepaintPendingFlags(); |
1801 sink_->ClearMessages(); | 1801 sink_->ClearMessages(); |
1802 | 1802 |
1803 // Make sure the corrent screen size is set along in the resize | 1803 // Make sure the corrent screen size is set along in the resize |
1804 // request when the screen size has changed. | 1804 // request when the screen size has changed. |
1805 aura_test_helper_->test_screen()->SetUIScale(0.5); | 1805 aura_test_helper_->test_screen()->SetUIScale(0.5); |
1806 EXPECT_EQ(1u, sink_->message_count()); | 1806 EXPECT_EQ(1u, sink_->message_count()); |
1807 { | 1807 { |
1808 const IPC::Message* msg = sink_->GetMessageAt(0); | 1808 const IPC::Message* msg = sink_->GetMessageAt(0); |
1809 EXPECT_EQ(ViewMsg_Resize::ID, msg->type()); | 1809 EXPECT_EQ(ViewMsg_Resize::ID, msg->type()); |
1810 ViewMsg_Resize::Param params; | 1810 ViewMsg_Resize::Param params; |
1811 ViewMsg_Resize::Read(msg, ¶ms); | 1811 ViewMsg_Resize::Read(msg, ¶ms); |
1812 EXPECT_EQ( | 1812 EXPECT_EQ( |
1813 "0,0 1600x1200", | 1813 "0,0 1600x1200", |
1814 gfx::Rect(std::get<0>(params).screen_info.availableRect).ToString()); | 1814 std::get<0>(params).screen_info.available_rect.ToString()); |
1815 EXPECT_EQ("1600x1200", std::get<0>(params).new_size.ToString()); | 1815 EXPECT_EQ("1600x1200", std::get<0>(params).new_size.ToString()); |
1816 view_->OnSwapCompositorFrame( | 1816 view_->OnSwapCompositorFrame( |
1817 0, MakeDelegatedFrame(1.f, std::get<0>(params).new_size, | 1817 0, MakeDelegatedFrame(1.f, std::get<0>(params).new_size, |
1818 gfx::Rect(std::get<0>(params).new_size))); | 1818 gfx::Rect(std::get<0>(params).new_size))); |
1819 ui::DrawWaiterForTest::WaitForCommit( | 1819 ui::DrawWaiterForTest::WaitForCommit( |
1820 root_window->GetHost()->compositor()); | 1820 root_window->GetHost()->compositor()); |
1821 } | 1821 } |
1822 } | 1822 } |
1823 | 1823 |
1824 // Swapping a frame should notify the window. | 1824 // Swapping a frame should notify the window. |
(...skipping 2749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4574 | 4574 |
4575 // Retrieve the selected text from clipboard and verify it is as expected. | 4575 // Retrieve the selected text from clipboard and verify it is as expected. |
4576 base::string16 result_text; | 4576 base::string16 result_text; |
4577 clipboard->ReadText(ui::CLIPBOARD_TYPE_SELECTION, &result_text); | 4577 clipboard->ReadText(ui::CLIPBOARD_TYPE_SELECTION, &result_text); |
4578 EXPECT_EQ(expected_text, result_text); | 4578 EXPECT_EQ(expected_text, result_text); |
4579 } | 4579 } |
4580 } | 4580 } |
4581 #endif | 4581 #endif |
4582 | 4582 |
4583 } // namespace content | 4583 } // namespace content |
OLD | NEW |