run_all_unittests.cc 971 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2018 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "base/bind.h"
  5. #include "base/test/launcher/unit_test_launcher.h"
  6. #include "base/test/test_suite.h"
  7. #include "chrome/elevation_service/service_main.h"
  8. #include "chrome/install_static/test/scoped_install_details.h"
  9. namespace {
  10. class DefaultEnvironment final : public ::testing::Environment {
  11. public:
  12. DefaultEnvironment() = default;
  13. void SetUp() override {
  14. elevation_service::ServiceMain::GetInstance()->CreateWRLModule();
  15. }
  16. };
  17. } // namespace
  18. int main(int argc, char** argv) {
  19. base::TestSuite test_suite(argc, argv);
  20. install_static::ScopedInstallDetails scoped_install_details;
  21. testing::AddGlobalTestEnvironment(new DefaultEnvironment);
  22. return base::LaunchUnitTestsSerially(
  23. argc, argv,
  24. base::BindOnce(&base::TestSuite::Run, base::Unretained(&test_suite)));
  25. }