Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(348)

Side by Side Diff: mojo/edk/embedder/embedder_unittest.cc

Issue 1462083003: Add //mojo/edk/platform and move platform_task_runners.h there. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: update readme Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698