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

Unified Diff: ui/display/win/screen_win_unittest.cc

Issue 1825723002: Move ScreenWin to ui/display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added is_chromeos guard Created 4 years, 9 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: ui/display/win/screen_win_unittest.cc
diff --git a/ui/gfx/screen_win_unittest.cc b/ui/display/win/screen_win_unittest.cc
similarity index 96%
rename from ui/gfx/screen_win_unittest.cc
rename to ui/display/win/screen_win_unittest.cc
index 6ac573f197d181c9118035a451c586bf624fc6c1..2542167c2857ceb327eda5c0cdc23d1b83c80c1f 100644
--- a/ui/gfx/screen_win_unittest.cc
+++ b/ui/display/win/screen_win_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/gfx/screen_win.h"
+#include "ui/display/win/screen_win.h"
#include <windows.h>
#include <inttypes.h>
@@ -16,15 +16,16 @@
#include "base/macros.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/display/win/display_info.h"
+#include "ui/display/win/screen_win_display.h"
#include "ui/gfx/display.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/screen.h"
#include "ui/gfx/test/display_util.h"
-#include "ui/gfx/win/display_info.h"
#include "ui/gfx/win/dpi.h"
-#include "ui/gfx/win/screen_win_display.h"
-namespace gfx {
+namespace display {
+namespace win {
namespace {
@@ -42,9 +43,9 @@ MONITORINFOEX CreateMonitorInfo(gfx::Rect monitor,
return monitor_info;
}
-class TestScreenWin : public gfx::ScreenWin {
+class TestScreenWin : public ScreenWin {
public:
- TestScreenWin(const std::vector<gfx::win::DisplayInfo>& display_infos,
+ TestScreenWin(const std::vector<DisplayInfo>& display_infos,
const std::vector<MONITORINFOEX>& monitor_infos,
const std::unordered_map<HWND, gfx::Rect>& hwnd_map)
: monitor_infos_(monitor_infos),
@@ -55,17 +56,17 @@ class TestScreenWin : public gfx::ScreenWin {
~TestScreenWin() override = default;
protected:
- // gfx::ScreenWin:
- HWND GetHWNDFromNativeView(NativeView window) const override {
+ // display::win::ScreenWin:
+ HWND GetHWNDFromNativeView(gfx::NativeView window) const override {
// NativeView is only used as an identifier in this tests, so interchange
// NativeView with an HWND for convenience.
return reinterpret_cast<HWND>(window);
}
- NativeWindow GetNativeWindowFromHWND(HWND hwnd) const override {
+ gfx::NativeWindow GetNativeWindowFromHWND(HWND hwnd) const override {
// NativeWindow is only used as an identifier in this tests, so interchange
// an HWND for a NativeWindow for convenience.
- return reinterpret_cast<NativeWindow>(hwnd);
+ return reinterpret_cast<gfx::NativeWindow>(hwnd);
}
private:
@@ -127,12 +128,10 @@ class TestScreenWin : public gfx::ScreenWin {
DISALLOW_COPY_AND_ASSIGN(TestScreenWin);
};
-Screen* GetScreen() {
+gfx::Screen* GetScreen() {
return gfx::Screen::GetScreen();
}
-} // namespace
-
// Allows tests to specify the screen and associated state.
class TestScreenWinInitializer {
public:
@@ -160,9 +159,9 @@ class TestScreenWinManager : public TestScreenWinInitializer {
pixel_work,
device_name);
monitor_infos_.push_back(monitor_info);
- display_infos_.push_back(gfx::win::DisplayInfo(monitor_info,
- device_scale_factor,
- gfx::Display::ROTATE_0));
+ display_infos_.push_back(DisplayInfo(monitor_info,
+ device_scale_factor,
+ gfx::Display::ROTATE_0));
}
HWND CreateFakeHwnd(const gfx::Rect& bounds) override {
@@ -187,7 +186,7 @@ class TestScreenWinManager : public TestScreenWinInitializer {
HWND hwndLast_ = nullptr;
scoped_ptr<ScreenWin> screen_win_;
std::vector<MONITORINFOEX> monitor_infos_;
- std::vector<gfx::win::DisplayInfo> display_infos_;
+ std::vector<DisplayInfo> display_infos_;
std::unordered_map<HWND, gfx::Rect> hwnd_map_;
DISALLOW_COPY_AND_ASSIGN(TestScreenWinManager);
@@ -213,7 +212,7 @@ class ScreenWinTest : public testing::Test {
virtual void SetUpScreen(TestScreenWinInitializer* initializer) = 0;
- NativeWindow GetNativeWindowFromHWND(HWND hwnd) const {
+ gfx::NativeWindow GetNativeWindowFromHWND(HWND hwnd) const {
ScreenWin* screen_win = screen_win_initializer_->GetScreenWin();
return screen_win->GetNativeWindowFromHWND(hwnd);;
}
@@ -779,4 +778,7 @@ TEST_F(ScreenWinTestTwoDisplays2x1xVirtualized, GetPrimaryDisplay) {
EXPECT_EQ(gfx::Point(0, 0), primary.bounds().origin());
}
-} // namespace gfx
+} // namespace
+
+} // namespace win
+} // namespace display

Powered by Google App Engine
This is Rietveld 408576698