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

Side by Side Diff: mojo/edk/system/message_pipe_test_utils.cc

Issue 1427633003: Move scoped_test_dir.* and test_io_thread.* from edk/test to edk/system/test. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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/system/message_pipe_test_utils.h" 5 #include "mojo/edk/system/message_pipe_test_utils.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "mojo/edk/system/channel.h" 10 #include "mojo/edk/system/channel.h"
(...skipping 20 matching lines...) Expand all
31 : add_result; 31 : add_result;
32 } 32 }
33 33
34 MojoResult wait_result = waiter.Wait(MOJO_DEADLINE_INDEFINITE, nullptr); 34 MojoResult wait_result = waiter.Wait(MOJO_DEADLINE_INDEFINITE, nullptr);
35 mp->RemoveAwakable(0, &waiter, signals_state); 35 mp->RemoveAwakable(0, &waiter, signals_state);
36 return wait_result; 36 return wait_result;
37 } 37 }
38 38
39 ChannelThread::ChannelThread(embedder::PlatformSupport* platform_support) 39 ChannelThread::ChannelThread(embedder::PlatformSupport* platform_support)
40 : platform_support_(platform_support), 40 : platform_support_(platform_support),
41 test_io_thread_(mojo::test::TestIOThread::StartMode::MANUAL) {} 41 test_io_thread_(TestIOThread::StartMode::MANUAL) {}
42 42
43 ChannelThread::~ChannelThread() { 43 ChannelThread::~ChannelThread() {
44 Stop(); 44 Stop();
45 } 45 }
46 46
47 void ChannelThread::Start(embedder::ScopedPlatformHandle platform_handle, 47 void ChannelThread::Start(embedder::ScopedPlatformHandle platform_handle,
48 RefPtr<ChannelEndpoint>&& channel_endpoint) { 48 RefPtr<ChannelEndpoint>&& channel_endpoint) {
49 test_io_thread_.Start(); 49 test_io_thread_.Start();
50 test_io_thread_.PostTaskAndWait( 50 test_io_thread_.PostTaskAndWait(
51 base::Bind(&ChannelThread::InitChannelOnIOThread, base::Unretained(this), 51 base::Bind(&ChannelThread::InitChannelOnIOThread, base::Unretained(this),
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 } 101 }
102 102
103 void MultiprocessMessagePipeTestBase::Init(RefPtr<ChannelEndpoint>&& ep) { 103 void MultiprocessMessagePipeTestBase::Init(RefPtr<ChannelEndpoint>&& ep) {
104 channel_thread_.Start(helper_.server_platform_handle.Pass(), std::move(ep)); 104 channel_thread_.Start(helper_.server_platform_handle.Pass(), std::move(ep));
105 } 105 }
106 #endif 106 #endif
107 107
108 } // namespace test 108 } // namespace test
109 } // namespace system 109 } // namespace system
110 } // namespace mojo 110 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/message_pipe_test_utils.h ('k') | mojo/edk/system/multiprocess_message_pipe_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698