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

Unified Diff: ash/test/test_suite.cc

Issue 12096064: Automatic Win8 default browser registration for the ash unittests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Dear Greg the second. Created 7 years, 10 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
Index: ash/test/test_suite.cc
diff --git a/ash/test/test_suite.cc b/ash/test/test_suite.cc
index 89a060b2a06d670a43d5aee41caba5b2a8c4f336..c5b7c3ace72ca94dd6254b128a59513f0e28cd2a 100644
--- a/ash/test/test_suite.cc
+++ b/ash/test/test_suite.cc
@@ -19,6 +19,10 @@
#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/open_with_dialog_controller.h"
+#include "win8/test/test_registrar_constants.h"
#endif
namespace ash {
@@ -30,6 +34,21 @@ AuraShellTestSuite::AuraShellTestSuite(int argc, char** argv)
void AuraShellTestSuite::Initialize() {
base::TestSuite::Initialize();
+#if defined(OS_WIN)
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
+ CHECK(win8::RegisterTestDefaultBrowser(
+ win8::test::kDefaultTestAppUserModelId,
+ win8::test::kDefaultTestExeName));
+
+ ui::win::CreateATLModuleIfNeeded();
+
+ std::vector<string16> choices;
+ win8::OpenWithDialogController controller;
+ controller.RunSynchronously(NULL, L"http", win8::test::kDefaultTestExeName,
+ &choices);
+ }
+#endif
+
gfx::RegisterPathProvider();
ui::RegisterPathProvider();

Powered by Google App Engine
This is Rietveld 408576698