Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Side by Side Diff: cc/ipc/cc_param_traits_unittest.cc

Issue 2720503008: Add cc::SurfaceInfo::is_valid() (Closed)
Patch Set: Added Log() Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/ipc/cc_param_traits_macros.h ('k') | cc/ipc/surface_info_struct_traits.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « cc/ipc/cc_param_traits_macros.h ('k') | cc/ipc/surface_info_struct_traits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698