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

Side by Side Diff: mojo/shell/runner/child/native_apptest.cc

Issue 1725353003: Eliminate mojo::Shell client lib class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@15connector
Patch Set: . Created 4 years, 10 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/macros.h" 6 #include "base/macros.h"
7 #include "mojo/shell/public/cpp/application_test_base.h" 7 #include "mojo/shell/public/cpp/application_test_base.h"
8 #include "mojo/shell/runner/child/test_native_service.mojom.h" 8 #include "mojo/shell/runner/child/test_native_service.mojom.h"
9 9
10 namespace mojo { 10 namespace mojo {
11 namespace shell { 11 namespace shell {
12 namespace { 12 namespace {
13 void InvertCallback(bool* result, bool from_native) { 13 void InvertCallback(bool* result, bool from_native) {
14 *result = from_native; 14 *result = from_native;
15 } 15 }
16 } // namespace 16 } // namespace
17 17
18 using NativeAppTest = mojo::test::ApplicationTestBase; 18 using NativeAppTest = mojo::test::ApplicationTestBase;
19 19
20 TEST_F(NativeAppTest, Connect) { 20 TEST_F(NativeAppTest, Connect) {
21 test::TestNativeServicePtr native_service; 21 test::TestNativeServicePtr native_service;
22 shell()->ConnectToInterface("exe:mojo_runner_child_apptest_native_target", 22 connector()->ConnectToInterface("exe:mojo_runner_child_apptest_native_target",
23 &native_service); 23 &native_service);
24 24
25 bool result = false; 25 bool result = false;
26 native_service->Invert( 26 native_service->Invert(
27 true, base::Bind(&InvertCallback, base::Unretained(&result))); 27 true, base::Bind(&InvertCallback, base::Unretained(&result)));
28 native_service.WaitForIncomingResponse(); 28 native_service.WaitForIncomingResponse();
29 EXPECT_FALSE(result); 29 EXPECT_FALSE(result);
30 30
31 native_service->Invert( 31 native_service->Invert(
32 false, base::Bind(&InvertCallback, base::Unretained(&result))); 32 false, base::Bind(&InvertCallback, base::Unretained(&result)));
33 native_service.WaitForIncomingResponse(); 33 native_service.WaitForIncomingResponse();
34 EXPECT_TRUE(result); 34 EXPECT_TRUE(result);
35 } 35 }
36 36
37 } // namespace shell 37 } // namespace shell
38 } // namespace mojo 38 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/shell/public/cpp/shell_connection.h ('k') | mojo/shell/runner/child/native_apptest_target.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698