OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "athena/activity/public/activity_factory.h" | 5 #include "athena/activity/public/activity_factory.h" |
6 #include "athena/activity/public/activity_manager.h" | 6 #include "athena/activity/public/activity_manager.h" |
7 #include "athena/test/athena_test_helper.h" | 7 #include "athena/test/athena_test_helper.h" |
8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
| 9 #include "base/base_paths.h" |
9 #include "base/command_line.h" | 10 #include "base/command_line.h" |
10 #include "base/i18n/icu_util.h" | 11 #include "base/i18n/icu_util.h" |
11 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
12 #include "base/path_service.h" | 13 #include "base/path_service.h" |
13 #include "base/run_loop.h" | 14 #include "base/run_loop.h" |
14 #include "ui/aura/window_tree_host.h" | 15 #include "ui/aura/window_tree_host.h" |
15 #include "ui/base/resource/resource_bundle.h" | 16 #include "ui/base/resource/resource_bundle.h" |
16 #include "ui/base/ui_base_paths.h" | |
17 #include "ui/compositor/test/context_factories_for_test.h" | 17 #include "ui/compositor/test/context_factories_for_test.h" |
18 #include "ui/gl/gl_surface.h" | 18 #include "ui/gl/gl_surface.h" |
19 | 19 |
20 class UIShell { | 20 class UIShell { |
21 public: | 21 public: |
22 explicit UIShell(base::MessageLoopForUI* message_loop) | 22 explicit UIShell(base::MessageLoopForUI* message_loop) |
23 : athena_helper_(message_loop) { | 23 : athena_helper_(message_loop) { |
24 const bool enable_pixel_output = true; | 24 const bool enable_pixel_output = true; |
25 ui::ContextFactory* factory = | 25 ui::ContextFactory* factory = |
26 ui::InitializeContextFactoryForTests(enable_pixel_output); | 26 ui::InitializeContextFactoryForTests(enable_pixel_output); |
(...skipping 12 matching lines...) Expand all Loading... |
39 private: | 39 private: |
40 athena::test::AthenaTestHelper athena_helper_; | 40 athena::test::AthenaTestHelper athena_helper_; |
41 | 41 |
42 DISALLOW_COPY_AND_ASSIGN(UIShell); | 42 DISALLOW_COPY_AND_ASSIGN(UIShell); |
43 }; | 43 }; |
44 | 44 |
45 int main(int argc, const char **argv) { | 45 int main(int argc, const char **argv) { |
46 setlocale(LC_ALL, ""); | 46 setlocale(LC_ALL, ""); |
47 | 47 |
48 base::AtExitManager exit_manager; | 48 base::AtExitManager exit_manager; |
49 ui::RegisterPathProvider(); | |
50 base::CommandLine::Init(argc, argv); | 49 base::CommandLine::Init(argc, argv); |
51 base::i18n::InitializeICU(); | 50 base::i18n::InitializeICU(); |
52 gfx::GLSurface::InitializeOneOffForTests(); | 51 gfx::GLSurface::InitializeOneOffForTests(); |
53 | 52 |
54 base::FilePath ui_test_pak_path; | 53 base::FilePath test_pak_path; |
55 DCHECK(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); | 54 CHECK(PathService::Get(base::DIR_MODULE, &test_pak_path)); |
56 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); | 55 test_pak_path = test_pak_path.AppendASCII("athena_resources.pak"); |
| 56 ui::ResourceBundle::InitSharedInstanceWithPakPath(test_pak_path); |
57 | 57 |
58 base::MessageLoopForUI message_loop; | 58 base::MessageLoopForUI message_loop; |
59 UIShell shell(&message_loop); | 59 UIShell shell(&message_loop); |
60 base::RunLoop run_loop; | 60 base::RunLoop run_loop; |
61 run_loop.Run(); | 61 run_loop.Run(); |
62 } | 62 } |
OLD | NEW |