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

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

Issue 2691583003: Removed fields from Selection classes (Closed)
Patch Set: Forgot to remove fields from test Created 3 years, 10 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/selection_struct_traits.h ('k') | cc/trees/layer_tree_impl.cc » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "base/message_loop/message_loop.h" 5 #include "base/message_loop/message_loop.h"
6 #include "cc/input/selection.h" 6 #include "cc/input/selection.h"
7 #include "cc/ipc/traits_test_service.mojom.h" 7 #include "cc/ipc/traits_test_service.mojom.h"
8 #include "cc/output/copy_output_result.h" 8 #include "cc/output/copy_output_result.h"
9 #include "cc/quads/debug_border_draw_quad.h" 9 #include "cc/quads/debug_border_draw_quad.h"
10 #include "cc/quads/render_pass.h" 10 #include "cc/quads/render_pass.h"
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 const uint32_t root_background_color = 1337; 290 const uint32_t root_background_color = 1337;
291 Selection<gfx::SelectionBound> selection; 291 Selection<gfx::SelectionBound> selection;
292 selection.start.SetEdge(gfx::PointF(1234.5f, 67891.f), 292 selection.start.SetEdge(gfx::PointF(1234.5f, 67891.f),
293 gfx::PointF(5432.1f, 1987.6f)); 293 gfx::PointF(5432.1f, 1987.6f));
294 selection.start.set_visible(true); 294 selection.start.set_visible(true);
295 selection.start.set_type(gfx::SelectionBound::CENTER); 295 selection.start.set_type(gfx::SelectionBound::CENTER);
296 selection.end.SetEdge(gfx::PointF(1337.5f, 52124.f), 296 selection.end.SetEdge(gfx::PointF(1337.5f, 52124.f),
297 gfx::PointF(1234.3f, 8765.6f)); 297 gfx::PointF(1234.3f, 8765.6f));
298 selection.end.set_visible(false); 298 selection.end.set_visible(false);
299 selection.end.set_type(gfx::SelectionBound::RIGHT); 299 selection.end.set_type(gfx::SelectionBound::RIGHT);
300 selection.is_editable = true;
301 selection.is_empty_text_form_control = true;
302 ui::LatencyInfo latency_info; 300 ui::LatencyInfo latency_info;
303 latency_info.AddLatencyNumber( 301 latency_info.AddLatencyNumber(
304 ui::LATENCY_BEGIN_SCROLL_LISTENER_UPDATE_MAIN_COMPONENT, 1337, 7331); 302 ui::LATENCY_BEGIN_SCROLL_LISTENER_UPDATE_MAIN_COMPONENT, 1337, 7331);
305 std::vector<ui::LatencyInfo> latency_infos = {latency_info}; 303 std::vector<ui::LatencyInfo> latency_infos = {latency_info};
306 std::vector<SurfaceId> referenced_surfaces; 304 std::vector<SurfaceId> referenced_surfaces;
307 SurfaceId id(FrameSinkId(1234, 4321), 305 SurfaceId id(FrameSinkId(1234, 4321),
308 LocalSurfaceId(5678, base::UnguessableToken::Create())); 306 LocalSurfaceId(5678, base::UnguessableToken::Create()));
309 referenced_surfaces.push_back(id); 307 referenced_surfaces.push_back(id);
310 308
311 CompositorFrameMetadata input; 309 CompositorFrameMetadata input;
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 836
839 TEST_F(StructTraitsTest, Selection) { 837 TEST_F(StructTraitsTest, Selection) {
840 gfx::SelectionBound start; 838 gfx::SelectionBound start;
841 start.SetEdge(gfx::PointF(1234.5f, 67891.f), gfx::PointF(5432.1f, 1987.6f)); 839 start.SetEdge(gfx::PointF(1234.5f, 67891.f), gfx::PointF(5432.1f, 1987.6f));
842 start.set_visible(true); 840 start.set_visible(true);
843 start.set_type(gfx::SelectionBound::CENTER); 841 start.set_type(gfx::SelectionBound::CENTER);
844 gfx::SelectionBound end; 842 gfx::SelectionBound end;
845 end.SetEdge(gfx::PointF(1337.5f, 52124.f), gfx::PointF(1234.3f, 8765.6f)); 843 end.SetEdge(gfx::PointF(1337.5f, 52124.f), gfx::PointF(1234.3f, 8765.6f));
846 end.set_visible(false); 844 end.set_visible(false);
847 end.set_type(gfx::SelectionBound::RIGHT); 845 end.set_type(gfx::SelectionBound::RIGHT);
848 const bool is_editable = true;
849 const bool is_empty_text_form_control = true;
850 Selection<gfx::SelectionBound> input; 846 Selection<gfx::SelectionBound> input;
851 input.start = start; 847 input.start = start;
852 input.end = end; 848 input.end = end;
853 input.is_editable = is_editable;
854 input.is_empty_text_form_control = is_empty_text_form_control;
855 mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy(); 849 mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy();
856 Selection<gfx::SelectionBound> output; 850 Selection<gfx::SelectionBound> output;
857 proxy->EchoSelection(input, &output); 851 proxy->EchoSelection(input, &output);
858 EXPECT_EQ(start, output.start); 852 EXPECT_EQ(start, output.start);
859 EXPECT_EQ(end, output.end); 853 EXPECT_EQ(end, output.end);
860 EXPECT_EQ(is_editable, output.is_editable);
861 EXPECT_EQ(is_empty_text_form_control, output.is_empty_text_form_control);
862 } 854 }
863 855
864 TEST_F(StructTraitsTest, SurfaceId) { 856 TEST_F(StructTraitsTest, SurfaceId) {
865 static constexpr FrameSinkId frame_sink_id(1337, 1234); 857 static constexpr FrameSinkId frame_sink_id(1337, 1234);
866 static LocalSurfaceId local_surface_id(0xfbadbeef, 858 static LocalSurfaceId local_surface_id(0xfbadbeef,
867 base::UnguessableToken::Create()); 859 base::UnguessableToken::Create());
868 SurfaceId input(frame_sink_id, local_surface_id); 860 SurfaceId input(frame_sink_id, local_surface_id);
869 mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy(); 861 mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy();
870 SurfaceId output; 862 SurfaceId output;
871 proxy->EchoSurfaceId(input, &output); 863 proxy->EchoSurfaceId(input, &output);
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 EXPECT_EQ(u_plane_resource_id, out_quad->u_plane_resource_id()); 1074 EXPECT_EQ(u_plane_resource_id, out_quad->u_plane_resource_id());
1083 EXPECT_EQ(v_plane_resource_id, out_quad->v_plane_resource_id()); 1075 EXPECT_EQ(v_plane_resource_id, out_quad->v_plane_resource_id());
1084 EXPECT_EQ(a_plane_resource_id, out_quad->a_plane_resource_id()); 1076 EXPECT_EQ(a_plane_resource_id, out_quad->a_plane_resource_id());
1085 EXPECT_EQ(color_space, out_quad->color_space); 1077 EXPECT_EQ(color_space, out_quad->color_space);
1086 EXPECT_EQ(resource_offset, out_quad->resource_offset); 1078 EXPECT_EQ(resource_offset, out_quad->resource_offset);
1087 EXPECT_EQ(resource_multiplier, out_quad->resource_multiplier); 1079 EXPECT_EQ(resource_multiplier, out_quad->resource_multiplier);
1088 EXPECT_EQ(bits_per_channel, out_quad->bits_per_channel); 1080 EXPECT_EQ(bits_per_channel, out_quad->bits_per_channel);
1089 } 1081 }
1090 1082
1091 } // namespace cc 1083 } // namespace cc
OLDNEW
« no previous file with comments | « cc/ipc/selection_struct_traits.h ('k') | cc/trees/layer_tree_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698