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

Unified Diff: ash/display/mirror_window_controller_unittest.cc

Issue 23620060: Try to enable software mirror mode in UI message loop after Init() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 7 years, 3 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/shell.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/mirror_window_controller_unittest.cc
diff --git a/ash/display/mirror_window_controller_unittest.cc b/ash/display/mirror_window_controller_unittest.cc
index 75317d1810aec8626ce236fdfc1874ae8cd46dc8..80cf75e5a34340d7ef0f026d1ecb914b59a87846 100644
--- a/ash/display/mirror_window_controller_unittest.cc
+++ b/ash/display/mirror_window_controller_unittest.cc
@@ -4,10 +4,12 @@
#include "ash/display/mirror_window_controller.h"
+#include "ash/ash_switches.h"
#include "ash/display/display_manager.h"
#include "ash/shell.h"
#include "ash/test/ash_test_base.h"
#include "ash/test/mirror_window_test_api.h"
+#include "base/command_line.h"
#include "base/strings/stringprintf.h"
#include "ui/aura/root_window.h"
#include "ui/aura/test/event_generator.h"
@@ -26,6 +28,26 @@ DisplayInfo CreateDisplayInfo(int64 id, const gfx::Rect& bounds) {
return info;
}
+class MirrorOnBootTest : public test::AshTestBase {
+ public:
+ MirrorOnBootTest() {}
+ virtual ~MirrorOnBootTest() {}
+
+ virtual void SetUp() OVERRIDE {
+ CommandLine::ForCurrentProcess()->AppendSwitchASCII(
+ switches::kAshHostWindowBounds, "1+1-300x300,1+301-300x300");
+ CommandLine::ForCurrentProcess()->AppendSwitch(
+ switches::kAshEnableSoftwareMirroring);
+ test::AshTestBase::SetUp();
+ }
+ virtual void TearDown() OVERRIDE {
+ test::AshTestBase::TearDown();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MirrorOnBootTest);
+};
+
}
typedef test::AshTestBase MirrorWindowControllerTest;
@@ -36,11 +58,13 @@ typedef test::AshTestBase MirrorWindowControllerTest;
#define MAYBE_MirrorCursorLocations DISABLED_MirrorCursorLocations
#define MAYBE_MirrorCursorRotate DISABLED_MirrorCursorRotate
#define MAYBE_DockMode DISABLED_DockMode
+#define MAYBE_MirrorOnBoot DISABLED_MirrorOnBoot
#else
#define MAYBE_MirrorCursorBasic MirrorCursorBasic
#define MAYBE_MirrorCursorLocations MirrorCursorLocations
#define MAYBE_MirrorCursorRotate MirrorCursorRotate
#define MAYBE_DockMode DockMode
+#define MAYBE_MirrorOnBoot MirrorOnBoot
#endif
TEST_F(MirrorWindowControllerTest, MAYBE_MirrorCursorBasic) {
@@ -251,5 +275,13 @@ TEST_F(MirrorWindowControllerTest, MAYBE_DockMode) {
EXPECT_EQ(external_id, display_manager->mirrored_display().id());
}
+TEST_F(MirrorOnBootTest, MAYBE_MirrorOnBoot) {
+ DisplayManager* display_manager = Shell::GetInstance()->display_manager();
+ EXPECT_TRUE(display_manager->IsMirrored());
+ RunAllPendingInMessageLoop();
+ test::MirrorWindowTestApi test_api;
+ EXPECT_TRUE(test_api.GetRootWindow());
+}
+
} // namsspace internal
} // namespace ash
« no previous file with comments | « ash/display/display_manager.cc ('k') | ash/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698