[go: nahoru, domu]

blob: 3da8b89a3932811195af5116be7989709e73fa0e [file] [log] [blame]
Avi Drissman05dfbc822022-09-13 21:25:341// Copyright 2018 The Chromium Authors
Corentin Wallez0b71452b2018-10-30 17:35:002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Corentin Wallez0b71452b2018-10-30 17:35:005#include "base/command_line.h"
Avi Drissman93a273d2023-01-11 00:38:276#include "base/functional/bind.h"
Chris Sharp7840c582019-08-02 15:45:327#include "base/message_loop/message_pump_type.h"
Carlos Caballeroa1f7a0d2019-06-12 08:20:348#include "base/task/single_thread_task_executor.h"
Corentin Wallez0b71452b2018-10-30 17:35:009#include "base/test/launcher/unit_test_launcher.h"
10#include "base/test/test_suite.h"
11#include "testing/gmock/include/gmock/gmock.h"
12
13namespace {
14
15int RunHelper(base::TestSuite* test_suite) {
Chris Sharp7840c582019-08-02 15:45:3216 base::SingleThreadTaskExecutor io_task_executor(base::MessagePumpType::IO);
Corentin Wallez0b71452b2018-10-30 17:35:0017 return test_suite->Run();
18}
19
20} // namespace
21
Austin Eng24219132021-02-01 17:04:3522// Definition located in third_party/dawn/src/tests/unittests/validation/ValidationTest.h
23// Forward declared here to avoid pulling in the Dawn headers.
24void InitDawnValidationTestEnvironment(int argc, char** argv);
25
Corentin Wallez0b71452b2018-10-30 17:35:0026int main(int argc, char** argv) {
27 base::CommandLine::Init(argc, argv);
Austin Eng24219132021-02-01 17:04:3528 InitDawnValidationTestEnvironment(argc, argv);
Corentin Wallez0b71452b2018-10-30 17:35:0029 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}