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

Unified Diff: components/html_viewer/run_all_unittests.cc

Issue 1485573002: Remove SimpleBroker and instead use the production broker implementation in tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comment Created 5 years, 1 month 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 | « no previous file | ipc/mojo/run_all_unittests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/html_viewer/run_all_unittests.cc
diff --git a/components/html_viewer/run_all_unittests.cc b/components/html_viewer/run_all_unittests.cc
index 9a208e1195ec902dfa73e82af4e00b16a3b6de0f..134c51ed969ebad5e9056ac6a2edc576df594847 100644
--- a/components/html_viewer/run_all_unittests.cc
+++ b/components/html_viewer/run_all_unittests.cc
@@ -30,48 +30,30 @@ std::vector<gfx::Display> GetTestDisplays() {
return displays;
}
-class NoAtExitBaseTestSuite : public base::TestSuite {
- public:
- NoAtExitBaseTestSuite(int argc, char** argv)
- : base::TestSuite(argc, argv, false), ui_init_(GetTestDisplays()) {
-#if defined(OS_ANDROID)
- base::MemoryMappedFile::Region resource_file_region;
- int fd = base::android::OpenApkAsset("assets/html_viewer.pak",
- &resource_file_region);
- CHECK_NE(fd, -1);
- ui::ResourceBundle::InitSharedInstanceWithPakPath(base::FilePath());
- ui::ResourceBundle::GetSharedInstance().AddDataPackFromFileRegion(
- base::File(fd), resource_file_region, ui::SCALE_FACTOR_100P);
-#else
- base::FilePath pak_path;
- CHECK(PathService::Get(base::DIR_MODULE, &pak_path));
- pak_path = pak_path.AppendASCII("html_viewer.pak");
- ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_path);
-#endif
- }
-
- private:
- ui::mojo::UIInit ui_init_;
-
- DISALLOW_COPY_AND_ASSIGN(NoAtExitBaseTestSuite);
-};
-
-int RunTestSuite(int argc, char** argv) {
- return NoAtExitBaseTestSuite(argc, argv).Run();
-}
-
} // namespace
int main(int argc, char** argv) {
+ base::TestSuite test_suite(argc, argv);
#if defined(OS_ANDROID)
JNIEnv* env = base::android::AttachCurrentThread();
base::RegisterContentUriTestUtils(env);
+ base::MemoryMappedFile::Region resource_file_region;
+ int fd = base::android::OpenApkAsset("assets/html_viewer.pak",
+ &resource_file_region);
+ CHECK_NE(fd, -1);
+ ui::ResourceBundle::InitSharedInstanceWithPakPath(base::FilePath());
+ ui::ResourceBundle::GetSharedInstance().AddDataPackFromFileRegion(
+ base::File(fd), resource_file_region, ui::SCALE_FACTOR_100P);
#else
- base::AtExitManager at_exit;
+ base::FilePath pak_path;
+ CHECK(PathService::Get(base::DIR_MODULE, &pak_path));
+ pak_path = pak_path.AppendASCII("html_viewer.pak");
+ ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_path);
#endif
+ ui::mojo::UIInit ui_init(GetTestDisplays());
mojo::embedder::Init();
- return base::LaunchUnitTests(argc,
- argv,
- base::Bind(&RunTestSuite, argc, argv));
+ return base::LaunchUnitTests(
+ argc, argv,
+ base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite)));
}
« no previous file with comments | « no previous file | ipc/mojo/run_all_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698