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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "extensions/browser/mojo/stash_backend.h" | 8 #include "extensions/browser/mojo/stash_backend.h" |
| 9 #include "mojo/application/public/interfaces/service_provider.mojom.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "third_party/mojo/src/mojo/public/interfaces/application/service_provid
er.mojom.h" | |
11 | 11 |
12 namespace extensions { | 12 namespace extensions { |
13 namespace { | 13 namespace { |
14 | 14 |
15 // Create a data pipe, write some data to the producer handle and return the | 15 // Create a data pipe, write some data to the producer handle and return the |
16 // consumer handle. | 16 // consumer handle. |
17 mojo::ScopedHandle CreateReadableHandle() { | 17 mojo::ScopedHandle CreateReadableHandle() { |
18 mojo::ScopedDataPipeConsumerHandle consumer_handle; | 18 mojo::ScopedDataPipeConsumerHandle consumer_handle; |
19 mojo::ScopedDataPipeProducerHandle producer_handle; | 19 mojo::ScopedDataPipeProducerHandle producer_handle; |
20 MojoCreateDataPipeOptions options = { | 20 MojoCreateDataPipeOptions options = { |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 ASSERT_EQ(0u, stashed_objects.size()); | 286 ASSERT_EQ(0u, stashed_objects.size()); |
287 // Check that the stashed handle has been closed. | 287 // Check that the stashed handle has been closed. |
288 MojoResult result = | 288 MojoResult result = |
289 mojo::Wait(message_pipe.handle1.get(), | 289 mojo::Wait(message_pipe.handle1.get(), |
290 MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_READABLE, | 290 MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_READABLE, |
291 MOJO_DEADLINE_INDEFINITE, nullptr); | 291 MOJO_DEADLINE_INDEFINITE, nullptr); |
292 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION, result); | 292 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION, result); |
293 } | 293 } |
294 | 294 |
295 } // namespace extensions | 295 } // namespace extensions |
OLD | NEW |