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

Side by Side Diff: shell/shell_test_base.h

Issue 1660403003: Mojo C++ bindings: Rename InterfaceInfoPtr -> InterfaceHandle (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: using {{InterfaceName}}Handle = InterfaceHandle<{{InterfaceName}}> 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 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 #ifndef SHELL_SHELL_TEST_BASE_H_ 5 #ifndef SHELL_SHELL_TEST_BASE_H_
6 #define SHELL_SHELL_TEST_BASE_H_ 6 #define SHELL_SHELL_TEST_BASE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 18 matching lines...) Expand all
29 // |application_url| should typically be a mojo: URL (the origin will be set 29 // |application_url| should typically be a mojo: URL (the origin will be set
30 // to an "appropriate" file: URL). 30 // to an "appropriate" file: URL).
31 // TODO(tim): Should the test base be a mojo::ServiceProvider? 31 // TODO(tim): Should the test base be a mojo::ServiceProvider?
32 mojo::ScopedMessagePipeHandle ConnectToService( 32 mojo::ScopedMessagePipeHandle ConnectToService(
33 const GURL& application_url, 33 const GURL& application_url,
34 const std::string& service_name); 34 const std::string& service_name);
35 35
36 template <typename Interface> 36 template <typename Interface>
37 void ConnectToService(const GURL& application_url, 37 void ConnectToService(const GURL& application_url,
38 mojo::InterfacePtr<Interface>* ptr) { 38 mojo::InterfacePtr<Interface>* ptr) {
39 mojo::InterfacePtrInfo<Interface> interface( 39 mojo::InterfaceHandle<Interface> interface(
40 ConnectToService(application_url, Interface::Name_).Pass(), 0u); 40 ConnectToService(application_url, Interface::Name_).Pass(), 0u);
41 ptr->Bind(interface.Pass()); 41 ptr->Bind(interface.Pass());
42 } 42 }
43 43
44 base::MessageLoop* message_loop() { return &message_loop_; } 44 base::MessageLoop* message_loop() { return &message_loop_; }
45 Context* shell_context() { return &shell_context_; } 45 Context* shell_context() { return &shell_context_; }
46 46
47 private: 47 private:
48 // Set up the test applications so that mojo: URL resolves to those. 48 // Set up the test applications so that mojo: URL resolves to those.
49 void SetUpTestApplications(); 49 void SetUpTestApplications();
50 50
51 Context shell_context_; 51 Context shell_context_;
52 base::MessageLoop message_loop_; 52 base::MessageLoop message_loop_;
53 53
54 DISALLOW_COPY_AND_ASSIGN(ShellTestBase); 54 DISALLOW_COPY_AND_ASSIGN(ShellTestBase);
55 }; 55 };
56 56
57 } // namespace test 57 } // namespace test
58 } // namespace shell 58 } // namespace shell
59 59
60 #endif // SHELL_SHELL_TEST_BASE_H_ 60 #endif // SHELL_SHELL_TEST_BASE_H_
OLDNEW
« mojo/public/cpp/bindings/lib/bindings_serialization.h ('K') | « shell/child_process_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698