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

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: rebase Created 3 years, 10 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 | « ash/screen_util.cc ('k') | ash/shell/panel_window.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/screen_util_unittest.cc
diff --git a/ash/screen_util_unittest.cc b/ash/screen_util_unittest.cc
index 71f470eda8035dac191d11e6499dec8251aa6b89..70905558d9bd6c7bc4996312bc269b6d5ba4c2a8 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 {
@@ -86,23 +87,21 @@ TEST_F(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_F(ScreenUtilTest, ShelfDisplayBoundsInUnifiedDesktop) {
« no previous file with comments | « ash/screen_util.cc ('k') | ash/shell/panel_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698