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

Unified Diff: services/ui/ws/test_utils.cc

Issue 2434923002: Handle modified displays in mustash. (Closed)
Patch Set: Fix PlatformScreenStub for tests. Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/ws/test_utils.h ('k') | services/ui/ws/viewport_metrics.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/test_utils.cc
diff --git a/services/ui/ws/test_utils.cc b/services/ui/ws/test_utils.cc
index 9d67e94a60907dfb253554edea46cf7ebef27b71..ce72a29d84e11a1fe3e4aab6969f71e41e6e8705 100644
--- a/services/ui/ws/test_utils.cc
+++ b/services/ui/ws/test_utils.cc
@@ -54,22 +54,25 @@ class TestPlatformDisplay : public PlatformDisplay {
void SetCursorById(mojom::Cursor cursor) override {
*cursor_storage_ = cursor;
}
- display::Display::Rotation GetRotation() override {
- return display::Display::Rotation::ROTATE_0;
- }
- float GetDeviceScaleFactor() override {
- return display_metrics_.device_scale_factor;
- }
void UpdateTextInputState(const ui::TextInputState& state) override {}
void SetImeVisibility(bool visible) override {}
bool IsFramePending() const override { return false; }
gfx::Rect GetBounds() const override { return display_metrics_.bounds; }
+ bool UpdateViewportMetrics(const display::ViewportMetrics& metrics) override {
+ if (display_metrics_ == metrics)
+ return false;
+ display_metrics_ = metrics;
+ return true;
+ }
+ const display::ViewportMetrics& GetViewportMetrics() const override {
+ return display_metrics_;
+ }
bool IsPrimaryDisplay() const override { return is_primary_; }
void OnGpuChannelEstablished(
scoped_refptr<gpu::GpuChannelHost> host) override {}
private:
- ViewportMetrics display_metrics_;
+ display::ViewportMetrics display_metrics_;
int64_t id_;
bool is_primary_;
@@ -142,7 +145,8 @@ bool TestFrameGeneratorDelegate::IsInHighContrastMode() {
return false;
}
-const ViewportMetrics& TestFrameGeneratorDelegate::GetViewportMetrics() {
+const display::ViewportMetrics& TestFrameGeneratorDelegate::GetViewportMetrics()
+ const {
return metrics_;
}
« no previous file with comments | « services/ui/ws/test_utils.h ('k') | services/ui/ws/viewport_metrics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698