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 #include "mojo/edk/embedder/embedder.h" | 5 #include "mojo/edk/embedder/embedder.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "mojo/edk/util/mutex.h" | 22 #include "mojo/edk/util/mutex.h" |
23 #include "mojo/edk/util/ref_ptr.h" | 23 #include "mojo/edk/util/ref_ptr.h" |
24 #include "mojo/edk/util/thread_annotations.h" | 24 #include "mojo/edk/util/thread_annotations.h" |
25 #include "mojo/edk/util/waitable_event.h" | 25 #include "mojo/edk/util/waitable_event.h" |
26 #include "mojo/public/c/system/core.h" | 26 #include "mojo/public/c/system/core.h" |
27 #include "mojo/public/cpp/system/handle.h" | 27 #include "mojo/public/cpp/system/handle.h" |
28 #include "mojo/public/cpp/system/macros.h" | 28 #include "mojo/public/cpp/system/macros.h" |
29 #include "mojo/public/cpp/system/message_pipe.h" | 29 #include "mojo/public/cpp/system/message_pipe.h" |
30 #include "testing/gtest/include/gtest/gtest.h" | 30 #include "testing/gtest/include/gtest/gtest.h" |
31 | 31 |
| 32 using mojo::platform::TaskRunner; |
32 using mojo::system::test::TestIOThread; | 33 using mojo::system::test::TestIOThread; |
33 using mojo::util::ManualResetWaitableEvent; | 34 using mojo::util::ManualResetWaitableEvent; |
34 using mojo::util::Mutex; | 35 using mojo::util::Mutex; |
35 using mojo::util::MutexLocker; | 36 using mojo::util::MutexLocker; |
36 using mojo::util::RefPtr; | 37 using mojo::util::RefPtr; |
37 | 38 |
38 namespace mojo { | 39 namespace mojo { |
39 namespace embedder { | 40 namespace embedder { |
40 namespace { | 41 namespace { |
41 | 42 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 MOJO_DISALLOW_COPY_AND_ASSIGN(ScopedTestChannel); | 133 MOJO_DISALLOW_COPY_AND_ASSIGN(ScopedTestChannel); |
133 }; | 134 }; |
134 | 135 |
135 class EmbedderTest : public testing::Test { | 136 class EmbedderTest : public testing::Test { |
136 public: | 137 public: |
137 EmbedderTest() : test_io_thread_(TestIOThread::StartMode::AUTO) {} | 138 EmbedderTest() : test_io_thread_(TestIOThread::StartMode::AUTO) {} |
138 ~EmbedderTest() override {} | 139 ~EmbedderTest() override {} |
139 | 140 |
140 protected: | 141 protected: |
141 TestIOThread& test_io_thread() { return test_io_thread_; } | 142 TestIOThread& test_io_thread() { return test_io_thread_; } |
142 const RefPtr<PlatformTaskRunner>& test_io_task_runner() { | 143 const RefPtr<TaskRunner>& test_io_task_runner() { |
143 return test_io_thread_.task_runner(); | 144 return test_io_thread_.task_runner(); |
144 } | 145 } |
145 | 146 |
146 private: | 147 private: |
147 void SetUp() override { test::InitWithSimplePlatformSupport(); } | 148 void SetUp() override { test::InitWithSimplePlatformSupport(); } |
148 | 149 |
149 void TearDown() override { EXPECT_TRUE(test::Shutdown()); } | 150 void TearDown() override { EXPECT_TRUE(test::Shutdown()); } |
150 | 151 |
151 TestIOThread test_io_thread_; | 152 TestIOThread test_io_thread_; |
152 | 153 |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 | 786 |
786 EXPECT_TRUE(test::Shutdown()); | 787 EXPECT_TRUE(test::Shutdown()); |
787 } | 788 } |
788 | 789 |
789 // TODO(vtl): Test immediate write & close. | 790 // TODO(vtl): Test immediate write & close. |
790 // TODO(vtl): Test broken-connection cases. | 791 // TODO(vtl): Test broken-connection cases. |
791 | 792 |
792 } // namespace | 793 } // namespace |
793 } // namespace embedder | 794 } // namespace embedder |
794 } // namespace mojo | 795 } // namespace mojo |
OLD | NEW |