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

Side by Side Diff: services/ui/ws/test_utils.cc

Issue 2190633002: Add flag to launch two displays for mus+ash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix. Created 4 years, 4 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/ws/platform_display.cc ('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 "services/ui/ws/test_utils.h" 5 #include "services/ui/ws/test_utils.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "cc/output/copy_output_request.h" 10 #include "cc/output/copy_output_request.h"
(...skipping 11 matching lines...) Expand all
22 namespace ws { 22 namespace ws {
23 namespace test { 23 namespace test {
24 namespace { 24 namespace {
25 25
26 // ----------------------------------------------------------------------------- 26 // -----------------------------------------------------------------------------
27 // Empty implementation of PlatformDisplay. 27 // Empty implementation of PlatformDisplay.
28 class TestPlatformDisplay : public PlatformDisplay { 28 class TestPlatformDisplay : public PlatformDisplay {
29 public: 29 public:
30 explicit TestPlatformDisplay(int32_t* cursor_id_storage) 30 explicit TestPlatformDisplay(int32_t* cursor_id_storage)
31 : cursor_id_storage_(cursor_id_storage) { 31 : cursor_id_storage_(cursor_id_storage) {
32 display_metrics_.size_in_pixels = gfx::Size(400, 300); 32 display_metrics_.bounds = gfx::Rect(0, 0, 400, 300);
33 display_metrics_.device_scale_factor = 1.f; 33 display_metrics_.device_scale_factor = 1.f;
34 } 34 }
35 ~TestPlatformDisplay() override {} 35 ~TestPlatformDisplay() override {}
36 36
37 // PlatformDisplay: 37 // PlatformDisplay:
38 void Init(PlatformDisplayDelegate* delegate) override { 38 void Init(PlatformDisplayDelegate* delegate) override {
39 // It is necessary to tell the delegate about the ViewportMetrics to make 39 // It is necessary to tell the delegate about the ViewportMetrics to make
40 // sure that the DisplayBinding is correctly initialized (and a root-window 40 // sure that the DisplayBinding is correctly initialized (and a root-window
41 // is created). 41 // is created).
42 delegate->OnViewportMetricsChanged(ViewportMetrics(), display_metrics_); 42 delegate->OnViewportMetricsChanged(ViewportMetrics(), display_metrics_);
(...skipping 10 matching lines...) Expand all
53 } 53 }
54 float GetDeviceScaleFactor() override { 54 float GetDeviceScaleFactor() override {
55 return display_metrics_.device_scale_factor; 55 return display_metrics_.device_scale_factor;
56 } 56 }
57 void UpdateTextInputState(const ui::TextInputState& state) override {} 57 void UpdateTextInputState(const ui::TextInputState& state) override {}
58 void SetImeVisibility(bool visible) override {} 58 void SetImeVisibility(bool visible) override {}
59 bool IsFramePending() const override { return false; } 59 bool IsFramePending() const override { return false; }
60 void RequestCopyOfOutput( 60 void RequestCopyOfOutput(
61 std::unique_ptr<cc::CopyOutputRequest> output_request) override {} 61 std::unique_ptr<cc::CopyOutputRequest> output_request) override {}
62 int64_t GetDisplayId() const override { return 1; } 62 int64_t GetDisplayId() const override { return 1; }
63 gfx::Rect GetBounds() const override { return display_metrics_.bounds; }
63 64
64 private: 65 private:
65 ViewportMetrics display_metrics_; 66 ViewportMetrics display_metrics_;
66 67
67 int32_t* cursor_id_storage_; 68 int32_t* cursor_id_storage_;
68 69
69 DISALLOW_COPY_AND_ASSIGN(TestPlatformDisplay); 70 DISALLOW_COPY_AND_ASSIGN(TestPlatformDisplay);
70 }; 71 };
71 72
72 ClientWindowId NextUnusedClientWindowId(WindowTree* tree) { 73 ClientWindowId NextUnusedClientWindowId(WindowTree* tree) {
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 return nullptr; 523 return nullptr;
523 if (!tree->AddWindow(parent_client_id, client_window_id)) 524 if (!tree->AddWindow(parent_client_id, client_window_id))
524 return nullptr; 525 return nullptr;
525 *client_id = client_window_id; 526 *client_id = client_window_id;
526 return tree->GetWindowByClientId(client_window_id); 527 return tree->GetWindowByClientId(client_window_id);
527 } 528 }
528 529
529 } // namespace test 530 } // namespace test
530 } // namespace ws 531 } // namespace ws
531 } // namespace ui 532 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/platform_display.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698