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_BASE_H_ | 5 #ifndef MOJO_SHELL_SHELL_TEST_BASE_H_ |
6 #define MOJO_SHELL_SHELL_TEST_BASE_H_ | 6 #define MOJO_SHELL_SHELL_TEST_BASE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "mojo/public/cpp/system/core.h" | 12 #include "mojo/public/cpp/system/core.h" |
13 #include "mojo/shell/context.h" | 13 #include "mojo/shell/context.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
16 class GURL; | 16 class GURL; |
17 | 17 |
18 namespace net { | |
19 namespace test_server { | |
20 class EmbeddedTestServer; | |
21 } | |
22 } // namespace net | |
23 | |
24 namespace mojo { | 18 namespace mojo { |
25 namespace shell { | 19 namespace shell { |
26 namespace test { | 20 namespace test { |
27 | 21 |
28 class ShellTestBase : public testing::Test { | 22 class ShellTestBase : public testing::Test { |
29 public: | 23 public: |
30 ShellTestBase(); | 24 ShellTestBase(); |
31 virtual ~ShellTestBase(); | 25 virtual ~ShellTestBase(); |
32 | 26 |
33 virtual void SetUp() override; | 27 virtual void SetUp() override; |
(...skipping 19 matching lines...) Expand all Loading... |
53 void ConnectToServiceViaNetwork(const GURL& application_url, | 47 void ConnectToServiceViaNetwork(const GURL& application_url, |
54 InterfacePtr<Interface>* ptr) { | 48 InterfacePtr<Interface>* ptr) { |
55 ptr->Bind( | 49 ptr->Bind( |
56 ConnectToServiceViaNetwork(application_url, Interface::Name_).Pass()); | 50 ConnectToServiceViaNetwork(application_url, Interface::Name_).Pass()); |
57 } | 51 } |
58 | 52 |
59 base::MessageLoop* message_loop() { return &message_loop_; } | 53 base::MessageLoop* message_loop() { return &message_loop_; } |
60 Context* shell_context() { return &shell_context_; } | 54 Context* shell_context() { return &shell_context_; } |
61 | 55 |
62 private: | 56 private: |
63 scoped_ptr<net::test_server::EmbeddedTestServer> test_server_; | |
64 Context shell_context_; | 57 Context shell_context_; |
65 base::MessageLoop message_loop_; | 58 base::MessageLoop message_loop_; |
66 | 59 |
67 DISALLOW_COPY_AND_ASSIGN(ShellTestBase); | 60 DISALLOW_COPY_AND_ASSIGN(ShellTestBase); |
68 }; | 61 }; |
69 | 62 |
70 } // namespace test | 63 } // namespace test |
71 } // namespace shell | 64 } // namespace shell |
72 } // namespace mojo | 65 } // namespace mojo |
73 | 66 |
74 #endif // MOJO_SHELL_SHELL_TEST_BASE_H_ | 67 #endif // MOJO_SHELL_SHELL_TEST_BASE_H_ |
OLD | NEW |