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 "ipc/mojo/ipc_mojo_bootstrap.h" | 5 #include "ipc/mojo/ipc_mojo_bootstrap.h" |
6 | 6 |
7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/files/file.h" | 8 #include "base/files/file.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "ipc/ipc_test_base.h" | 10 #include "ipc/ipc_test_base.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 bool passed() const { return passed_; } | 30 bool passed() const { return passed_; } |
31 | 31 |
32 private: | 32 private: |
33 bool passed_; | 33 bool passed_; |
34 }; | 34 }; |
35 | 35 |
36 void TestingDelegate::OnPipeAvailable( | 36 void TestingDelegate::OnPipeAvailable( |
37 mojo::embedder::ScopedPlatformHandle handle, | 37 mojo::embedder::ScopedPlatformHandle handle, |
38 int32 peer_pid) { | 38 int32 peer_pid) { |
39 passed_ = true; | 39 passed_ = true; |
40 base::MessageLoop::current()->Quit(); | 40 base::MessageLoop::current()->QuitWhenIdle(); |
41 } | 41 } |
42 | 42 |
43 void TestingDelegate::OnBootstrapError() { | 43 void TestingDelegate::OnBootstrapError() { |
44 base::MessageLoop::current()->Quit(); | 44 base::MessageLoop::current()->QuitWhenIdle(); |
45 } | 45 } |
46 | 46 |
47 // Times out on Android; see http://crbug.com/502290 | 47 // Times out on Android; see http://crbug.com/502290 |
48 #if defined(OS_ANDROID) | 48 #if defined(OS_ANDROID) |
49 #define MAYBE_Connect DISABLED_Connect | 49 #define MAYBE_Connect DISABLED_Connect |
50 #else | 50 #else |
51 #define MAYBE_Connect Connect | 51 #define MAYBE_Connect Connect |
52 #endif | 52 #endif |
53 TEST_F(IPCMojoBootstrapTest, MAYBE_Connect) { | 53 TEST_F(IPCMojoBootstrapTest, MAYBE_Connect) { |
54 Init("IPCMojoBootstrapTestClient"); | 54 Init("IPCMojoBootstrapTestClient"); |
(...skipping 27 matching lines...) Expand all Loading... |
82 bootstrap->Connect(); | 82 bootstrap->Connect(); |
83 | 83 |
84 base::MessageLoop::current()->Run(); | 84 base::MessageLoop::current()->Run(); |
85 | 85 |
86 EXPECT_TRUE(delegate.passed()); | 86 EXPECT_TRUE(delegate.passed()); |
87 | 87 |
88 return 0; | 88 return 0; |
89 } | 89 } |
90 | 90 |
91 } // namespace | 91 } // namespace |
OLD | NEW |