Chromium Code Reviews

Unified Diff: ui/display/display_unittest.cc

Issue 1964153002: Move Screen, its impls, DisplayObserver and DisplayChangeNotifier to ui/display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tabs Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « ui/display/display_observer.cc ('k') | ui/display/ios/screen_ios.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/display_unittest.cc
diff --git a/ui/gfx/display_unittest.cc b/ui/display/display_unittest.cc
similarity index 72%
copy from ui/gfx/display_unittest.cc
copy to ui/display/display_unittest.cc
index f87b93e9546d4662ead97dd898b262edc4a82e1c..577f15395176ac44433dc2ea1867603b436dedcd 100644
--- a/ui/gfx/display_unittest.cc
+++ b/ui/display/display_unittest.cc
@@ -2,50 +2,50 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/gfx/display.h"
+#include "ui/display/display.h"
#include "base/command_line.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/insets.h"
+#include "ui/gfx/geometry/rect.h"
+#include "ui/gfx/geometry/size.h"
#include "ui/gfx/switches.h"
-namespace gfx {
-
-namespace {
+namespace display {
TEST(DisplayTest, WorkArea) {
- Display display(0, Rect(0, 0, 100, 100));
+ Display display(0, gfx::Rect(0, 0, 100, 100));
EXPECT_EQ("0,0 100x100", display.bounds().ToString());
EXPECT_EQ("0,0 100x100", display.work_area().ToString());
- display.set_work_area(Rect(3, 4, 90, 80));
+ display.set_work_area(gfx::Rect(3, 4, 90, 80));
EXPECT_EQ("0,0 100x100", display.bounds().ToString());
EXPECT_EQ("3,4 90x80", display.work_area().ToString());
- display.SetScaleAndBounds(1.0f, Rect(10, 20, 50, 50));
+ display.SetScaleAndBounds(1.0f, gfx::Rect(10, 20, 50, 50));
EXPECT_EQ("10,20 50x50", display.bounds().ToString());
EXPECT_EQ("13,24 40x30", display.work_area().ToString());
- display.SetSize(Size(200, 200));
+ display.SetSize(gfx::Size(200, 200));
EXPECT_EQ("13,24 190x180", display.work_area().ToString());
- display.UpdateWorkAreaFromInsets(Insets(3, 4, 5, 6));
+ display.UpdateWorkAreaFromInsets(gfx::Insets(3, 4, 5, 6));
EXPECT_EQ("14,23 190x192", display.work_area().ToString());
}
TEST(DisplayTest, Scale) {
- Display display(0, Rect(0, 0, 100, 100));
- display.set_work_area(Rect(10, 10, 80, 80));
+ Display display(0, gfx::Rect(0, 0, 100, 100));
+ display.set_work_area(gfx::Rect(10, 10, 80, 80));
EXPECT_EQ("0,0 100x100", display.bounds().ToString());
EXPECT_EQ("10,10 80x80", display.work_area().ToString());
// Scale it back to 2x
- display.SetScaleAndBounds(2.0f, Rect(0, 0, 140, 140));
+ display.SetScaleAndBounds(2.0f, gfx::Rect(0, 0, 140, 140));
EXPECT_EQ("0,0 70x70", display.bounds().ToString());
EXPECT_EQ("10,10 50x50", display.work_area().ToString());
// Scale it back to 1x
- display.SetScaleAndBounds(1.0f, Rect(0, 0, 100, 100));
+ display.SetScaleAndBounds(1.0f, gfx::Rect(0, 0, 100, 100));
EXPECT_EQ("0,0 100x100", display.bounds().ToString());
EXPECT_EQ("10,10 80x80", display.work_area().ToString());
}
@@ -62,6 +62,4 @@ TEST(DisplayTest, ForcedDeviceScaleFactorByCommandLine) {
Display::ResetForceDeviceScaleFactorForTesting();
}
-} // namespace
-
-} // namespace gfx
+} // namespace display
« no previous file with comments | « ui/display/display_observer.cc ('k') | ui/display/ios/screen_ios.mm » ('j') | no next file with comments »

Powered by Google App Engine