OLD | NEW |
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 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "services/ui/display/platform_screen.h" | 10 #include "services/ui/display/platform_screen.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 using ui::DisplayConfigurator; | 23 using ui::DisplayConfigurator; |
24 using ui::DisplayMode; | 24 using ui::DisplayMode; |
25 using ui::DisplaySnapshot; | 25 using ui::DisplaySnapshot; |
26 using ui::DisplaySnapshotVirtual; | 26 using ui::DisplaySnapshotVirtual; |
27 using testing::IsEmpty; | 27 using testing::IsEmpty; |
28 using testing::SizeIs; | 28 using testing::SizeIs; |
29 | 29 |
30 namespace { | 30 namespace { |
31 | 31 |
32 // The ID of default "display" that gets added when running off device. | 32 // The ID of default "display" that gets added when running off device. |
33 const int64_t kDefaultDisplayId = 36028797018963969; | 33 const int64_t kDefaultDisplayId = 36029742295586049; |
34 | 34 |
35 // Holds info about the display state we want to test. | 35 // Holds info about the display state we want to test. |
36 struct DisplayState { | 36 struct DisplayState { |
37 int64_t id; | 37 int64_t id; |
38 gfx::Rect bounds; | 38 gfx::Rect bounds; |
39 }; | 39 }; |
40 | 40 |
41 // Matchers that operate on DisplayState. | 41 // Matchers that operate on DisplayState. |
42 MATCHER_P(DisplayId, display_id, "") { | 42 MATCHER_P(DisplayId, display_id, "") { |
43 *result_listener << "has id " << arg.id; | 43 *result_listener << "has id " << arg.id; |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 // Check that the default display was modified with a new size and display 2 | 312 // Check that the default display was modified with a new size and display 2 |
313 // was modified with a new origin. | 313 // was modified with a new origin. |
314 ASSERT_THAT(delegate()->modified(), SizeIs(2)); | 314 ASSERT_THAT(delegate()->modified(), SizeIs(2)); |
315 EXPECT_THAT(delegate()->modified()[0], DisplayId(kDefaultDisplayId)); | 315 EXPECT_THAT(delegate()->modified()[0], DisplayId(kDefaultDisplayId)); |
316 EXPECT_THAT(delegate()->modified()[0], DisplaySize(size.ToString())); | 316 EXPECT_THAT(delegate()->modified()[0], DisplaySize(size.ToString())); |
317 EXPECT_THAT(delegate()->modified()[1], DisplayId(2)); | 317 EXPECT_THAT(delegate()->modified()[1], DisplayId(2)); |
318 EXPECT_THAT(delegate()->modified()[1], DisplayOrigin("1920,0")); | 318 EXPECT_THAT(delegate()->modified()[1], DisplayOrigin("1920,0")); |
319 } | 319 } |
320 | 320 |
321 } // namespace display | 321 } // namespace display |
OLD | NEW |