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

Side by Side Diff: extensions/browser/mojo/stash_backend_unittest.cc

Issue 1139123006: Fork the mojo shell interfaces used by Mandoline. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 5 years, 7 months 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 "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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698