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

Unified Diff: ash/screen_util_unittest.cc

Issue 2660873002: Move two utility functions from ash/screen_util.h to ui/wm/core/coordinate_conversion.h (Closed)
Patch Set: Created 3 years, 11 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
Index: ash/screen_util_unittest.cc
diff --git a/ash/screen_util_unittest.cc b/ash/screen_util_unittest.cc
index 3d5850ee2b6741bb5d0dd0d2e728fca1bf43e5a8..99065becc464ad1e187cd988072fb106beb9e2df 100644
--- a/ash/screen_util_unittest.cc
+++ b/ash/screen_util_unittest.cc
@@ -16,6 +16,7 @@
#include "ui/display/manager/display_manager.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
+#include "ui/wm/core/coordinate_conversion.h"
namespace ash {
namespace test {
@@ -95,23 +96,21 @@ TEST_P(ScreenUtilTest, ConvertRect) {
NULL, CurrentContext(), gfx::Rect(610, 10, 100, 100));
secondary->Show();
- EXPECT_EQ("0,0 100x100",
- ScreenUtil::ConvertRectFromScreen(primary->GetNativeView(),
- gfx::Rect(10, 10, 100, 100))
- .ToString());
- EXPECT_EQ("10,10 100x100",
- ScreenUtil::ConvertRectFromScreen(secondary->GetNativeView(),
- gfx::Rect(620, 20, 100, 100))
- .ToString());
+ gfx::Rect r1(10, 10, 100, 100);
+ ::wm::ConvertRectFromScreen(primary->GetNativeView(), &r1);
+ EXPECT_EQ("0,0 100x100", r1.ToString());
- EXPECT_EQ("40,40 100x100",
- ScreenUtil::ConvertRectToScreen(primary->GetNativeView(),
- gfx::Rect(30, 30, 100, 100))
- .ToString());
- EXPECT_EQ("650,50 100x100",
- ScreenUtil::ConvertRectToScreen(secondary->GetNativeView(),
- gfx::Rect(40, 40, 100, 100))
- .ToString());
+ gfx::Rect r2(620, 20, 100, 100);
+ ::wm::ConvertRectFromScreen(secondary->GetNativeView(), &r2);
+ EXPECT_EQ("10,10 100x100", r2.ToString());
+
+ gfx::Rect r3(30, 30, 100, 100);
+ ::wm::ConvertRectToScreen(primary->GetNativeView(), &r3);
+ EXPECT_EQ("40,40 100x100", r3.ToString());
+
+ gfx::Rect r4(40, 40, 100, 100);
+ ::wm::ConvertRectToScreen(secondary->GetNativeView(), &r4);
+ EXPECT_EQ("650,50 100x100", r4.ToString());
}
TEST_P(ScreenUtilTest, ShelfDisplayBoundsInUnifiedDesktop) {

Powered by Google App Engine
This is Rietveld 408576698