| 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/application/application_delegate.h" | 8 #include "mojo/public/cpp/application/application_delegate.h" |
| 9 #include "mojo/public/cpp/bindings/array.h" | 9 #include "mojo/public/cpp/bindings/array.h" |
| 10 #include "mojo/public/cpp/bindings/string.h" | 10 #include "mojo/public/cpp/bindings/string.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 virtual ApplicationDelegate* GetApplicationDelegate(); | 38 virtual ApplicationDelegate* GetApplicationDelegate(); |
| 39 | 39 |
| 40 // A testing::Test::SetUp helper to override the application command | 40 // A testing::Test::SetUp helper to override the application command |
| 41 // line arguments. | 41 // line arguments. |
| 42 void SetUpWithArgs(const Array<String>& args); | 42 void SetUpWithArgs(const Array<String>& args); |
| 43 | 43 |
| 44 // testing::Test: | 44 // testing::Test: |
| 45 void SetUp() override; | 45 void SetUp() override; |
| 46 void TearDown() override; | 46 void TearDown() override; |
| 47 | 47 |
| 48 // True by default, which indicates a MessageLoop will automatically be |
| 49 // created for the application. Tests may override this function to prevent |
| 50 // a default loop from being created. |
| 51 virtual bool ShouldCreateDefaultRunLoop(); |
| 52 |
| 48 private: | 53 private: |
| 49 // The application implementation instance, reconstructed for each test. | 54 // The application implementation instance, reconstructed for each test. |
| 50 ApplicationImpl* application_impl_; | 55 ApplicationImpl* application_impl_; |
| 51 // The application delegate used if GetApplicationDelegate is not overridden. | 56 // The application delegate used if GetApplicationDelegate is not overridden. |
| 52 ApplicationDelegate default_application_delegate_; | 57 ApplicationDelegate default_application_delegate_; |
| 53 | 58 |
| 54 MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationTestBase); | 59 MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationTestBase); |
| 55 }; | 60 }; |
| 56 | 61 |
| 57 } // namespace test | 62 } // namespace test |
| 58 | 63 |
| 59 } // namespace mojo | 64 } // namespace mojo |
| 60 | 65 |
| 61 #endif // MOJO_PUBLIC_CPP_APPLICATION_APPLICATION_TEST_BASE_H_ | 66 #endif // MOJO_PUBLIC_CPP_APPLICATION_APPLICATION_TEST_BASE_H_ |
| OLD | NEW |