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

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

Issue 1687693002: Rename ConnectToService to ConnectToInterface() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sp2
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
« no previous file with comments | « mojo/shell/public/cpp/shell.h ('k') | mojo/shell/standalone/shell_apptest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/converters/network/network_type_converters.h" 7 #include "mojo/converters/network/network_type_converters.h"
8 #include "mojo/shell/public/cpp/application_test_base.h" 8 #include "mojo/shell/public/cpp/application_test_base.h"
9 #include "mojo/shell/runner/child/test_native_service.mojom.h" 9 #include "mojo/shell/runner/child/test_native_service.mojom.h"
10 10
11 namespace mojo { 11 namespace mojo {
12 namespace shell { 12 namespace shell {
13 namespace { 13 namespace {
14 void InvertCallback(bool* result, bool from_native) { 14 void InvertCallback(bool* result, bool from_native) {
15 *result = from_native; 15 *result = from_native;
16 } 16 }
17 } // namespace 17 } // namespace
18 18
19 using NativeAppTest = mojo::test::ApplicationTestBase; 19 using NativeAppTest = mojo::test::ApplicationTestBase;
20 20
21 TEST_F(NativeAppTest, Connect) { 21 TEST_F(NativeAppTest, Connect) {
22 test::TestNativeServicePtr native_service; 22 test::TestNativeServicePtr native_service;
23 shell()->ConnectToService("exe:mojo_runner_child_apptest_native_target", 23 shell()->ConnectToInterface("exe:mojo_runner_child_apptest_native_target",
24 &native_service); 24 &native_service);
25 25
26 bool result = false; 26 bool result = false;
27 native_service->Invert( 27 native_service->Invert(
28 true, base::Bind(&InvertCallback, base::Unretained(&result))); 28 true, base::Bind(&InvertCallback, base::Unretained(&result)));
29 native_service.WaitForIncomingResponse(); 29 native_service.WaitForIncomingResponse();
30 EXPECT_FALSE(result); 30 EXPECT_FALSE(result);
31 31
32 native_service->Invert( 32 native_service->Invert(
33 false, base::Bind(&InvertCallback, base::Unretained(&result))); 33 false, base::Bind(&InvertCallback, base::Unretained(&result)));
34 native_service.WaitForIncomingResponse(); 34 native_service.WaitForIncomingResponse();
35 EXPECT_TRUE(result); 35 EXPECT_TRUE(result);
36 } 36 }
37 37
38 } // namespace shell 38 } // namespace shell
39 } // namespace mojo 39 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/shell/public/cpp/shell.h ('k') | mojo/shell/standalone/shell_apptest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698