OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 #ifndef CHROME_TEST_BASE_MOJO_TEST_CONNECTOR_H_ |
| 6 #define CHROME_TEST_BASE_MOJO_TEST_CONNECTOR_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/process/process_handle.h" |
| 11 #include "base/test/launcher/test_launcher.h" |
| 12 #include "mojo/shell/background/background_shell.h" |
| 13 #include "mojo/shell/public/interfaces/shell_client.mojom.h" |
| 14 |
| 15 namespace base { |
| 16 class CommandLine; |
| 17 } |
| 18 |
| 19 namespace content { |
| 20 class TestState; |
| 21 } |
| 22 |
| 23 namespace mojo { |
| 24 class ShellClient; |
| 25 class ShellConnection; |
| 26 } |
| 27 |
| 28 // MojoTestConnector in responsible for providing the necessary wiring for |
| 29 // test processes to get a mojo channel passed to them. To use this class |
| 30 // call PrepareForTest() prior to launching each test. It is expected |
| 31 // PrepareForTest() is called from content::TestLauncherDelegate::PreRunTest(). |
| 32 class MojoTestConnector { |
| 33 public: |
| 34 // Switch added to command line of each test. |
| 35 static const char kTestSwitch[]; |
| 36 |
| 37 MojoTestConnector(); |
| 38 ~MojoTestConnector(); |
| 39 |
| 40 // Initializes the background thread the Shell runs on. |
| 41 mojo::shell::mojom::ShellClientRequest Init(); |
| 42 |
| 43 scoped_ptr<content::TestState> PrepareForTest( |
| 44 base::CommandLine* command_line, |
| 45 base::TestLauncher::LaunchOptions* test_launch_options); |
| 46 |
| 47 private: |
| 48 mojo::shell::BackgroundShell background_shell_; |
| 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(MojoTestConnector); |
| 51 }; |
| 52 |
| 53 #endif // CHROME_TEST_BASE_MOJO_TEST_CONNECTOR_H_ |
OLD | NEW |