| 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. | 20 // Access the shell handle shared by multiple test application instances. |
| 21 ScopedMessagePipeHandle PassShellHandle(); | 21 ScopedMessagePipeHandle PassShellHandle(); |
| 22 void SetShellHandle(ScopedMessagePipeHandle handle); | 22 void SetShellHandle(ScopedMessagePipeHandle handle); |
| 23 | 23 |
| 24 const Array<String>& Args(); |
| 25 void InitializeArgs(int argc, std::vector<const char*> argv); |
| 26 |
| 24 // A GTEST base class for application testing executed in mojo_shell. | 27 // A GTEST base class for application testing executed in mojo_shell. |
| 25 class ApplicationTestBase : public testing::Test { | 28 class ApplicationTestBase : public testing::Test { |
| 26 public: | 29 public: |
| 27 explicit ApplicationTestBase(Array<String> args); | 30 explicit ApplicationTestBase(Array<String> args); |
| 28 ~ApplicationTestBase() override; | 31 ~ApplicationTestBase() override; |
| 29 | 32 |
| 30 protected: | 33 protected: |
| 31 ApplicationImpl* application_impl() { return application_impl_; } | 34 ApplicationImpl* application_impl() { return application_impl_; } |
| 32 | 35 |
| 33 // Get the ApplicationDelegate for the application to be tested. | 36 // Get the ApplicationDelegate for the application to be tested. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 45 ApplicationImpl* application_impl_; | 48 ApplicationImpl* application_impl_; |
| 46 | 49 |
| 47 MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationTestBase); | 50 MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationTestBase); |
| 48 }; | 51 }; |
| 49 | 52 |
| 50 } // namespace test | 53 } // namespace test |
| 51 | 54 |
| 52 } // namespace mojo | 55 } // namespace mojo |
| 53 | 56 |
| 54 #endif // MOJO_PUBLIC_CPP_APPLICATION_APPLICATION_TEST_BASE_H_ | 57 #endif // MOJO_PUBLIC_CPP_APPLICATION_APPLICATION_TEST_BASE_H_ |
| OLD | NEW |