Avi Drissman | 05dfbc82 | 2022-09-13 21:25:34 | [diff] [blame] | 1 | // Copyright 2018 The Chromium Authors |
Corentin Wallez | 0b71452b | 2018-10-30 17:35:00 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
Corentin Wallez | 0b71452b | 2018-10-30 17:35:00 | [diff] [blame] | 5 | #include "base/command_line.h" |
Avi Drissman | 93a273d | 2023-01-11 00:38:27 | [diff] [blame] | 6 | #include "base/functional/bind.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 | |
Austin Eng | 2421913 | 2021-02-01 17:04:35 | [diff] [blame] | 22 | // Definition located in third_party/dawn/src/tests/unittests/validation/ValidationTest.h |
| 23 | // Forward declared here to avoid pulling in the Dawn headers. |
| 24 | void InitDawnValidationTestEnvironment(int argc, char** argv); |
| 25 | |
Corentin Wallez | 0b71452b | 2018-10-30 17:35:00 | [diff] [blame] | 26 | int main(int argc, char** argv) { |
| 27 | base::CommandLine::Init(argc, argv); |
Austin Eng | 2421913 | 2021-02-01 17:04:35 | [diff] [blame] | 28 | InitDawnValidationTestEnvironment(argc, argv); |
Corentin Wallez | 0b71452b | 2018-10-30 17:35:00 | [diff] [blame] | 29 | testing::InitGoogleMock(&argc, argv); |
| 30 | base::TestSuite test_suite(argc, argv); |
| 31 | int rt = base::LaunchUnitTestsSerially( |
| 32 | argc, argv, base::BindOnce(&RunHelper, base::Unretained(&test_suite))); |
| 33 | return rt; |
| 34 | } |