summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-21 18:46:05 +0000
committerrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-21 18:46:05 +0000
commit1c3f7002d91087f655dc805ac115e69ce1dc02fb (patch)
tree5ab0a121c2901bbcd16731c8236b6db527024833
parent345f3919f5b66370ddc2152468286b381ffb5bbb (diff)
downloadchromium_src-1c3f7002d91087f655dc805ac115e69ce1dc02fb.zip
chromium_src-1c3f7002d91087f655dc805ac115e69ce1dc02fb.tar.gz
chromium_src-1c3f7002d91087f655dc805ac115e69ce1dc02fb.tar.bz2
Initial whack at getting ash_unittests to connect to a viewer process on Win/Metro.
This adds a test viewer process host to the ash unittests that starts and connects to the viewer process, using the provided hwnd as a backing surface for the tests. This approach allows most of the ash unittests to pass except for two categories: 1) Tests that spin up more than one ash display. These don't work since each RootWindowHost thus created would require a remote connection and there is only one Metro viewer process. 2) Some number of tests seem to tickle a crash in shader.cc. These are short-circuited on Win8 with a TODO. Some limitations: 1) The tests require chrome.exe to be registered as the default browser on Windows 8 to be used as a viewer process. This could be fixed in a future CL by creating a minimal viewer process for tests. 2) To register chrome.exe as the default browser, setup.exe needs to be built and run with setup.exe --register-dev-chrome --register-dev-chrome-suffix=.test This will be fixed in a future CL by extracting the registration code. The interesting parts are in ash/test/test_metro_viewer_process_host.h ash/test/test_metro_viewer_process_host.cc Most of the rest is test disabling or calling the above. BUG=154081 TEST=ash_unittests.exe on win8. Review URL: https://chromiumcodereview.appspot.com/11830038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177946 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ash/ash.gyp22
-rw-r--r--ash/display/display_controller_unittest.cc11
-rw-r--r--ash/display/mouse_cursor_event_filter_unittest.cc29
-rw-r--r--ash/drag_drop/drag_drop_controller_unittest.cc9
-rw-r--r--ash/launcher/launcher_unittest.cc12
-rw-r--r--ash/root_window_controller_unittest.cc18
-rw-r--r--ash/system/tray/system_tray_unittest.cc27
-rw-r--r--ash/system/web_notification/web_notification_tray_unittest.cc21
-rw-r--r--ash/test/ash_test_base.cc24
-rw-r--r--ash/test/ash_test_base.h8
-rw-r--r--ash/test/ash_unittests.cc7
-rw-r--r--ash/test/test_metro_viewer_process_host.cc141
-rw-r--r--ash/test/test_metro_viewer_process_host.h88
-rw-r--r--ash/test/test_suite.cc12
-rw-r--r--ash/tooltips/tooltip_controller_unittest.cc11
-rw-r--r--ash/wm/activation_controller_unittest.cc11
-rw-r--r--ash/wm/frame_painter_unittest.cc11
-rw-r--r--ash/wm/session_state_controller_impl2_unittest.cc45
-rw-r--r--ash/wm/shelf_layout_manager_unittest.cc18
-rw-r--r--ash/wm/system_modal_container_layout_manager_unittest.cc9
-rw-r--r--ash/wm/window_cycle_controller_unittest.cc12
-rw-r--r--ash/wm/workspace/workspace_window_resizer_unittest.cc42
-rw-r--r--chrome/installer/setup/setup_main.cc3
-rw-r--r--chrome/installer/util/shell_util.cc17
-rw-r--r--ui/aura/remote_root_window_host_win.cc2
25 files changed, 558 insertions, 52 deletions
diff --git a/ash/ash.gyp b/ash/ash.gyp
index da2788f..0da905c 100644
--- a/ash/ash.gyp
+++ b/ash/ash.gyp
@@ -504,6 +504,18 @@
'test/test_suite_init.h',
'test/test_suite_init.mm',
],
+ 'conditions': [
+ ['OS=="win"', {
+ 'dependencies': [
+ '../ipc/ipc.gyp:ipc',
+ '../ui/metro_viewer/metro_viewer.gyp:metro_viewer',
+ ],
+ 'sources': [
+ 'test/test_metro_viewer_process_host.cc',
+ 'test/test_metro_viewer_process_host.h',
+ ],
+ }],
+ ],
},
{
'target_name': 'ash_unittests',
@@ -625,9 +637,15 @@
}],
['OS=="win"', {
'sources/': [
- # TODO(zork): fix this test to build on Windows. See: crosbug.com/26906
+ # TODO(zork): fix this test to build on Windows. See: crosbug.com/26906
['exclude', 'focus_cycler_unittest.cc'],
# All tests for multiple displays: not supported on Windows Ash.
+ ['exclude', 'accelerators/nested_dispatcher_controller_unittest.cc'],
+ ['exclude', 'display/display_controller_unittest.cc'],
+ ['exclude', 'display/display_manager_unittest.cc'],
+ ['exclude', 'display/mouse_cursor_event_filter_unittest.cc'],
+ ['exclude', 'extended_desktop_unittest.cc'],
+ ['exclude', 'screen_ash_unittest.cc'],
['exclude', 'wm/drag_window_resizer_unittest.cc'],
],
}],
@@ -719,7 +737,7 @@
},
'dependencies': [
'../sandbox/sandbox.gyp:sandbox',
- ],
+ ],
}],
['OS=="mac"', {
'product_name': 'AuraShell',
diff --git a/ash/display/display_controller_unittest.cc b/ash/display/display_controller_unittest.cc
index a9244e6..a507062 100644
--- a/ash/display/display_controller_unittest.cc
+++ b/ash/display/display_controller_unittest.cc
@@ -439,16 +439,7 @@ TEST_F(DisplayControllerTest, SwapPrimaryById) {
EXPECT_TRUE(primary_root->Contains(launcher_window));
}
-#if defined(OS_WIN)
-// Multiple displays are not supported on Windows Ash. http://crbug.com/165962
-#define MAYBE_CursorDeviceScaleFactorSwapPrimary \
- DISABLED_CursorDeviceScaleFactorSwapPrimary
-#else
-#define MAYBE_CursorDeviceScaleFactorSwapPrimary \
- CursorDeviceScaleFactorSwapPrimary
-#endif
-
-TEST_F(DisplayControllerTest, MAYBE_CursorDeviceScaleFactorSwapPrimary) {
+TEST_F(DisplayControllerTest, CursorDeviceScaleFactorSwapPrimary) {
DisplayController* display_controller =
Shell::GetInstance()->display_controller();
diff --git a/ash/display/mouse_cursor_event_filter_unittest.cc b/ash/display/mouse_cursor_event_filter_unittest.cc
index 05447f5..00a53f5 100644
--- a/ash/display/mouse_cursor_event_filter_unittest.cc
+++ b/ash/display/mouse_cursor_event_filter_unittest.cc
@@ -32,26 +32,9 @@ gfx::Display GetSecondaryDisplay() {
typedef test::AshTestBase MouseCursorEventFilterTest;
-#if defined(OS_WIN)
-// Multiple displays are not supported on Windows Ash. http://crbug.com/165962
-#define MAYBE_WarpMouse DISABLED_WarpMouse
-#define MAYBE_CursorDeviceScaleFactor DISABLED_CursorDeviceScaleFactor
-#define MAYBE_WarpMouseDifferentSizeDisplays \
- DISABLED_WarpMouseDifferentSizeDisplays
-#define MAYBE_WarpMouseDifferentScaleDisplays \
- DISABLED_WarpMouseDifferentScaleDisplays
-#define MAYBE_SetMouseWarpModeFlag DISABLED_SetMouseWarpModeFlag
-#else
-#define MAYBE_WarpMouse WarpMouse
-#define MAYBE_CursorDeviceScaleFactor CursorDeviceScaleFactor
-#define MAYBE_WarpMouseDifferentSizeDisplays WarpMouseDifferentSizeDisplays
-#define MAYBE_WarpMouseDifferentScaleDisplays WarpMouseDifferentScaleDisplays
-#define MAYBE_SetMouseWarpModeFlag SetMouseWarpModeFlag
-#endif
-
// Verifies if the mouse pointer correctly moves to another display when there
// are two displays.
-TEST_F(MouseCursorEventFilterTest, MAYBE_WarpMouse) {
+TEST_F(MouseCursorEventFilterTest, WarpMouse) {
UpdateDisplay("500x500,500x500");
MouseCursorEventFilter* event_filter =
@@ -109,10 +92,9 @@ TEST_F(MouseCursorEventFilterTest, MAYBE_WarpMouse) {
EXPECT_FALSE(is_warped);
}
-
// Verifies if the mouse pointer correctly moves to another display even when
// two displays are not the same size.
-TEST_F(MouseCursorEventFilterTest, MAYBE_WarpMouseDifferentSizeDisplays) {
+TEST_F(MouseCursorEventFilterTest, WarpMouseDifferentSizeDisplays) {
UpdateDisplay("500x500,600x600"); // the second one is larger.
MouseCursorEventFilter* event_filter =
@@ -144,7 +126,7 @@ TEST_F(MouseCursorEventFilterTest, MAYBE_WarpMouseDifferentSizeDisplays) {
// Verifies if the mouse pointer correctly moves between displays with
// different scale factors.
-TEST_F(MouseCursorEventFilterTest, MAYBE_WarpMouseDifferentScaleDisplays) {
+TEST_F(MouseCursorEventFilterTest, WarpMouseDifferentScaleDisplays) {
UpdateDisplay("500x500,600x600*2");
MouseCursorEventFilter* event_filter =
@@ -177,7 +159,7 @@ TEST_F(MouseCursorEventFilterTest, MAYBE_WarpMouseDifferentScaleDisplays) {
}
// Verifies if MouseCursorEventFilter::set_mouse_warp_mode() works as expected.
-TEST_F(MouseCursorEventFilterTest, MAYBE_SetMouseWarpModeFlag) {
+TEST_F(MouseCursorEventFilterTest, SetMouseWarpModeFlag) {
UpdateDisplay("500x500,500x500");
MouseCursorEventFilter* event_filter =
@@ -324,11 +306,10 @@ TEST_F(MouseCursorEventFilterTest, IndicatorBoundsTestOnTopBottom) {
event_filter->HideSharedEdgeIndicator();
}
-
// Verifies cursor's device scale factor is updated when a cursor has moved
// across root windows with different device scale factors
// (http://crbug.com/154183).
-TEST_F(MouseCursorEventFilterTest, MAYBE_CursorDeviceScaleFactor) {
+TEST_F(MouseCursorEventFilterTest, CursorDeviceScaleFactor) {
UpdateDisplay("400x400,800x800*2");
DisplayController* controller =
Shell::GetInstance()->display_controller();
diff --git a/ash/drag_drop/drag_drop_controller_unittest.cc b/ash/drag_drop/drag_drop_controller_unittest.cc
index d13415f..3e31abf 100644
--- a/ash/drag_drop/drag_drop_controller_unittest.cc
+++ b/ash/drag_drop/drag_drop_controller_unittest.cc
@@ -925,9 +925,16 @@ class DragImageWindowObserver : public aura::WindowObserver {
}
+#if defined(OS_WIN)
+// Multiple displays are not supported on Windows Ash. http://crbug.com/165962
+#define MAYBE_DragCancelAcrossDisplays DISABLED_DragCancelAcrossDisplays
+#else
+#define MAYBE_DragCancelAcrossDisplays DragCancelAcrossDisplays
+#endif
+
// Verifies the drag image moves back to the position where drag is started
// across displays when drag is cancelled.
-TEST_F(DragDropControllerTest, DragCancelAcrossDisplays) {
+TEST_F(DragDropControllerTest, MAYBE_DragCancelAcrossDisplays) {
UpdateDisplay("400x400,400x400");
Shell::RootWindowList root_windows =
Shell::GetInstance()->GetAllRootWindows();
diff --git a/ash/launcher/launcher_unittest.cc b/ash/launcher/launcher_unittest.cc
index cead4590..6419ed7 100644
--- a/ash/launcher/launcher_unittest.cc
+++ b/ash/launcher/launcher_unittest.cc
@@ -15,6 +15,10 @@
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
+#if defined(OS_WIN)
+#include "base/win/windows_version.h"
+#endif
+
typedef ash::test::AshTestBase LauncherTest;
using ash::internal::LauncherView;
using ash::internal::LauncherButton;
@@ -56,6 +60,14 @@ TEST_F(LauncherTest, DimmerSize) {
// Confirm that launching a browser gets the appropriate state reflected in
// its button.
TEST_F(LauncherTest, OpenBrowser) {
+#if defined(OS_WIN)
+ // This test seems to tickle a race condition on Metro/Ash causing the test
+ // suite to crash.
+ // TODO(robertshield): Fix this. http://crbug.com/170418
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8)
+ return;
+#endif
+
Launcher* launcher = Launcher::ForPrimaryDisplay();
ASSERT_TRUE(launcher);
LauncherView* launcher_view = launcher->GetLauncherViewForTest();
diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc
index af45230..06d7a166 100644
--- a/ash/root_window_controller_unittest.cc
+++ b/ash/root_window_controller_unittest.cc
@@ -117,7 +117,14 @@ class RootWindowControllerTest : public test::AshTestBase {
}
};
-TEST_F(RootWindowControllerTest, MoveWindows_Basic) {
+#if defined(OS_WIN)
+// Multiple displays are not supported on Windows Ash. http://crbug.com/165962
+#define MAYBE_MoveWindows_Basic DISABLED_MoveWindows_Basic
+#else
+#define MAYBE_MoveWindows_Basic MoveWindows_Basic
+#endif
+
+TEST_F(RootWindowControllerTest, MAYBE_MoveWindows_Basic) {
UpdateDisplay("600x600,500x500");
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
internal::RootWindowController* controller =
@@ -210,7 +217,14 @@ TEST_F(RootWindowControllerTest, MoveWindows_Basic) {
fullscreen->GetNativeView()->GetBoundsInRootWindow().ToString());
}
-TEST_F(RootWindowControllerTest, MoveWindows_Modal) {
+#if defined(OS_WIN)
+// Multiple displays are not supported on Windows Ash. http://crbug.com/165962
+#define MAYBE_MoveWindows_Modal DISABLED_MoveWindows_Modal
+#else
+#define MAYBE_MoveWindows_Modal MoveWindows_Modal
+#endif
+
+TEST_F(RootWindowControllerTest, MAYBE_MoveWindows_Modal) {
UpdateDisplay("500x500,500x500");
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
diff --git a/ash/system/tray/system_tray_unittest.cc b/ash/system/tray/system_tray_unittest.cc
index e80aeae..9204f71 100644
--- a/ash/system/tray/system_tray_unittest.cc
+++ b/ash/system/tray/system_tray_unittest.cc
@@ -16,6 +16,10 @@
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
+#if defined(OS_WIN)
+#include "base/win/windows_version.h"
+#endif
+
namespace ash {
namespace test {
@@ -137,6 +141,14 @@ TEST_F(SystemTrayTest, SystemTrayDefaultView) {
}
TEST_F(SystemTrayTest, SystemTrayTestItems) {
+#if defined(OS_WIN)
+ // This test seems to tickle a race condition on Metro/Ash causing the test
+ // suite to crash.
+ // TODO(robertshield): Fix this. http://crbug.com/170418
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8)
+ return;
+#endif
+
SystemTray* tray = GetSystemTray();
ASSERT_TRUE(tray->GetWidget());
@@ -209,6 +221,14 @@ TEST_F(SystemTrayTest, TrayWidgetAutoResizes) {
}
TEST_F(SystemTrayTest, SystemTrayNotifications) {
+#if defined(OS_WIN)
+ // This test seems to tickle a race condition on Metro/Ash causing the test
+ // suite to crash.
+ // TODO(robertshield): Fix this. http://crbug.com/170418
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8)
+ return;
+#endif
+
SystemTray* tray = GetSystemTray();
ASSERT_TRUE(tray->GetWidget());
@@ -244,6 +264,13 @@ TEST_F(SystemTrayTest, SystemTrayNotifications) {
}
TEST_F(SystemTrayTest, BubbleCreationTypesTest) {
+#if defined(OS_WIN)
+ // This test seems to tickle a race condition on Metro/Ash causing the test
+ // suite to crash.
+ // TODO(robertshield): Fix this. http://crbug.com/170418
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8)
+ return;
+#endif
SystemTray* tray = GetSystemTray();
ASSERT_TRUE(tray->GetWidget());
diff --git a/ash/system/web_notification/web_notification_tray_unittest.cc b/ash/system/web_notification/web_notification_tray_unittest.cc
index 1988539..3e00374 100644
--- a/ash/system/web_notification/web_notification_tray_unittest.cc
+++ b/ash/system/web_notification/web_notification_tray_unittest.cc
@@ -21,6 +21,10 @@
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
+#if defined(OS_WIN)
+#include "base/win/windows_version.h"
+#endif
+
namespace ash {
namespace {
@@ -167,7 +171,16 @@ TEST_F(WebNotificationTrayTest, WebNotificationPopupBubble) {
using message_center::NotificationList;
+
TEST_F(WebNotificationTrayTest, ManyMessageCenterNotifications) {
+#if defined(OS_WIN)
+ // This test seems to tickle a race condition on Metro/Ash causing the test
+ // suite to crash.
+ // TODO(robertshield): Fix this. http://crbug.com/170418
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8)
+ return;
+#endif
+
WebNotificationTray* tray = GetWebNotificationTray();
scoped_ptr<TestDelegate> delegate(new TestDelegate(tray->message_center()));
@@ -188,6 +201,14 @@ TEST_F(WebNotificationTrayTest, ManyMessageCenterNotifications) {
}
TEST_F(WebNotificationTrayTest, ManyPopupNotifications) {
+#if defined(OS_WIN)
+ // This test seems to tickle a race condition on Metro/Ash causing the test
+ // suite to crash.
+ // TODO(robertshield): Fix this. http://crbug.com/170418
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8)
+ return;
+#endif
+
WebNotificationTray* tray = GetWebNotificationTray();
scoped_ptr<TestDelegate> delegate(new TestDelegate(tray->message_center()));
diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc
index 0bd7bbb..fae7d65 100644
--- a/ash/test/ash_test_base.cc
+++ b/ash/test/ash_test_base.cc
@@ -31,6 +31,9 @@
#include "ui/gfx/screen.h"
#if defined(OS_WIN)
+#include "ash/test/test_metro_viewer_process_host.h"
+#include "base/win/windows_version.h"
+#include "ui/aura/remote_root_window_host_win.h"
#include "ui/aura/root_window_host_win.h"
#endif
@@ -88,6 +91,7 @@ void AshTestBase::SetUp() {
// Disable animations during tests.
ui::LayerAnimator::set_disable_animations_for_test(true);
ui::TextInputTestSupport::Initialize();
+
// Creates Shell and hook with Desktop.
test_shell_delegate_ = new TestShellDelegate;
ash::Shell::CreateInstance(test_shell_delegate_);
@@ -97,18 +101,38 @@ void AshTestBase::SetUp() {
// interfere test expectations.
Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000));
Shell::GetInstance()->cursor_manager()->EnableMouseEvents();
+
+#if defined(OS_WIN)
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
+ metro_viewer_host_.reset(new TestMetroViewerProcessHost("viewer"));
+ ASSERT_TRUE(
+ metro_viewer_host_->LaunchImmersiveChromeAndWaitForConnection());
+ aura::RemoteRootWindowHostWin* root_window_host =
+ aura::RemoteRootWindowHostWin::Instance();
+ ASSERT_TRUE(root_window_host != NULL);
+ }
+#endif
}
void AshTestBase::TearDown() {
// Flush the message loop to finish pending release tasks.
RunAllPendingInMessageLoop();
+#if defined(OS_WIN)
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
+ // Check that our viewer connection is still established.
+ ASSERT_FALSE(metro_viewer_host_->closed_unexpectedly());
+ }
+#endif
+
// Tear down the shell.
Shell::DeleteInstance();
aura::Env::DeleteInstance();
ui::TextInputTestSupport::Shutdown();
#if defined(OS_WIN)
aura::test::SetUsePopupAsRootWindowForTest(false);
+ // Kill the viewer process if we spun one up.
+ metro_viewer_host_.reset();
#endif
event_generator_.reset();
}
diff --git a/ash/test/ash_test_base.h b/ash/test/ash_test_base.h
index 8b77e0f..2541c15 100644
--- a/ash/test/ash_test_base.h
+++ b/ash/test/ash_test_base.h
@@ -15,6 +15,10 @@
#include "ui/aura/client/window_types.h"
#include "ui/views/test/test_views_delegate.h"
+#if defined(OS_WIN)
+#include "base/memory/scoped_ptr.h"
+#endif
+
namespace aura {
class Window;
class WindowDelegate;
@@ -31,6 +35,7 @@ class DisplayManager;
namespace test {
+class TestMetroViewerProcessHost;
class TestShellDelegate;
class AshTestViewsDelegate : public views::TestViewsDelegate {
@@ -105,6 +110,9 @@ class AshTestBase : public testing::Test {
TestShellDelegate* test_shell_delegate_;
scoped_ptr<aura::test::EventGenerator> event_generator_;
+#if defined(OS_WIN)
+ scoped_ptr<TestMetroViewerProcessHost> metro_viewer_host_;
+#endif
DISALLOW_COPY_AND_ASSIGN(AshTestBase);
};
diff --git a/ash/test/ash_unittests.cc b/ash/test/ash_unittests.cc
index 669e84e..7374ada 100644
--- a/ash/test/ash_unittests.cc
+++ b/ash/test/ash_unittests.cc
@@ -5,13 +5,18 @@
#include "ash/test/test_suite.h"
#if defined(OS_WIN)
+#include "base/command_line.h"
#include "base/win/windows_version.h"
#endif
int main(int argc, char** argv) {
#if defined(OS_WIN)
+ CommandLine::Init(argc, argv);
// Disabled on Win8 until they're passing cleanly. http://crbug.com/154081
- if (base::win::GetVersion() >= base::win::VERSION_WIN8)
+ // Can be optionally enabled via a command line flag (handy for developing)
+ // until such time.
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8 &&
+ !CommandLine::ForCurrentProcess()->HasSwitch("ash-metro-tests"))
return 0;
#endif
return ash::test::AuraShellTestSuite(argc, argv).Run();
diff --git a/ash/test/test_metro_viewer_process_host.cc b/ash/test/test_metro_viewer_process_host.cc
new file mode 100644
index 0000000..052664f
--- /dev/null
+++ b/ash/test/test_metro_viewer_process_host.cc
@@ -0,0 +1,141 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/test/test_metro_viewer_process_host.h"
+
+#include <shellapi.h>
+#include <shlobj.h>
+
+#include "base/command_line.h"
+#include "base/file_path.h"
+#include "base/file_util.h"
+#include "base/string16.h"
+#include "base/time.h"
+#include "base/win/scoped_com_initializer.h"
+#include "base/win/scoped_comptr.h"
+#include "ipc/ipc_channel_proxy.h"
+#include "ipc/ipc_message_macros.h"
+#include "ui/aura/remote_root_window_host_win.h"
+#include "ui/metro_viewer/metro_viewer_messages.h"
+#include "ui/surface/accelerated_surface_win.h"
+
+namespace ash {
+namespace test {
+
+TestMetroViewerProcessHost::InternalMessageFilter::InternalMessageFilter(
+ TestMetroViewerProcessHost* owner)
+ : owner_(owner) {
+}
+
+void TestMetroViewerProcessHost::InternalMessageFilter::OnChannelConnected(
+ int32 peer_pid) {
+ owner_->NotifyChannelConnected();
+}
+
+TestMetroViewerProcessHost::TestMetroViewerProcessHost(
+ const std::string& ipc_channel_name)
+ : ipc_thread_("test_metro_viewer_ipc_thread"),
+ channel_connected_event_(false, false),
+ closed_unexpectedly_(false) {
+
+ base::Thread::Options options;
+ options.message_loop_type = MessageLoop::TYPE_IO;
+ ipc_thread_.StartWithOptions(options);
+
+ channel_.reset(new IPC::ChannelProxy(
+ ipc_channel_name.c_str(),
+ IPC::Channel::MODE_NAMED_SERVER,
+ this,
+ ipc_thread_.message_loop_proxy()));
+
+ channel_->AddFilter(new InternalMessageFilter(this));
+}
+
+TestMetroViewerProcessHost::~TestMetroViewerProcessHost() {
+ channel_.reset();
+ ipc_thread_.Stop();
+}
+
+void TestMetroViewerProcessHost::NotifyChannelConnected() {
+ channel_connected_event_.Signal();
+}
+
+bool TestMetroViewerProcessHost::LaunchImmersiveChromeAndWaitForConnection() {
+ // Activate metro chrome. NOTE: This assumes a few things:
+ // 1) That we are using the per-user AppModelId. This is safe for tests.
+ //
+ // 2) That Chrome is registered as the default browser using a test AppModelId
+ // suffix.
+ // TODO(robertshield,grt): Automate 2). Note that at current, The Way to
+ // register chrome.exe is to run
+ //
+ // setup.exe --register-dev-chrome --register-dev-chrome-suffix=.test
+ //
+ // 3) That chrome.exe/delegate_execute.exe are at all suitable for using as
+ // a metro viewer process for tests.
+ // TODO(robertshield): Investigate having a minimal non-chrome viewer process.
+ // http://crbug.com/170425
+#if defined(GOOGLE_CHROME_BUILD)
+ const wchar_t kAppUserModelId[] = L"Chrome";
+#else // GOOGLE_CHROME_BUILD
+ const wchar_t kAppUserModelId[] = L"Chromium";
+#endif // GOOGLE_CHROME_BUILD
+
+ // TODO(robertshield): Initialize COM at test suite startup.
+ base::win::ScopedCOMInitializer com_initializer;
+
+ string16 app_model_id(kAppUserModelId);
+ app_model_id.append(L".test");
+
+ base::win::ScopedComPtr<IApplicationActivationManager> activator;
+ HRESULT hr = activator.CreateInstance(CLSID_ApplicationActivationManager);
+ if (SUCCEEDED(hr)) {
+ DWORD pid = 0;
+ hr = activator->ActivateApplication(
+ app_model_id.c_str(), L"open", AO_NONE, &pid);
+ }
+
+ LOG_IF(ERROR, FAILED(hr)) << "Tried and failed to launch Metro Chrome. "
+ << "hr=" << std::hex << hr;
+
+ // Having launched the viewer process, now we wait for it to connect.
+ return channel_connected_event_.TimedWait(base::TimeDelta::FromSeconds(60));
+}
+
+bool TestMetroViewerProcessHost::Send(IPC::Message* msg) {
+ return channel_->Send(msg);
+}
+
+bool TestMetroViewerProcessHost::OnMessageReceived(
+ const IPC::Message& message) {
+ DCHECK(CalledOnValidThread());
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP(TestMetroViewerProcessHost, message)
+ IPC_MESSAGE_HANDLER(MetroViewerHostMsg_SetTargetSurface, OnSetTargetSurface)
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP()
+ return handled ? true :
+ aura::RemoteRootWindowHostWin::Instance()->OnMessageReceived(message);
+}
+
+void TestMetroViewerProcessHost::OnChannelError() {
+ closed_unexpectedly_ = true;
+ aura::RemoteRootWindowHostWin::Instance()->Disconnected();
+}
+
+void TestMetroViewerProcessHost::OnSetTargetSurface(
+ gfx::NativeViewId target_surface) {
+ DLOG(INFO) << __FUNCTION__ << ", target_surface = " << target_surface;
+ HWND hwnd = reinterpret_cast<HWND>(target_surface);
+
+ backing_surface.reset(new AcceleratedSurface(hwnd));
+
+ scoped_refptr<AcceleratedPresenter> any_window =
+ AcceleratedPresenter::GetForWindow(NULL);
+ any_window->SetNewTargetWindow(hwnd);
+ aura::RemoteRootWindowHostWin::Instance()->Connected(this);
+}
+
+} // namespace test
+} // namespace ash
diff --git a/ash/test/test_metro_viewer_process_host.h b/ash/test/test_metro_viewer_process_host.h
new file mode 100644
index 0000000..2662390
--- /dev/null
+++ b/ash/test/test_metro_viewer_process_host.h
@@ -0,0 +1,88 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_TEST_TEST_METRO_VIEWER_PROCESS_HOST_H_
+#define ASH_TEST_TEST_METRO_VIEWER_PROCESS_HOST_H_
+
+#include <string>
+
+#include "base/memory/scoped_ptr.h"
+#include "base/synchronization/waitable_event.h"
+#include "base/threading/non_thread_safe.h"
+#include "base/threading/thread.h"
+#include "ipc/ipc_channel_proxy.h"
+#include "ipc/ipc_listener.h"
+#include "ipc/ipc_sender.h"
+#include "ui/gfx/native_widget_types.h"
+
+class AcceleratedSurface;
+
+namespace ash {
+namespace test {
+
+class TestMetroViewerProcessHost : public IPC::Listener,
+ public IPC::Sender,
+ public base::NonThreadSafe {
+ public:
+ explicit TestMetroViewerProcessHost(const std::string& ipc_channel_name);
+ virtual ~TestMetroViewerProcessHost();
+
+ // Launches the Chrome viewer process and blocks until that viewer process
+ // connects or until a timeout is reached. Returns true if the viewer process
+ // connects before the timeout is reached.
+ // TODO(robertshield): This creates a run-time dependency on chrome.exe as the
+ // viewer process and, indirectly, setup.exe as the only thing that can
+ // correctly register a program as the default browser on metro. Investigate
+ // extracting the registration code and the metro init code and building them
+ // into a standalone viewer process.
+ bool LaunchImmersiveChromeAndWaitForConnection();
+
+ // IPC::Sender implementation:
+ virtual bool Send(IPC::Message* msg) OVERRIDE;
+
+ // IPC::Listener implementation:
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+ virtual void OnChannelError() OVERRIDE;
+
+ bool closed_unexpectedly() { return closed_unexpectedly_; }
+
+ private:
+ void OnSetTargetSurface(gfx::NativeViewId target_surface);
+
+ void NotifyChannelConnected();
+
+ // Inner message filter used to handle connection event on the IPC channel
+ // proxy's background thread. This prevents consumers of
+ // TestMetroViewerProcessHost from having to pump messages on their own
+ // message loop.
+ class InternalMessageFilter : public IPC::ChannelProxy::MessageFilter {
+ public:
+ InternalMessageFilter(TestMetroViewerProcessHost* owner);
+
+ // IPC::ChannelProxy::MessageFilter implementation.
+ virtual void OnChannelConnected(int32 peer_pid) OVERRIDE;
+
+ private:
+ TestMetroViewerProcessHost* owner_;
+ DISALLOW_COPY_AND_ASSIGN(InternalMessageFilter);
+ };
+
+ // Members related to the IPC channel. Note that the order is important
+ // here as ipc_thread_ should be destroyed after channel_.
+ base::Thread ipc_thread_;
+ scoped_ptr<IPC::ChannelProxy> channel_;
+ base::WaitableEvent channel_connected_event_;
+
+ scoped_ptr<AcceleratedSurface> backing_surface;
+
+ bool closed_unexpectedly_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestMetroViewerProcessHost);
+};
+
+
+} // namespace test
+} // namespace ash
+
+#endif // ASH_TEST_TEST_METRO_VIEWER_PROCESS_HOST_H_
diff --git a/ash/test/test_suite.cc b/ash/test/test_suite.cc
index 2cfaf52..0da6e82 100644
--- a/ash/test/test_suite.cc
+++ b/ash/test/test_suite.cc
@@ -17,6 +17,10 @@
#include "ash/test/test_suite_init.h"
#endif
+#if defined(OS_WIN)
+#include "base/win/windows_version.h"
+#endif
+
namespace ash {
namespace test {
@@ -37,7 +41,15 @@ void AuraShellTestSuite::Initialize() {
// output, it'll pass regardless of the system language.
ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL);
ui::CompositorTestSupport::Initialize();
+
+#if defined(OS_WIN)
+ // The glue code that connects the tests to the metro viewer process depends
+ // on using the real compositor.
+ if (base::win::GetVersion() < base::win::VERSION_WIN8)
+ ui::SetupTestCompositor();
+#else
ui::SetupTestCompositor();
+#endif
}
void AuraShellTestSuite::Shutdown() {
diff --git a/ash/tooltips/tooltip_controller_unittest.cc b/ash/tooltips/tooltip_controller_unittest.cc
index 4426654..f05c15b 100644
--- a/ash/tooltips/tooltip_controller_unittest.cc
+++ b/ash/tooltips/tooltip_controller_unittest.cc
@@ -479,7 +479,16 @@ TEST_F(TooltipControllerTest, TooltipHidesOnTimeoutAndStaysHiddenUntilChange) {
EXPECT_EQ(window, GetTooltipWindow());
}
-TEST_F(TooltipControllerTest, TooltipsOnMultiDisplayShouldNotCrash) {
+#if defined(OS_WIN)
+// Multiple displays are not supported on Windows Ash. http://crbug.com/165962
+#define MAYBE_TooltipsOnMultiDisplayShouldNotCrash \
+ DISABLED_TooltipsOnMultiDisplayShouldNotCrash
+#else
+#define MAYBE_TooltipsOnMultiDisplayShouldNotCrash \
+ TooltipsOnMultiDisplayShouldNotCrash
+#endif
+
+TEST_F(TooltipControllerTest, MAYBE_TooltipsOnMultiDisplayShouldNotCrash) {
UpdateDisplay("1000x600,600x400");
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
scoped_ptr<views::Widget> widget1(CreateNewWidgetWithBoundsOn(
diff --git a/ash/wm/activation_controller_unittest.cc b/ash/wm/activation_controller_unittest.cc
index 7c9ba0a..14fc4f5 100644
--- a/ash/wm/activation_controller_unittest.cc
+++ b/ash/wm/activation_controller_unittest.cc
@@ -533,9 +533,18 @@ TEST_F(ActivationControllerTest, ActivateLockScreen) {
EXPECT_TRUE(w1->HasFocus());
}
+#if defined(OS_WIN)
+// Multiple displays are not supported on Windows Ash. http://crbug.com/165962
+#define MAYBE_NextActiveWindowOnMultipleDisplays \
+ DISABLED_NextActiveWindowOnMultipleDisplays
+#else
+#define MAYBE_NextActiveWindowOnMultipleDisplays \
+ NextActiveWindowOnMultipleDisplays
+#endif
+
// Verifies that a next active window is chosen from current
// active display.
-TEST_F(ActivationControllerTest, NextActiveWindowOnMultipleDisplays) {
+TEST_F(ActivationControllerTest, MAYBE_NextActiveWindowOnMultipleDisplays) {
UpdateDisplay("300x300,300x300");
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
diff --git a/ash/wm/frame_painter_unittest.cc b/ash/wm/frame_painter_unittest.cc
index 9839d5e..ecd87f2 100644
--- a/ash/wm/frame_painter_unittest.cc
+++ b/ash/wm/frame_painter_unittest.cc
@@ -266,7 +266,16 @@ TEST_F(FramePainterTest, UseSoloWindowHeader) {
EXPECT_TRUE(p1.UseSoloWindowHeader());
}
-TEST_F(FramePainterTest, UseSoloWindowHeaderMultiDisplay) {
+#if defined(OS_WIN)
+// Multiple displays are not supported on Windows Ash. http://crbug.com/165962
+#define MAYBE_UseSoloWindowHeaderMultiDisplay \
+ DISABLED_UseSoloWindowHeaderMultiDisplay
+#else
+#define MAYBE_UseSoloWindowHeaderMultiDisplay \
+ UseSoloWindowHeaderMultiDisplay
+#endif
+
+TEST_F(FramePainterTest, MAYBE_UseSoloWindowHeaderMultiDisplay) {
UpdateDisplay("1000x600,600x400");
// Create two widgets and painters for them.
diff --git a/ash/wm/session_state_controller_impl2_unittest.cc b/ash/wm/session_state_controller_impl2_unittest.cc
index bb35f0a..0740fb7e 100644
--- a/ash/wm/session_state_controller_impl2_unittest.cc
+++ b/ash/wm/session_state_controller_impl2_unittest.cc
@@ -25,6 +25,9 @@
#include "ui/gfx/rect.h"
#include "ui/gfx/size.h"
+#if defined(OS_WIN)
+#include "base/win/windows_version.h"
+#endif
namespace ash {
@@ -463,6 +466,13 @@ TEST_F(SessionStateControllerImpl2Test, DISABLED_LegacyLockAndShutDown) {
// Test that we start shutting down immediately if the power button is pressed
// while we're not logged in on an unofficial system.
TEST_F(SessionStateControllerImpl2Test, LegacyNotLoggedIn) {
+#if defined(OS_WIN)
+ // This test seems to tickle a race condition on Metro/Ash causing the test
+ // suite to crash.
+ // TODO(robertshield): Fix this. http://crbug.com/170418
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8)
+ return;
+#endif
Initialize(true, user::LOGGED_IN_NONE);
PressPowerButton();
@@ -474,6 +484,13 @@ TEST_F(SessionStateControllerImpl2Test, LegacyNotLoggedIn) {
// Test that we start shutting down immediately if the power button is pressed
// while we're logged in as a guest on an unofficial system.
TEST_F(SessionStateControllerImpl2Test, LegacyGuest) {
+#if defined(OS_WIN)
+ // This test seems to tickle a race condition on Metro/Ash causing the test
+ // suite to crash.
+ // TODO(robertshield): Fix this. http://crbug.com/170418
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8)
+ return;
+#endif
Initialize(true, user::LOGGED_IN_GUEST);
PressPowerButton();
@@ -485,6 +502,13 @@ TEST_F(SessionStateControllerImpl2Test, LegacyGuest) {
// When we hold the power button while the user isn't logged in, we should shut
// down the machine directly.
TEST_F(SessionStateControllerImpl2Test, ShutdownWhenNotLoggedIn) {
+#if defined(OS_WIN)
+ // This test seems to tickle a race condition on Metro/Ash causing the test
+ // suite to crash.
+ // TODO(robertshield): Fix this. http://crbug.com/170418
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8)
+ return;
+#endif
Initialize(false, user::LOGGED_IN_NONE);
// Press the power button and check that we start the shutdown timer.
@@ -865,6 +889,13 @@ TEST_F(SessionStateControllerImpl2Test, LockWithoutButton) {
// When we hear that the process is exiting but we haven't had a chance to
// display an animation, we should just blank the screen.
TEST_F(SessionStateControllerImpl2Test, ShutdownWithoutButton) {
+#if defined(OS_WIN)
+ // This test seems to tickle a race condition on Metro/Ash causing the test
+ // suite to crash.
+ // TODO(robertshield): Fix this. http://crbug.com/170418
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8)
+ return;
+#endif
Initialize(false, user::LOGGED_IN_USER);
state_controller_->OnAppTerminating();
@@ -879,6 +910,13 @@ TEST_F(SessionStateControllerImpl2Test, ShutdownWithoutButton) {
// Test that we display the fast-close animation and shut down when we get an
// outside request to shut down (e.g. from the login or lock screen).
TEST_F(SessionStateControllerImpl2Test, RequestShutdownFromLoginScreen) {
+#if defined(OS_WIN)
+ // This test seems to tickle a race condition on Metro/Ash causing the test
+ // suite to crash.
+ // TODO(robertshield): Fix this. http://crbug.com/170418
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8)
+ return;
+#endif
Initialize(false, user::LOGGED_IN_NONE);
state_controller_->RequestShutdown();
@@ -896,6 +934,13 @@ TEST_F(SessionStateControllerImpl2Test, RequestShutdownFromLoginScreen) {
}
TEST_F(SessionStateControllerImpl2Test, RequestShutdownFromLockScreen) {
+#if defined(OS_WIN)
+ // This test seems to tickle a race condition on Metro/Ash causing the test
+ // suite to crash.
+ // TODO(robertshield): Fix this. http://crbug.com/170418
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8)
+ return;
+#endif
Initialize(false, user::LOGGED_IN_USER);
SystemLocks();
diff --git a/ash/wm/shelf_layout_manager_unittest.cc b/ash/wm/shelf_layout_manager_unittest.cc
index cabdb0e..1f8e3a6 100644
--- a/ash/wm/shelf_layout_manager_unittest.cc
+++ b/ash/wm/shelf_layout_manager_unittest.cc
@@ -36,6 +36,10 @@
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
+#if defined(OS_WIN)
+#include "base/win/windows_version.h"
+#endif
+
namespace ash {
namespace internal {
@@ -804,6 +808,13 @@ TEST_F(ShelfLayoutManagerTest, GestureDrag) {
}
TEST_F(ShelfLayoutManagerTest, GestureRevealsTrayBubble) {
+#if defined(OS_WIN)
+ // This test seems to tickle a race condition on Metro/Ash causing the test
+ // suite to crash.
+ // TODO(robertshield): Fix this. http://crbug.com/170418
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8)
+ return;
+#endif
ShelfLayoutManager* shelf = GetShelfLayoutManager();
shelf->LayoutShelf();
@@ -846,6 +857,13 @@ TEST_F(ShelfLayoutManagerTest, GestureRevealsTrayBubble) {
}
TEST_F(ShelfLayoutManagerTest, ShelfFlickerOnTrayActivation) {
+#if defined(OS_WIN)
+ // This test seems to tickle a race condition on Metro/Ash causing the test
+ // suite to crash.
+ // TODO(robertshield): Fix this. http://crbug.com/170418
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8)
+ return;
+#endif
ShelfLayoutManager* shelf = GetShelfLayoutManager();
// Turn on auto-hide for the shelf.
diff --git a/ash/wm/system_modal_container_layout_manager_unittest.cc b/ash/wm/system_modal_container_layout_manager_unittest.cc
index 2e1ab67..d527cd0 100644
--- a/ash/wm/system_modal_container_layout_manager_unittest.cc
+++ b/ash/wm/system_modal_container_layout_manager_unittest.cc
@@ -436,7 +436,14 @@ TEST_F(SystemModalContainerLayoutManagerTest, ShowNormalBackgroundOrLocked) {
// TODO(mukai): add the test case when the bug is fixed.
}
-TEST_F(SystemModalContainerLayoutManagerTest, MultiDisplays) {
+#if defined(OS_WIN)
+// Multiple displays are not supported on Windows Ash. http://crbug.com/165962
+#define MAYBE_MultiDisplays DISABLED_MultiDisplays
+#else
+#define MAYBE_MultiDisplays MultiDisplays
+#endif
+
+TEST_F(SystemModalContainerLayoutManagerTest, MAYBE_MultiDisplays) {
UpdateDisplay("500x500,500x500");
scoped_ptr<aura::Window> normal(OpenToplevelTestWindow(false));
diff --git a/ash/wm/window_cycle_controller_unittest.cc b/ash/wm/window_cycle_controller_unittest.cc
index c3b1ce6..54b7891 100644
--- a/ash/wm/window_cycle_controller_unittest.cc
+++ b/ash/wm/window_cycle_controller_unittest.cc
@@ -317,7 +317,17 @@ TEST_F(WindowCycleControllerTest, AlwaysOnTopMultiWindow) {
EXPECT_TRUE(wm::IsActiveWindow(window0.get()));
}
-TEST_F(WindowCycleControllerTest, AlwaysOnTopMultipleRootWindows) {
+#if defined(OS_WIN)
+// Multiple displays are not supported on Windows Ash. http://crbug.com/165962
+#define MAYBE_AlwaysOnTopMultipleRootWindows \
+ DISABLED_AlwaysOnTopMultipleRootWindows
+#else
+#define MAYBE_AlwaysOnTopMultipleRootWindows \
+ AlwaysOnTopMultipleRootWindows
+#endif
+
+
+TEST_F(WindowCycleControllerTest, MAYBE_AlwaysOnTopMultipleRootWindows) {
// Set up a second root window
UpdateDisplay("0+0-1000x600,1001+0-600x400");
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
diff --git a/ash/wm/workspace/workspace_window_resizer_unittest.cc b/ash/wm/workspace/workspace_window_resizer_unittest.cc
index cc3b3e9..87184e9 100644
--- a/ash/wm/workspace/workspace_window_resizer_unittest.cc
+++ b/ash/wm/workspace/workspace_window_resizer_unittest.cc
@@ -456,8 +456,16 @@ TEST_F(WorkspaceWindowResizerTest, AttachedResize_BOTTOM_3_Compress) {
EXPECT_EQ("20,366 100x134", window3_->bounds().ToString());
}
+
+#if defined(OS_WIN)
+// Multiple displays are not supported on Windows Ash. http://crbug.com/165962
+#define MAYBE_Edge DISABLED_Edge
+#else
+#define MAYBE_Edge Edge
+#endif
+
// Assertions around dragging to the left/right edge of the screen.
-TEST_F(WorkspaceWindowResizerTest, Edge) {
+TEST_F(WorkspaceWindowResizerTest, MAYBE_Edge) {
int bottom =
ScreenAsh::GetDisplayWorkAreaBoundsInParent(window_.get()).bottom();
window_->SetBounds(gfx::Rect(20, 30, 50, 60));
@@ -528,7 +536,14 @@ TEST_F(WorkspaceWindowResizerTest, NonResizableWindows) {
EXPECT_EQ("0,30 50x60", window_->bounds().ToString());
}
-TEST_F(WorkspaceWindowResizerTest, CancelSnapPhantom) {
+#if defined(OS_WIN)
+// Multiple displays are not supported on Windows Ash. http://crbug.com/165962
+#define MAYBE_CancelSnapPhantom DISABLED_CancelSnapPhantom
+#else
+#define MAYBE_CancelSnapPhantom CancelSnapPhantom
+#endif
+
+TEST_F(WorkspaceWindowResizerTest, MAYBE_CancelSnapPhantom) {
UpdateDisplay("800x600,800x600");
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
ASSERT_EQ(2U, root_windows.size());
@@ -606,8 +621,17 @@ TEST_F(WorkspaceWindowResizerTest, DontDragOffBottom) {
window_->bounds().ToString());
}
+#if defined(OS_WIN)
+// Multiple displays are not supported on Windows Ash. http://crbug.com/165962
+#define MAYBE_DontDragOffBottomWithMultiDisplay \
+ DISABLED_DontDragOffBottomWithMultiDisplay
+#else
+#define MAYBE_DontDragOffBottomWithMultiDisplay \
+ DontDragOffBottomWithMultiDisplay
+#endif
+
// Makes sure we don't allow dragging on the work area with multidisplay.
-TEST_F(WorkspaceWindowResizerTest, DontDragOffBottomWithMultiDisplay) {
+TEST_F(WorkspaceWindowResizerTest, MAYBE_DontDragOffBottomWithMultiDisplay) {
UpdateDisplay("800x600,800x600");
ASSERT_EQ(2, Shell::GetScreen()->GetNumDisplays());
@@ -730,9 +754,19 @@ TEST_F(WorkspaceWindowResizerTest, ResizeWindowOutsideBottomWorkArea) {
window_->bounds().ToString());
}
+#if defined(OS_WIN)
+// Multiple displays are not supported on Windows Ash. http://crbug.com/165962
+#define MAYBE_DragWindowOutsideRightToSecondaryDisplay \
+ DISABLED_DragWindowOutsideRightToSecondaryDisplay
+#else
+#define MAYBE_DragWindowOutsideRightToSecondaryDisplay \
+ DragWindowOutsideRightToSecondaryDisplay
+#endif
+
// Verifies that 'outside' check of the resizer take into account the extended
// desktop in case of repositions.
-TEST_F(WorkspaceWindowResizerTest, DragWindowOutsideRightToSecondaryDisplay) {
+TEST_F(WorkspaceWindowResizerTest,
+ MAYBE_DragWindowOutsideRightToSecondaryDisplay) {
// Only primary display. Changes the window position to fit within the
// display.
Shell::GetInstance()->SetDisplayWorkAreaInsets(
diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc
index 4ec738f..9a7cb96 100644
--- a/chrome/installer/setup/setup_main.cc
+++ b/chrome/installer/setup/setup_main.cc
@@ -1163,7 +1163,8 @@ installer::InstallStatus RegisterDevChrome(
// Only proceed with registering a dev chrome if no real Chrome installation
// of the same distribution are present on this system.
const ProductState* existing_chrome =
- original_state.GetProductState(false, BrowserDistribution::CHROME_BROWSER);
+ original_state.GetProductState(false,
+ BrowserDistribution::CHROME_BROWSER);
if (!existing_chrome) {
existing_chrome =
original_state.GetProductState(true, BrowserDistribution::CHROME_BROWSER);
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc
index 1383a72..108317b 100644
--- a/chrome/installer/util/shell_util.cc
+++ b/chrome/installer/util/shell_util.cc
@@ -43,6 +43,7 @@
#include "chrome/installer/util/l10n_string_util.h"
#include "chrome/installer/util/master_preferences.h"
#include "chrome/installer/util/master_preferences_constants.h"
+#include "chrome/installer/util/util_constants.h"
#include "installer_util_strings.h" // NOLINT
@@ -1455,7 +1456,15 @@ string16 ShellUtil::GetBrowserModelId(BrowserDistribution* dist,
bool is_per_user_install) {
string16 app_id(dist->GetBaseAppId());
string16 suffix;
- if (is_per_user_install && !GetUserSpecificRegistrySuffix(&suffix)) {
+
+ // TODO(robertshield): Temporary hack to make the kRegisterChromeBrowserSuffix
+ // apply to all registry values computed down in these murky depths.
+ CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ if (command_line.HasSwitch(
+ installer::switches::kRegisterChromeBrowserSuffix)) {
+ suffix = command_line.GetSwitchValueNative(
+ installer::switches::kRegisterChromeBrowserSuffix);
+ } else if (is_per_user_install && !GetUserSpecificRegistrySuffix(&suffix)) {
NOTREACHED();
}
// There is only one component (i.e. the suffixed appid) in this case, but it
@@ -1710,9 +1719,15 @@ bool ShellUtil::RegisterChromeBrowser(BrowserDistribution* dist,
if (!dist->CanSetAsDefault())
return false;
+ CommandLine& command_line = *CommandLine::ForCurrentProcess();
+
string16 suffix;
if (!unique_suffix.empty()) {
suffix = unique_suffix;
+ } else if (command_line.HasSwitch(
+ installer::switches::kRegisterChromeBrowserSuffix)) {
+ suffix = command_line.GetSwitchValueNative(
+ installer::switches::kRegisterChromeBrowserSuffix);
} else if (!GetInstallationSpecificSuffix(dist, chrome_exe, &suffix)) {
return false;
}
diff --git a/ui/aura/remote_root_window_host_win.cc b/ui/aura/remote_root_window_host_win.cc
index 3aa77bf..18c1eed 100644
--- a/ui/aura/remote_root_window_host_win.cc
+++ b/ui/aura/remote_root_window_host_win.cc
@@ -79,7 +79,7 @@ bool RemoteRootWindowHostWin::OnMessageReceived(const IPC::Message& message) {
OnTouchMoved)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
- return handled;
+ return handled;
}
void RemoteRootWindowHostWin::SetDelegate(RootWindowHostDelegate* delegate) {