blob: 0df218c0f2dd8196c338363699b00365f811b0e9 [file] [log] [blame]
Corentin Wallez0b71452b2018-10-30 17:35:001// 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 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
22int 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}