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

Side by Side Diff: cc/input/layer_selection_bound_unittest.cc

Issue 1532973002: Add support for (de)serializing LayerSelectionBound. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made operator members Created 5 years 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/input/layer_selection_bound.cc ('k') | cc/proto/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "cc/input/layer_selection_bound.h"
6
7 #include "cc/proto/layer_selection_bound.pb.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "ui/gfx/geometry/point.h"
10
11 namespace cc {
12 namespace {
13
14 void VerifySerializeAndDeserializeProto(const LayerSelectionBound& bound1) {
15 proto::LayerSelectionBound proto;
16 bound1.ToProtobuf(&proto);
17 LayerSelectionBound bound2;
18 bound2.FromProtobuf(proto);
19 EXPECT_EQ(bound1, bound2);
20 }
21
22 TEST(LayerSelectionBoundTest, AllTypePermutations) {
23 LayerSelectionBound bound;
24 bound.type = SelectionBoundType::SELECTION_BOUND_LEFT;
25 bound.edge_top = gfx::Point(3, 14);
26 bound.edge_bottom = gfx::Point(6, 28);
27 bound.layer_id = 42;
28 VerifySerializeAndDeserializeProto(bound);
29 bound.type = SelectionBoundType::SELECTION_BOUND_RIGHT;
30 VerifySerializeAndDeserializeProto(bound);
31 bound.type = SelectionBoundType::SELECTION_BOUND_CENTER;
32 VerifySerializeAndDeserializeProto(bound);
33 bound.type = SelectionBoundType::SELECTION_BOUND_EMPTY;
34 VerifySerializeAndDeserializeProto(bound);
35 }
36
37 } // namespace
38 } // namespace cc
OLDNEW
« no previous file with comments | « cc/input/layer_selection_bound.cc ('k') | cc/proto/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698