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

Side by Side 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: CHECK->ASSERT_TRUE 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/test/test_metro_viewer_process_host.cc ('k') | win8/delegate_execute/delegate_execute.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/test/test_suite.h" 5 #include "ash/test/test_suite.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "testing/gtest/include/gtest/gtest.h"
10 #include "ui/base/resource/resource_bundle.h" 11 #include "ui/base/resource/resource_bundle.h"
11 #include "ui/base/ui_base_paths.h" 12 #include "ui/base/ui_base_paths.h"
12 #include "ui/compositor/compositor_setup.h" 13 #include "ui/compositor/compositor_setup.h"
13 #include "ui/compositor/test/compositor_test_support.h" 14 #include "ui/compositor/test/compositor_test_support.h"
14 #include "ui/gfx/gfx_paths.h" 15 #include "ui/gfx/gfx_paths.h"
15 16
16 #if defined(OS_MACOSX) 17 #if defined(OS_MACOSX)
17 #include "ash/test/test_suite_init.h" 18 #include "ash/test/test_suite_init.h"
18 #endif 19 #endif
19 20
20 #if defined(OS_WIN) 21 #if defined(OS_WIN)
21 #include "base/win/windows_version.h" 22 #include "base/win/windows_version.h"
23 #include "ui/base/win/atl_module.h"
24 #include "win8/test/metro_registration_helper.h"
25 #include "win8/test/open_with_dialog_controller.h"
26 #include "win8/test/test_registrar_constants.h"
22 #endif 27 #endif
23 28
24 namespace ash { 29 namespace ash {
25 namespace test { 30 namespace test {
26 31
27 AuraShellTestSuite::AuraShellTestSuite(int argc, char** argv) 32 AuraShellTestSuite::AuraShellTestSuite(int argc, char** argv)
28 : TestSuite(argc, argv) {} 33 : TestSuite(argc, argv) {}
29 34
30 void AuraShellTestSuite::Initialize() { 35 void AuraShellTestSuite::Initialize() {
31 base::TestSuite::Initialize(); 36 base::TestSuite::Initialize();
32 37
38 #if defined(OS_WIN)
39 if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
40 ASSERT_TRUE(win8::RegisterTestDefaultBrowser(
41 win8::test::kDefaultTestAppUserModelId,
42 win8::test::kDefaultTestExeName));
43
44 ui::win::CreateATLModuleIfNeeded();
45
46 std::vector<string16> choices;
47 win8::OpenWithDialogController controller;
48 controller.RunSynchronously(NULL, L"http", win8::test::kDefaultTestExeName,
49 &choices);
50 }
51 #endif
52
33 gfx::RegisterPathProvider(); 53 gfx::RegisterPathProvider();
34 ui::RegisterPathProvider(); 54 ui::RegisterPathProvider();
35 55
36 #if defined(OS_MACOSX) 56 #if defined(OS_MACOSX)
37 ash::test::OverrideFrameworkBundle(); 57 ash::test::OverrideFrameworkBundle();
38 #endif 58 #endif
39 59
40 // Force unittests to run using en-US so if we test against string 60 // Force unittests to run using en-US so if we test against string
41 // output, it'll pass regardless of the system language. 61 // output, it'll pass regardless of the system language.
42 ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); 62 ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL);
43 ui::CompositorTestSupport::Initialize(); 63 ui::CompositorTestSupport::Initialize();
44 ui::SetupTestCompositor(); 64 ui::SetupTestCompositor();
45 } 65 }
46 66
47 void AuraShellTestSuite::Shutdown() { 67 void AuraShellTestSuite::Shutdown() {
48 ui::CompositorTestSupport::Terminate(); 68 ui::CompositorTestSupport::Terminate();
49 ui::ResourceBundle::CleanupSharedInstance(); 69 ui::ResourceBundle::CleanupSharedInstance();
50 base::TestSuite::Shutdown(); 70 base::TestSuite::Shutdown();
51 } 71 }
52 72
53 } // namespace test 73 } // namespace test
54 } // namespace ash 74 } // namespace ash
OLDNEW
« no previous file with comments | « ash/test/test_metro_viewer_process_host.cc ('k') | win8/delegate_execute/delegate_execute.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698