Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Side by Side Diff: mojo/edk/system/run_all_unittests.cc

Issue 1511783002: Mojo JS bindings: fix the unittests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/edk/system/BUILD.gn ('k') | mojo/edk/test/run_all_unittests.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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"
7 #include "base/test/launcher/unit_test_launcher.h"
8 #include "base/test/test_io_thread.h"
9 #include "base/test/test_suite.h"
10 #include "mojo/edk/embedder/embedder.h"
11 #include "mojo/edk/test/multiprocess_test_helper.h"
12 #include "mojo/edk/test/scoped_ipc_support.h"
13 #include "testing/gtest/include/gtest/gtest.h"
14
15 int main(int argc, char** argv) {
16 // Silence death test thread warnings on Linux. We can afford to run our death
17 // tests a little more slowly (< 10 ms per death test on a Z620).
18 // On android, we need to run in the default mode, as the threadsafe mode
19 // relies on execve which is not available.
20 #if !defined(OS_ANDROID)
21 testing::GTEST_FLAG(death_test_style) = "threadsafe";
22 #endif
23 base::TestSuite test_suite(argc, argv);
24
25 // Must be run before mojo::edk::Init.
26 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
27 mojo::edk::test::kBrokerHandleSwitch)) {
28 mojo::edk::PreInitializeChildProcess();
29 }
30
31 // TODO(use_chrome_edk): temporary to force new EDK.
32 base::CommandLine::ForCurrentProcess()->AppendSwitch("--use-new-edk");
33
34 mojo::edk::Init();
35
36 base::TestIOThread test_io_thread(base::TestIOThread::kAutoStart);
37 // Leak this because its destructor calls mojo::edk::ShutdownIPCSupport which
38 // really does nothing in the new EDK but does depend on the current message
39 // loop, which is destructed inside base::LaunchUnitTests.
40 new mojo::edk::test::ScopedIPCSupport(test_io_thread.task_runner());
41
42 return base::LaunchUnitTests(
43 argc, argv,
44 base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite)));
45 }
OLDNEW
« no previous file with comments | « mojo/edk/system/BUILD.gn ('k') | mojo/edk/test/run_all_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698