summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorrobertshield <robertshield@chromium.org>2015-10-05 12:32:51 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-05 19:35:42 +0000
commitfad7ae54f7c12a9551badf1cb1f2620b5fa82504 (patch)
tree6ae2c017e817fbe32bdd9384953dd6a5862a65b2 /ash
parente426727ce035a30172b8ab2450cc7b330dfac1f1 (diff)
downloadchromium_src-fad7ae54f7c12a9551badf1cb1f2620b5fa82504.zip
chromium_src-fad7ae54f7c12a9551badf1cb1f2620b5fa82504.tar.gz
chromium_src-fad7ae54f7c12a9551badf1cb1f2620b5fa82504.tar.bz2
Prune metro bits from the ash tests
BUG=332504 Review URL: https://codereview.chromium.org/1379683002 Cr-Commit-Position: refs/heads/master@{#352388}
Diffstat (limited to 'ash')
-rw-r--r--ash/BUILD.gn13
-rw-r--r--ash/ash.gyp11
-rw-r--r--ash/test/ash_test_base.cc33
-rw-r--r--ash/test/ash_test_base.h4
-rw-r--r--ash/test/test_metro_viewer_process_host.cc65
-rw-r--r--ash/test/test_metro_viewer_process_host.h46
-rw-r--r--ash/test/test_suite.cc4
7 files changed, 3 insertions, 173 deletions
diff --git a/ash/BUILD.gn b/ash/BUILD.gn
index 6268fdf..3d7d2f9 100644
--- a/ash/BUILD.gn
+++ b/ash/BUILD.gn
@@ -190,18 +190,7 @@ source_set("test_support") {
]
if (is_win) {
- sources += [
- "test/test_metro_viewer_process_host.cc",
- "test/test_metro_viewer_process_host.h",
- ]
- deps += [
- "//ipc",
- "//ui/metro_viewer",
- "//ui/platform_window/win",
- "//win8:metro_viewer",
- "//win8:test_support_win8",
- "//win8:test_registrar",
- ]
+ deps += [ "//ui/platform_window/win" ]
}
}
diff --git a/ash/ash.gyp b/ash/ash.gyp
index b3e1ac0..8d96a6c 100644
--- a/ash/ash.gyp
+++ b/ash/ash.gyp
@@ -1099,16 +1099,7 @@
'conditions': [
['OS=="win"', {
'dependencies': [
- '../ipc/ipc.gyp:ipc',
- '../ui/metro_viewer/metro_viewer.gyp:metro_viewer_messages',
'../ui/platform_window/win/win_window.gyp:win_window',
- '../win8/win8.gyp:metro_viewer',
- '../win8/win8.gyp:test_support_win8',
- '../win8/win8_tests.gyp:test_registrar',
- ],
- 'sources': [
- 'test/test_metro_viewer_process_host.cc',
- 'test/test_metro_viewer_process_host.h',
],
}],
],
@@ -1294,7 +1285,7 @@
'dependencies': [
'ash_shell_lib',
'../content/content_shell_and_tests.gyp:content_shell_lib',
- '../content/content.gyp:content',
+ '../content/content.gyp:content',
'../skia/skia.gyp:skia',
],
'sources': [
diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc
index dc0e36e..3a799fe 100644
--- a/ash/test/ash_test_base.cc
+++ b/ash/test/ash_test_base.cc
@@ -39,12 +39,9 @@
#endif
#if defined(OS_WIN)
-#include "ash/test/test_metro_viewer_process_host.h"
-#include "base/win/metro.h"
#include "base/win/windows_version.h"
#include "ui/aura/remote_window_tree_host_win.h"
#include "ui/aura/window_tree_host_win.h"
-#include "ui/gfx/win/metro_mode.h"
#include "ui/platform_window/win/win_window.h"
#include "win8/test/test_registrar_constants.h"
#endif
@@ -148,22 +145,8 @@ void AshTestBase::SetUp() {
gesture_config->set_max_touch_move_in_pixels_for_click(5);
#if defined(OS_WIN)
- if (!command_line->HasSwitch(ash::switches::kForceAshToDesktop)) {
- if (gfx::win::ShouldUseMetroMode()) {
- ipc_thread_.reset(new base::Thread("test_metro_viewer_ipc_thread"));
- base::Thread::Options options;
- options.message_loop_type = base::MessageLoop::TYPE_IO;
- ipc_thread_->StartWithOptions(options);
- metro_viewer_host_.reset(
- new TestMetroViewerProcessHost(ipc_thread_->task_runner()));
- CHECK(metro_viewer_host_->LaunchViewerAndWaitForConnection(
- win8::test::kDefaultTestAppUserModelId));
- aura::RemoteWindowTreeHostWin* window_tree_host =
- aura::RemoteWindowTreeHostWin::Instance();
- CHECK(window_tree_host != NULL);
- }
+ if (!command_line->HasSwitch(ash::switches::kForceAshToDesktop))
ash::WindowPositioner::SetMaximizeFirstWindow(true);
- }
#endif
}
@@ -173,23 +156,9 @@ void AshTestBase::TearDown() {
// Flush the message loop to finish pending release tasks.
RunAllPendingInMessageLoop();
-#if defined(OS_WIN)
- if (gfx::win::ShouldUseMetroMode() &&
- !base::CommandLine::ForCurrentProcess()->HasSwitch(
- ash::switches::kForceAshToDesktop)) {
- // Check that our viewer connection is still established.
- CHECK(!metro_viewer_host_->closed_unexpectedly());
- }
-#endif
-
ash_test_helper_->TearDown();
#if defined(OS_WIN)
ui::test::SetUsePopupAsRootWindowForTest(false);
- // Kill the viewer process if we spun one up.
- if (metro_viewer_host_) {
- metro_viewer_host_->TerminateViewer();
- 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 d45e21f..abc6f5d 100644
--- a/ash/test/ash_test_base.h
+++ b/ash/test/ash_test_base.h
@@ -149,10 +149,6 @@ class AshTestBase : public testing::Test {
scoped_ptr<AshTestHelper> ash_test_helper_;
scoped_ptr<ui::test::EventGenerator> event_generator_;
#if defined(OS_WIN)
- // Note that the order is important here as ipc_thread_ should be destroyed
- // after metro_viewer_host_->channel_.
- scoped_ptr<base::Thread> ipc_thread_;
- scoped_ptr<TestMetroViewerProcessHost> metro_viewer_host_;
ui::ScopedOleInitializer ole_initializer_;
#endif
diff --git a/ash/test/test_metro_viewer_process_host.cc b/ash/test/test_metro_viewer_process_host.cc
deleted file mode 100644
index 8527e19..0000000
--- a/ash/test/test_metro_viewer_process_host.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-// 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 <windef.h>
-
-#include "base/logging.h"
-#include "base/process/process.h"
-#include "ui/aura/remote_window_tree_host_win.h"
-#include "ui/gfx/win/dpi.h"
-
-namespace ash {
-namespace test {
-
-TestMetroViewerProcessHost::TestMetroViewerProcessHost(
- const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner)
- : MetroViewerProcessHost(ipc_task_runner), closed_unexpectedly_(false) {
-}
-
-TestMetroViewerProcessHost::~TestMetroViewerProcessHost() {
-}
-
-void TestMetroViewerProcessHost::TerminateViewer() {
- base::ProcessId viewer_process_id = GetViewerProcessId();
- if (viewer_process_id != base::kNullProcessId) {
- base::Process viewer_process = base::Process::OpenWithAccess(
- viewer_process_id,
- PROCESS_QUERY_INFORMATION | SYNCHRONIZE | PROCESS_TERMINATE);
- if (viewer_process.IsValid()) {
- viewer_process.Terminate(0, false);
- viewer_process.WaitForExit(nullptr);
- }
- }
-}
-
-void TestMetroViewerProcessHost::OnChannelError() {
- closed_unexpectedly_ = true;
- aura::RemoteWindowTreeHostWin::Instance()->Disconnected();
-}
-
-void TestMetroViewerProcessHost::OnSetTargetSurface(
- gfx::NativeViewId target_surface,
- float device_scale) {
- DLOG(INFO) << __FUNCTION__ << ", target_surface = " << target_surface;
- HWND hwnd = reinterpret_cast<HWND>(target_surface);
- gfx::InitDeviceScaleFactor(device_scale);
- aura::RemoteWindowTreeHostWin::Instance()->SetRemoteWindowHandle(hwnd);
- aura::RemoteWindowTreeHostWin::Instance()->Connected(this);
-}
-
-void TestMetroViewerProcessHost::OnOpenURL(const base::string16& url) {
-}
-
-void TestMetroViewerProcessHost::OnHandleSearchRequest(
- const base::string16& search_string) {
-}
-
-void TestMetroViewerProcessHost::OnWindowSizeChanged(uint32 width,
- uint32 height) {
-}
-
-} // namespace test
-} // namespace ash
diff --git a/ash/test/test_metro_viewer_process_host.h b/ash/test/test_metro_viewer_process_host.h
deleted file mode 100644
index a25095e..0000000
--- a/ash/test/test_metro_viewer_process_host.h
+++ /dev/null
@@ -1,46 +0,0 @@
-// 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 "base/memory/scoped_ptr.h"
-#include "win8/viewer/metro_viewer_process_host.h"
-
-class AcceleratedSurface;
-
-namespace ash {
-namespace test {
-
-class TestMetroViewerProcessHost : public win8::MetroViewerProcessHost {
- public:
- TestMetroViewerProcessHost(
- const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner);
- ~TestMetroViewerProcessHost() override;
-
- bool closed_unexpectedly() { return closed_unexpectedly_; }
-
- // Forcibly terminate the viewer. Used on completion of tests to ensure that
- // it's gone (quickly) so that we can start the next test immediately.
- void TerminateViewer();
-
- private:
- // win8::MetroViewerProcessHost implementation
- void OnChannelError() override;
- void OnSetTargetSurface(gfx::NativeViewId target_surface,
- float device_scale) override;
- void OnOpenURL(const base::string16& url) override;
- void OnHandleSearchRequest(const base::string16& search_string) override;
- void OnWindowSizeChanged(uint32 width, uint32 height) override;
-
- 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 c39c76b..8e2db6d 100644
--- a/ash/test/test_suite.cc
+++ b/ash/test/test_suite.cc
@@ -18,8 +18,6 @@
#if defined(OS_WIN)
#include "base/win/windows_version.h"
#include "ui/base/win/atl_module.h"
-#include "win8/test/metro_registration_helper.h"
-#include "win8/test/test_registrar_constants.h"
#endif
namespace ash {
@@ -45,8 +43,6 @@ void AuraShellTestSuite::Initialize() {
ash::switches::kForceAshToDesktop)) {
com_initializer_.reset(new base::win::ScopedCOMInitializer());
ui::win::CreateATLModuleIfNeeded();
- if (version >= base::win::VERSION_WIN8)
- ASSERT_TRUE(win8::MakeTestDefaultBrowserSynchronously());
}
#endif