run_all_unittests.cc 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2013 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/multiprocess_test.h"
  7. #include "base/test/test_io_thread.h"
  8. #include "base/test/test_suite.h"
  9. #include "mojo/core/embedder/embedder.h"
  10. #include "mojo/core/embedder/scoped_ipc_support.h"
  11. #include "third_party/ipcz/src/test_buildflags.h"
  12. #if BUILDFLAG(ENABLE_IPCZ_MULTIPROCESS_TESTS)
  13. #include "third_party/ipcz/src/test/test_child_launcher.h"
  14. #endif
  15. int main(int argc, char** argv) {
  16. #if BUILDFLAG(ENABLE_IPCZ_MULTIPROCESS_TESTS)
  17. ipcz::test::TestChildLauncher::Initialize(argc, argv);
  18. #endif
  19. base::TestSuite test_suite(argc, argv);
  20. mojo::core::Init();
  21. base::TestIOThread test_io_thread(base::TestIOThread::kAutoStart);
  22. mojo::core::ScopedIPCSupport ipc_support(
  23. test_io_thread.task_runner(),
  24. mojo::core::ScopedIPCSupport::ShutdownPolicy::CLEAN);
  25. return base::LaunchUnitTests(
  26. argc, argv,
  27. base::BindOnce(&base::TestSuite::Run, base::Unretained(&test_suite)));
  28. }