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

Unified Diff: ash/display/display_manager_unittest.cc

Issue 138003007: [Cleanup] Screen cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make sure screen_for_shutdown is reset everytime Created 6 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
« no previous file with comments | « ash/display/display_manager.cc ('k') | ash/display/event_transformation_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_manager_unittest.cc
diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc
index 9ada6a8de6753c07d6c63303b5d9d6cda6595dbb..ec8d35b8d9954d1aa7b00ccbe6be280463a55a64 100644
--- a/ash/display/display_manager_unittest.cc
+++ b/ash/display/display_manager_unittest.cc
@@ -6,7 +6,7 @@
#include "ash/display/display_controller.h"
#include "ash/display/display_layout_store.h"
-#include "ash/screen_ash.h"
+#include "ash/screen_util.h"
#include "ash/shell.h"
#include "ash/test/ash_test_base.h"
#include "ash/test/display_manager_test_api.h"
@@ -20,6 +20,8 @@
#include "ui/aura/window_observer.h"
#include "ui/gfx/display_observer.h"
#include "ui/gfx/display.h"
+#include "ui/gfx/screen.h"
+#include "ui/gfx/screen_type_delegate.h"
namespace ash {
namespace internal {
@@ -273,7 +275,7 @@ TEST_F(DisplayManagerTest, OverscanInsetsTest) {
EXPECT_EQ("13,12,11,10",
updated_display_info2.overscan_insets_in_dip().ToString());
EXPECT_EQ("500,0 378x376",
- ScreenAsh::GetSecondaryDisplay().bounds().ToString());
+ ScreenUtil::GetSecondaryDisplay().bounds().ToString());
// Make sure that SetOverscanInsets() is idempotent.
display_manager()->SetOverscanInsets(display_info1.id(), gfx::Insets());
@@ -340,11 +342,11 @@ TEST_F(DisplayManagerTest, OverscanInsetsTest) {
// Make sure switching primary display applies the overscan offset only once.
ash::Shell::GetInstance()->display_controller()->SetPrimaryDisplay(
- ScreenAsh::GetSecondaryDisplay());
+ ScreenUtil::GetSecondaryDisplay());
EXPECT_EQ("-500,0 500x500",
- ScreenAsh::GetSecondaryDisplay().bounds().ToString());
+ ScreenUtil::GetSecondaryDisplay().bounds().ToString());
EXPECT_EQ("0,0 500x500",
- GetDisplayInfo(ScreenAsh::GetSecondaryDisplay()).
+ GetDisplayInfo(ScreenUtil::GetSecondaryDisplay()).
bounds_in_native().ToString());
EXPECT_EQ("0,501 400x400",
GetDisplayInfo(Shell::GetScreen()->GetPrimaryDisplay()).
@@ -655,7 +657,7 @@ TEST_F(DisplayManagerTest, MAYBE_EnsurePointerInDisplays_2ndOnLeft) {
aura::Window::Windows root_windows = Shell::GetAllRootWindows();
EXPECT_EQ("-300,0 300x300",
- ScreenAsh::GetSecondaryDisplay().bounds().ToString());
+ ScreenUtil::GetSecondaryDisplay().bounds().ToString());
aura::Env* env = aura::Env::GetInstance();
@@ -1181,5 +1183,34 @@ TEST_F(DisplayManagerTest, MAYBE_UpdateDisplayWithHostOrigin) {
EXPECT_EQ("200x300", dispatcher1->host()->GetBounds().size().ToString());
}
+
+class ScreenShutdownTest : public test::AshTestBase {
+ public:
+ ScreenShutdownTest() {
+ }
+ virtual ~ScreenShutdownTest() {}
+
+ virtual void TearDown() OVERRIDE {
+ gfx::Screen* orig_screen =
+ gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_ALTERNATE);
+ AshTestBase::TearDown();
+ gfx::Screen* screen =
+ gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_ALTERNATE);
+ EXPECT_NE(orig_screen, screen);
+ EXPECT_EQ(2, screen->GetNumDisplays());
+ EXPECT_EQ("500x300", screen->GetPrimaryDisplay().size().ToString());
+ std::vector<gfx::Display> all = screen->GetAllDisplays();
+ EXPECT_EQ("500x300", all[0].size().ToString());
+ EXPECT_EQ("800x400", all[1].size().ToString());
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ScreenShutdownTest);
+};
+
+TEST_F(DisplayManagerTest, ScreenAfterShutdown) {
+ UpdateDisplay("500x300,800x400");
+}
+
} // namespace internal
} // namespace ash
« no previous file with comments | « ash/display/display_manager.cc ('k') | ash/display/event_transformation_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698