OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MOJO_PUBLIC_CPP_APPLICATION_APPLICATION_TEST_BASE_H_ | 5 #ifndef MOJO_PUBLIC_CPP_APPLICATION_APPLICATION_TEST_BASE_H_ |
6 #define MOJO_PUBLIC_CPP_APPLICATION_APPLICATION_TEST_BASE_H_ | 6 #define MOJO_PUBLIC_CPP_APPLICATION_APPLICATION_TEST_BASE_H_ |
7 | 7 |
8 #include "mojo/public/cpp/bindings/array.h" | 8 #include "mojo/public/cpp/bindings/array.h" |
9 #include "mojo/public/cpp/bindings/string.h" | 9 #include "mojo/public/cpp/bindings/string.h" |
10 #include "mojo/public/cpp/system/macros.h" | 10 #include "mojo/public/cpp/system/macros.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 namespace mojo { | 13 namespace mojo { |
14 | 14 |
15 class ApplicationDelegate; | 15 class ApplicationDelegate; |
16 class ApplicationImpl; | 16 class ApplicationImpl; |
17 | 17 |
18 namespace test { | 18 namespace test { |
19 | 19 |
| 20 // Access the shell handle shared by multiple test application instances. |
| 21 ScopedMessagePipeHandle PassShellHandle(); |
| 22 void SetShellHandle(ScopedMessagePipeHandle handle); |
| 23 |
20 // A GTEST base class for application testing executed in mojo_shell. | 24 // A GTEST base class for application testing executed in mojo_shell. |
21 class ApplicationTestBase : public testing::Test { | 25 class ApplicationTestBase : public testing::Test { |
22 public: | 26 public: |
23 explicit ApplicationTestBase(Array<String> args); | 27 explicit ApplicationTestBase(Array<String> args); |
24 ~ApplicationTestBase() override; | 28 ~ApplicationTestBase() override; |
25 | 29 |
26 protected: | 30 protected: |
27 ApplicationImpl* application_impl() { return application_impl_; } | 31 ApplicationImpl* application_impl() { return application_impl_; } |
28 | 32 |
29 // Get the ApplicationDelegate for the application to be tested. | 33 // Get the ApplicationDelegate for the application to be tested. |
(...skipping 11 matching lines...) Expand all Loading... |
41 ApplicationImpl* application_impl_; | 45 ApplicationImpl* application_impl_; |
42 | 46 |
43 MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationTestBase); | 47 MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationTestBase); |
44 }; | 48 }; |
45 | 49 |
46 } // namespace test | 50 } // namespace test |
47 | 51 |
48 } // namespace mojo | 52 } // namespace mojo |
49 | 53 |
50 #endif // MOJO_PUBLIC_CPP_APPLICATION_APPLICATION_TEST_BASE_H_ | 54 #endif // MOJO_PUBLIC_CPP_APPLICATION_APPLICATION_TEST_BASE_H_ |
OLD | NEW |