| 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 <string.h> | 6 #include <string.h> |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 | 625 |
| 626 CompositorFrame frame_out; | 626 CompositorFrame frame_out; |
| 627 base::PickleIterator iter(msg); | 627 base::PickleIterator iter(msg); |
| 628 EXPECT_TRUE(IPC::ParamTraits<CompositorFrame>::Read(&msg, &iter, &frame_out)); | 628 EXPECT_TRUE(IPC::ParamTraits<CompositorFrame>::Read(&msg, &iter, &frame_out)); |
| 629 | 629 |
| 630 ASSERT_EQ(2u, frame_out.resource_list.size()); | 630 ASSERT_EQ(2u, frame_out.resource_list.size()); |
| 631 Compare(arbitrary_resource1, frame_out.resource_list[0]); | 631 Compare(arbitrary_resource1, frame_out.resource_list[0]); |
| 632 Compare(arbitrary_resource2, frame_out.resource_list[1]); | 632 Compare(arbitrary_resource2, frame_out.resource_list[1]); |
| 633 } | 633 } |
| 634 | 634 |
| 635 TEST_F(CCParamTraitsTest, SurfaceInfo) { |
| 636 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL); |
| 637 const cc::SurfaceId kArbitrarySurfaceId( |
| 638 kArbitraryFrameSinkId, |
| 639 cc::LocalSurfaceId(3, base::UnguessableToken::Create())); |
| 640 constexpr float kArbitraryDeviceScaleFactor = 0.9f; |
| 641 const gfx::Size kArbitrarySize(65, 321); |
| 642 const cc::SurfaceInfo surface_info_in( |
| 643 kArbitrarySurfaceId, kArbitraryDeviceScaleFactor, kArbitrarySize); |
| 644 IPC::ParamTraits<cc::SurfaceInfo>::Write(&msg, surface_info_in); |
| 645 |
| 646 cc::SurfaceInfo surface_info_out; |
| 647 base::PickleIterator iter(msg); |
| 648 EXPECT_TRUE( |
| 649 IPC::ParamTraits<cc::SurfaceInfo>::Read(&msg, &iter, &surface_info_out)); |
| 650 |
| 651 ASSERT_EQ(surface_info_in, surface_info_out); |
| 652 } |
| 653 |
| 635 } // namespace | 654 } // namespace |
| 636 } // namespace content | 655 } // namespace content |
| OLD | NEW |