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

Side by Side Diff: ui/display/mojo/display_struct_traits_unittest.cc

Issue 2732093006: Write mojom and EnumTraits for display::HDCPState. (Closed)
Patch Set: . 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 | « ui/display/mojo/display_struct_traits_test.mojom ('k') | no next file » | 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 <memory> 5 #include <memory>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "mojo/public/cpp/bindings/binding_set.h" 9 #include "mojo/public/cpp/bindings/binding_set.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 const DisplayPlacement& in, 57 const DisplayPlacement& in,
58 const EchoDisplayPlacementCallback& callback) override { 58 const EchoDisplayPlacementCallback& callback) override {
59 callback.Run(in); 59 callback.Run(in);
60 } 60 }
61 61
62 void EchoDisplayLayout(std::unique_ptr<display::DisplayLayout> in, 62 void EchoDisplayLayout(std::unique_ptr<display::DisplayLayout> in,
63 const EchoDisplayLayoutCallback& callback) override { 63 const EchoDisplayLayoutCallback& callback) override {
64 callback.Run(std::move(in)); 64 callback.Run(std::move(in));
65 } 65 }
66 66
67 void EchoHDCPState(display::HDCPState in,
68 const EchoHDCPStateCallback& callback) override {
69 callback.Run(in);
70 }
71
67 void EchoGammaRampRGBEntry( 72 void EchoGammaRampRGBEntry(
68 const GammaRampRGBEntry& in, 73 const GammaRampRGBEntry& in,
69 const EchoGammaRampRGBEntryCallback& callback) override { 74 const EchoGammaRampRGBEntryCallback& callback) override {
70 callback.Run(in); 75 callback.Run(in);
71 } 76 }
72 77
73 base::MessageLoop loop_; // A MessageLoop is needed for Mojo IPC to work. 78 base::MessageLoop loop_; // A MessageLoop is needed for Mojo IPC to work.
74 mojo::BindingSet<mojom::DisplayStructTraitsTest> traits_test_bindings_; 79 mojo::BindingSet<mojom::DisplayStructTraitsTest> traits_test_bindings_;
75 80
76 DISALLOW_COPY_AND_ASSIGN(DisplayStructTraitsTest); 81 DISALLOW_COPY_AND_ASSIGN(DisplayStructTraitsTest);
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 has_overscan, has_color_correction_matrix, display_name, sys_path, 441 has_overscan, has_color_correction_matrix, display_name, sys_path,
437 product_id, std::move(modes), edid, current_mode, native_mode, 442 product_id, std::move(modes), edid, current_mode, native_mode,
438 maximum_cursor_size); 443 maximum_cursor_size);
439 444
440 std::unique_ptr<DisplaySnapshotMojo> output; 445 std::unique_ptr<DisplaySnapshotMojo> output;
441 GetTraitsTestProxy()->EchoDisplaySnapshotMojo(input->Clone(), &output); 446 GetTraitsTestProxy()->EchoDisplaySnapshotMojo(input->Clone(), &output);
442 447
443 CheckDisplaySnapShotMojoEqual(*input, *output); 448 CheckDisplaySnapShotMojoEqual(*input, *output);
444 } 449 }
445 450
451 TEST_F(DisplayStructTraitsTest, HDCPStateBasic) {
452 const display::HDCPState input(HDCP_STATE_ENABLED);
453 display::HDCPState output;
454 GetTraitsTestProxy()->EchoHDCPState(input, &output);
455 EXPECT_EQ(input, output);
456 }
457
446 } // namespace display 458 } // namespace display
OLDNEW
« no previous file with comments | « ui/display/mojo/display_struct_traits_test.mojom ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698