| 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_SHELL_SHELL_TEST_HELPER_ | 5 #ifndef MOJO_SHELL_SHELL_TEST_HELPER_ |
| 6 #define MOJO_SHELL_SHELL_TEST_HELPER_ | 6 #define MOJO_SHELL_SHELL_TEST_HELPER_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| 11 #include "mojo/public/cpp/environment/environment.h" | |
| 12 #include "mojo/public/interfaces/service_provider/service_provider.mojom.h" | 11 #include "mojo/public/interfaces/service_provider/service_provider.mojom.h" |
| 13 #include "mojo/service_manager/service_loader.h" | 12 #include "mojo/service_manager/service_loader.h" |
| 14 #include "mojo/shell/context.h" | 13 #include "mojo/shell/context.h" |
| 15 | 14 |
| 16 class GURL; | 15 class GURL; |
| 17 | 16 |
| 18 namespace mojo { | 17 namespace mojo { |
| 19 | 18 |
| 20 class ServiceLoader; | 19 class ServiceLoader; |
| 21 | 20 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 35 // ServiceProvider. | 34 // ServiceProvider. |
| 36 ServiceProvider* service_provider() { return service_provider_.get(); } | 35 ServiceProvider* service_provider() { return service_provider_.get(); } |
| 37 | 36 |
| 38 // Sets a ServiceLoader for the specified URL. |loader| is ultimately used on | 37 // Sets a ServiceLoader for the specified URL. |loader| is ultimately used on |
| 39 // the thread this class spawns. | 38 // the thread this class spawns. |
| 40 void SetLoaderForURL(scoped_ptr<ServiceLoader> loader, const GURL& url); | 39 void SetLoaderForURL(scoped_ptr<ServiceLoader> loader, const GURL& url); |
| 41 | 40 |
| 42 private: | 41 private: |
| 43 class TestServiceProvider; | 42 class TestServiceProvider; |
| 44 | 43 |
| 45 Environment environment_; | |
| 46 | |
| 47 scoped_ptr<Context> context_; | 44 scoped_ptr<Context> context_; |
| 48 | 45 |
| 49 scoped_ptr<ServiceManager::TestAPI> test_api_; | 46 scoped_ptr<ServiceManager::TestAPI> test_api_; |
| 50 | 47 |
| 51 // ScopedMessagePipeHandle service_provider_handle_; | 48 // ScopedMessagePipeHandle service_provider_handle_; |
| 52 | 49 |
| 53 // Client interface for the shell. | 50 // Client interface for the shell. |
| 54 scoped_ptr<TestServiceProvider> local_service_provider_; | 51 scoped_ptr<TestServiceProvider> local_service_provider_; |
| 55 | 52 |
| 56 ServiceProviderPtr service_provider_; | 53 ServiceProviderPtr service_provider_; |
| 57 | 54 |
| 58 DISALLOW_COPY_AND_ASSIGN(ShellTestHelper); | 55 DISALLOW_COPY_AND_ASSIGN(ShellTestHelper); |
| 59 }; | 56 }; |
| 60 | 57 |
| 61 } // namespace shell | 58 } // namespace shell |
| 62 } // namespace mojo | 59 } // namespace mojo |
| 63 | 60 |
| 64 #endif // MOJO_SHELL_SHELL_TEST_HELPER_ | 61 #endif // MOJO_SHELL_SHELL_TEST_HELPER_ |
| OLD | NEW |