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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <tuple> | 9 #include <tuple> |
10 | 10 |
(...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1270 } | 1270 } |
1271 | 1271 |
1272 // This tests that a compositor frame received with a stale content source ID | 1272 // This tests that a compositor frame received with a stale content source ID |
1273 // in its metadata is properly discarded. | 1273 // in its metadata is properly discarded. |
1274 TEST_F(RenderWidgetHostTest, SwapCompositorFrameWithBadSourceId) { | 1274 TEST_F(RenderWidgetHostTest, SwapCompositorFrameWithBadSourceId) { |
1275 host_->StartNewContentRenderingTimeout(100); | 1275 host_->StartNewContentRenderingTimeout(100); |
1276 host_->OnFirstPaintAfterLoad(); | 1276 host_->OnFirstPaintAfterLoad(); |
1277 | 1277 |
1278 // First swap a frame with an invalid ID. | 1278 // First swap a frame with an invalid ID. |
1279 cc::CompositorFrame frame; | 1279 cc::CompositorFrame frame; |
| 1280 frame.metadata.begin_frame_ack = cc::BeginFrameAck(0, 1, 1, 0, true); |
1280 frame.metadata.content_source_id = 99; | 1281 frame.metadata.content_source_id = 99; |
1281 host_->OnMessageReceived(ViewHostMsg_SwapCompositorFrame( | 1282 host_->OnMessageReceived(ViewHostMsg_SwapCompositorFrame( |
1282 0, 0, frame, std::vector<IPC::Message>())); | 1283 0, 0, frame, std::vector<IPC::Message>())); |
1283 EXPECT_FALSE( | 1284 EXPECT_FALSE( |
1284 static_cast<TestView*>(host_->GetView())->did_swap_compositor_frame()); | 1285 static_cast<TestView*>(host_->GetView())->did_swap_compositor_frame()); |
1285 static_cast<TestView*>(host_->GetView())->reset_did_swap_compositor_frame(); | 1286 static_cast<TestView*>(host_->GetView())->reset_did_swap_compositor_frame(); |
1286 | 1287 |
1287 // Test with a valid content ID as a control. | 1288 // Test with a valid content ID as a control. |
1288 frame.metadata.content_source_id = 100; | 1289 frame.metadata.content_source_id = 100; |
1289 host_->OnMessageReceived(ViewHostMsg_SwapCompositorFrame( | 1290 host_->OnMessageReceived(ViewHostMsg_SwapCompositorFrame( |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1794 ui::LatencyInfo()); | 1795 ui::LatencyInfo()); |
1795 | 1796 |
1796 | 1797 |
1797 // Tests RWHI::ForwardWheelEventWithLatencyInfo(). | 1798 // Tests RWHI::ForwardWheelEventWithLatencyInfo(). |
1798 SimulateWheelEventWithLatencyInfo(-5, 0, 0, true, ui::LatencyInfo()); | 1799 SimulateWheelEventWithLatencyInfo(-5, 0, 0, true, ui::LatencyInfo()); |
1799 | 1800 |
1800 ASSERT_FALSE(host_->input_router()->HasPendingEvents()); | 1801 ASSERT_FALSE(host_->input_router()->HasPendingEvents()); |
1801 } | 1802 } |
1802 | 1803 |
1803 } // namespace content | 1804 } // namespace content |
OLD | NEW |