Corentin Wallez | 0b71452b | 2018-10-30 17:35:00 | [diff] [blame] | 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 | |
| 5 | #include "base/bind.h" |
| 6 | #include "base/command_line.h" |
Chris Sharp | 7840c58 | 2019-08-02 15:45:32 | [diff] [blame^] | 7 | #include "base/message_loop/message_pump_type.h" |
Carlos Caballero | a1f7a0d | 2019-06-12 08:20:34 | [diff] [blame] | 8 | #include "base/task/single_thread_task_executor.h" |
Corentin Wallez | 0b71452b | 2018-10-30 17:35:00 | [diff] [blame] | 9 | #include "base/test/launcher/unit_test_launcher.h" |
| 10 | #include "base/test/test_suite.h" |
| 11 | #include "testing/gmock/include/gmock/gmock.h" |
| 12 | |
| 13 | namespace { |
| 14 | |
| 15 | int RunHelper(base::TestSuite* test_suite) { |
Chris Sharp | 7840c58 | 2019-08-02 15:45:32 | [diff] [blame^] | 16 | base::SingleThreadTaskExecutor io_task_executor(base::MessagePumpType::IO); |
Corentin Wallez | 0b71452b | 2018-10-30 17:35:00 | [diff] [blame] | 17 | return test_suite->Run(); |
| 18 | } |
| 19 | |
| 20 | } // namespace |
| 21 | |
| 22 | int main(int argc, char** argv) { |
| 23 | base::CommandLine::Init(argc, argv); |
| 24 | testing::InitGoogleMock(&argc, argv); |
| 25 | base::TestSuite test_suite(argc, argv); |
| 26 | int rt = base::LaunchUnitTestsSerially( |
| 27 | argc, argv, base::BindOnce(&RunHelper, base::Unretained(&test_suite))); |
| 28 | return rt; |
| 29 | } |