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

Side by Side Diff: services/ui/display/platform_screen_ozone_unittests.cc

Issue 2324163002: Add FakeDisplayDelegate for off device usage. (Closed)
Patch Set: Fix windows compile problems. Created 4 years, 3 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 | « services/ui/display/platform_screen_ozone.cc ('k') | ui/display/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
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
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
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
OLDNEW
« no previous file with comments | « services/ui/display/platform_screen_ozone.cc ('k') | ui/display/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698