Index: cc/input/layer_selection_bound_unittest.cc |
diff --git a/cc/input/layer_selection_bound_unittest.cc b/cc/input/layer_selection_bound_unittest.cc |
index 53f3ac1b8bd434abda5fa94ac0990a07acb80785..b9f77cee0ca5ac2cc916aa10e0a41d51f73f0f45 100644 |
--- a/cc/input/layer_selection_bound_unittest.cc |
+++ b/cc/input/layer_selection_bound_unittest.cc |
@@ -34,5 +34,39 @@ TEST(LayerSelectionBoundTest, AllTypePermutations) { |
VerifySerializeAndDeserializeProto(bound); |
} |
+void VerifySerializeAndDeserializeLayerSelectionProto( |
vmpstr
2015/12/18 07:50:02
Move this after the other function above please. I
nyquist
2015/12/18 18:54:35
Done.
|
+ const LayerSelection& selection1) { |
+ proto::LayerSelection proto; |
+ LayerSelectionToProtobuf(selection1, &proto); |
+ LayerSelection selection2; |
+ LayerSelectionFromProtobuf(&selection2, proto); |
+ EXPECT_EQ(selection1, selection2); |
+} |
+ |
+TEST(LayerSelectionTest, AllSelectionPermutations) { |
+ LayerSelectionBound start; |
+ start.type = SelectionBoundType::SELECTION_BOUND_LEFT; |
+ start.edge_top = gfx::Point(3, 14); |
+ start.edge_bottom = gfx::Point(6, 28); |
+ start.layer_id = 42; |
vmpstr
2015/12/18 07:50:02
blank after this line please
nyquist
2015/12/18 18:54:35
Done.
|
+ LayerSelectionBound end; |
+ end.type = SelectionBoundType::SELECTION_BOUND_RIGHT; |
+ end.edge_top = gfx::Point(14, 3); |
+ end.edge_bottom = gfx::Point(28, 6); |
+ end.layer_id = 24; |
vmpstr
2015/12/18 07:50:02
blank after this line please
nyquist
2015/12/18 18:54:35
Done.
|
+ LayerSelection selection; |
+ selection.start = start; |
+ selection.end = end; |
+ selection.is_editable = true; |
+ selection.is_empty_text_form_control = true; |
vmpstr
2015/12/18 07:50:02
blank after this line please
nyquist
2015/12/18 18:54:35
Done.
|
+ VerifySerializeAndDeserializeLayerSelectionProto(selection); |
+ selection.is_empty_text_form_control = false; |
+ VerifySerializeAndDeserializeLayerSelectionProto(selection); |
+ selection.is_editable = false; |
+ VerifySerializeAndDeserializeLayerSelectionProto(selection); |
+ selection.is_empty_text_form_control = true; |
+ VerifySerializeAndDeserializeLayerSelectionProto(selection); |
+} |
+ |
} // namespace |
} // namespace cc |