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

Unified Diff: chrome/test/base/in_process_browser_test.cc

Issue 16022003: Base for Ash browser_tests on Win8. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Do not use SetUp/TearDownTestCase() Created 7 years, 6 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 | « chrome/test/base/in_process_browser_test.h ('k') | chrome/test/base/test_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/in_process_browser_test.cc
diff --git a/chrome/test/base/in_process_browser_test.cc b/chrome/test/base/in_process_browser_test.cc
index 5cdbf8f4bc990029fbbc0421f4b26be7fefa57ef..293c4c8bbd9ada11bd10a41f00021704be8b97ba 100644
--- a/chrome/test/base/in_process_browser_test.cc
+++ b/chrome/test/base/in_process_browser_test.cc
@@ -36,6 +36,7 @@
#include "chrome/renderer/chrome_content_renderer_client.h"
#include "chrome/test/base/chrome_test_suite.h"
#include "chrome/test/base/test_launcher_utils.h"
+#include "chrome/test/base/test_switches.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/notification_service.h"
@@ -54,6 +55,15 @@
#include "base/mac/scoped_nsautorelease_pool.h"
#endif
+#if defined(OS_WIN) && defined(USE_AURA)
+#include "base/win/scoped_com_initializer.h"
+#include "base/win/windows_version.h"
+#include "ui/base/win/atl_module.h"
+#include "ui/compositor/compositor_setup.h"
+#include "win8/test/metro_registration_helper.h"
+#include "win8/test/test_registrar_constants.h"
+#endif
+
#if defined(ENABLE_CAPTIVE_PORTAL_DETECTION)
#include "chrome/browser/captive_portal/captive_portal_service.h"
#endif
@@ -159,6 +169,18 @@ void InProcessBrowserTest::SetUp() {
google_util::SetMockLinkDoctorBaseURLForTesting();
+#if defined(OS_WIN) && defined(USE_AURA)
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8 &&
+ CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) {
+ com_initializer_.reset(new base::win::ScopedCOMInitializer());
+ ui::win::CreateATLModuleIfNeeded();
+ ASSERT_TRUE(win8::MakeTestDefaultBrowserSynchronously());
+
+ // Ash browser tests need the real compositor.
+ ui::DisableTestCompositor();
+ }
+#endif
+
BrowserTestBase::SetUp();
}
@@ -169,6 +191,13 @@ void InProcessBrowserTest::PrepareTestCommandLine(CommandLine* command_line) {
// This is a Browser test.
command_line->AppendSwitchASCII(switches::kTestType, kBrowserTestType);
+#if defined(OS_WIN) && defined(USE_AURA)
+ if (command_line->HasSwitch(switches::kAshBrowserTests)) {
+ command_line->AppendSwitchNative(switches::kViewerLaunchViaAppId,
+ win8::test::kDefaultTestAppUserModelId);
+ }
+#endif
+
#if defined(OS_MACOSX)
// Explicitly set the path of the binary used for child processes, otherwise
// they'll try to use browser_tests which doesn't contain ChromeMain.
@@ -212,6 +241,9 @@ bool InProcessBrowserTest::CreateUserDataDirectory() {
void InProcessBrowserTest::TearDown() {
DCHECK(!g_browser_process);
+#if defined(OS_WIN) && defined(USE_AURA)
+ com_initializer_.reset();
+#endif
BrowserTestBase::TearDown();
}
« no previous file with comments | « chrome/test/base/in_process_browser_test.h ('k') | chrome/test/base/test_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698