| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/test/launcher/unit_test_launcher.h" | 10 #include "base/test/launcher/unit_test_launcher.h" |
| 11 #include "base/test/test_suite.h" | 11 #include "base/test/test_suite.h" |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h" | 13 #include "mojo/edk/embedder/embedder.h" |
| 14 #include "ui/base/resource/resource_bundle.h" | 14 #include "ui/base/resource/resource_bundle.h" |
| 15 #include "ui/gfx/display.h" | 15 #include "ui/gfx/display.h" |
| 16 #include "ui/gfx/geometry/size.h" | 16 #include "ui/gfx/geometry/size.h" |
| 17 #include "ui/mojo/init/ui_init.h" | 17 #include "ui/mojo/init/ui_init.h" |
| 18 | 18 |
| 19 #if defined(OS_ANDROID) | 19 #if defined(OS_ANDROID) |
| 20 #include "base/android/apk_assets.h" | 20 #include "base/android/apk_assets.h" |
| 21 #include "base/android/jni_android.h" | 21 #include "base/android/jni_android.h" |
| 22 #include "base/test/test_file_util.h" | 22 #include "base/test/test_file_util.h" |
| 23 #endif | 23 #endif |
| (...skipping 21 matching lines...) Expand all Loading... |
| 45 ui::ResourceBundle::InitSharedInstanceWithPakPath(base::FilePath()); | 45 ui::ResourceBundle::InitSharedInstanceWithPakPath(base::FilePath()); |
| 46 ui::ResourceBundle::GetSharedInstance().AddDataPackFromFileRegion( | 46 ui::ResourceBundle::GetSharedInstance().AddDataPackFromFileRegion( |
| 47 base::File(fd), resource_file_region, ui::SCALE_FACTOR_100P); | 47 base::File(fd), resource_file_region, ui::SCALE_FACTOR_100P); |
| 48 #else | 48 #else |
| 49 base::FilePath pak_path; | 49 base::FilePath pak_path; |
| 50 CHECK(PathService::Get(base::DIR_MODULE, &pak_path)); | 50 CHECK(PathService::Get(base::DIR_MODULE, &pak_path)); |
| 51 pak_path = pak_path.AppendASCII("html_viewer.pak"); | 51 pak_path = pak_path.AppendASCII("html_viewer.pak"); |
| 52 ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_path); | 52 ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_path); |
| 53 #endif | 53 #endif |
| 54 ui::mojo::UIInit ui_init(GetTestDisplays()); | 54 ui::mojo::UIInit ui_init(GetTestDisplays()); |
| 55 mojo::embedder::Init(); | 55 mojo::edk::Init(); |
| 56 | 56 |
| 57 return base::LaunchUnitTests( | 57 return base::LaunchUnitTests( |
| 58 argc, argv, | 58 argc, argv, |
| 59 base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite))); | 59 base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite))); |
| 60 } | 60 } |
| OLD | NEW |