| 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 1804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1815 view_->SetSize(size3); | 1815 view_->SetSize(size3); |
| 1816 EXPECT_EQ(size2.ToString(), view_->GetRequestedRendererSize().ToString()); | 1816 EXPECT_EQ(size2.ToString(), view_->GetRequestedRendererSize().ToString()); |
| 1817 EXPECT_EQ(0u, sink_->message_count()); | 1817 EXPECT_EQ(0u, sink_->message_count()); |
| 1818 | 1818 |
| 1819 // Receive a frame of the new size, should be skipped and not produce a Resize | 1819 // Receive a frame of the new size, should be skipped and not produce a Resize |
| 1820 // message. | 1820 // message. |
| 1821 view_->OnSwapCompositorFrame( | 1821 view_->OnSwapCompositorFrame( |
| 1822 0, MakeDelegatedFrame(1.f, size3, gfx::Rect(size3))); | 1822 0, MakeDelegatedFrame(1.f, size3, gfx::Rect(size3))); |
| 1823 // Expect the frame ack; | 1823 // Expect the frame ack; |
| 1824 EXPECT_EQ(1u, sink_->message_count()); | 1824 EXPECT_EQ(1u, sink_->message_count()); |
| 1825 EXPECT_EQ(ViewMsg_SwapCompositorFrameAck::ID, sink_->GetMessageAt(0)->type()); | 1825 EXPECT_EQ(ViewMsg_ReclaimCompositorResources::ID, |
| 1826 sink_->GetMessageAt(0)->type()); |
| 1826 sink_->ClearMessages(); | 1827 sink_->ClearMessages(); |
| 1827 EXPECT_EQ(size2.ToString(), view_->GetRequestedRendererSize().ToString()); | 1828 EXPECT_EQ(size2.ToString(), view_->GetRequestedRendererSize().ToString()); |
| 1828 | 1829 |
| 1829 // Receive a frame of the correct size, should not be skipped and, and should | 1830 // Receive a frame of the correct size, should not be skipped and, and should |
| 1830 // produce a Resize message after the commit. | 1831 // produce a Resize message after the commit. |
| 1831 view_->OnSwapCompositorFrame( | 1832 view_->OnSwapCompositorFrame( |
| 1832 0, MakeDelegatedFrame(1.f, size2, gfx::Rect(size2))); | 1833 0, MakeDelegatedFrame(1.f, size2, gfx::Rect(size2))); |
| 1833 cc::SurfaceId surface_id = view_->surface_id(); | 1834 cc::SurfaceId surface_id = view_->surface_id(); |
| 1834 if (surface_id.is_null()) { | 1835 if (surface_id.is_null()) { |
| 1835 // No frame ack yet. | 1836 // No frame ack yet. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1854 // call | 1855 // call |
| 1855 // ui::WindowEventDispatcher::SynthesizeMouseMoveAfterChangeToWindow, | 1856 // ui::WindowEventDispatcher::SynthesizeMouseMoveAfterChangeToWindow, |
| 1856 // which the above WaitForCommit may cause to be picked up. Be robust | 1857 // which the above WaitForCommit may cause to be picked up. Be robust |
| 1857 // to this extra IPC coming in. | 1858 // to this extra IPC coming in. |
| 1858 InputMsg_HandleInputEvent::Param params; | 1859 InputMsg_HandleInputEvent::Param params; |
| 1859 InputMsg_HandleInputEvent::Read(msg, ¶ms); | 1860 InputMsg_HandleInputEvent::Read(msg, ¶ms); |
| 1860 const blink::WebInputEvent* event = std::get<0>(params); | 1861 const blink::WebInputEvent* event = std::get<0>(params); |
| 1861 EXPECT_EQ(blink::WebInputEvent::MouseMove, event->type); | 1862 EXPECT_EQ(blink::WebInputEvent::MouseMove, event->type); |
| 1862 break; | 1863 break; |
| 1863 } | 1864 } |
| 1864 case ViewMsg_SwapCompositorFrameAck::ID: | 1865 case ViewMsg_ReclaimCompositorResources::ID: |
| 1865 break; | 1866 break; |
| 1866 case ViewMsg_Resize::ID: { | 1867 case ViewMsg_Resize::ID: { |
| 1867 EXPECT_FALSE(has_resize); | 1868 EXPECT_FALSE(has_resize); |
| 1868 ViewMsg_Resize::Param params; | 1869 ViewMsg_Resize::Param params; |
| 1869 ViewMsg_Resize::Read(msg, ¶ms); | 1870 ViewMsg_Resize::Read(msg, ¶ms); |
| 1870 EXPECT_EQ(size3.ToString(), std::get<0>(params).new_size.ToString()); | 1871 EXPECT_EQ(size3.ToString(), std::get<0>(params).new_size.ToString()); |
| 1871 has_resize = true; | 1872 has_resize = true; |
| 1872 break; | 1873 break; |
| 1873 } | 1874 } |
| 1874 default: | 1875 default: |
| (...skipping 2441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4316 // No bounds at index 1. | 4317 // No bounds at index 1. |
| 4317 EXPECT_FALSE(text_input_client()->GetCompositionCharacterBounds(1, &bound)); | 4318 EXPECT_FALSE(text_input_client()->GetCompositionCharacterBounds(1, &bound)); |
| 4318 | 4319 |
| 4319 // Valid bound at index 0. | 4320 // Valid bound at index 0. |
| 4320 EXPECT_TRUE(text_input_client()->GetCompositionCharacterBounds(0, &bound)); | 4321 EXPECT_TRUE(text_input_client()->GetCompositionCharacterBounds(0, &bound)); |
| 4321 EXPECT_EQ(4 + (int)index, bound.height()); | 4322 EXPECT_EQ(4 + (int)index, bound.height()); |
| 4322 } | 4323 } |
| 4323 } | 4324 } |
| 4324 | 4325 |
| 4325 } // namespace content | 4326 } // namespace content |
| OLD | NEW |