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

Side by Side Diff: mojo/runner/shell_test_base.cc

Issue 1228743002: Mandoline: Move ContentHandlerConnection into separate file (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build Created 5 years, 5 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/runner/native_runner_unittest.cc ('k') | mojo/shell/BUILD.gn » ('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 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 "mojo/runner/shell_test_base.h" 5 #include "mojo/runner/shell_test_base.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 shell_context_.Shutdown(); 44 shell_context_.Shutdown();
45 } 45 }
46 46
47 ScopedMessagePipeHandle ShellTestBase::ConnectToService( 47 ScopedMessagePipeHandle ShellTestBase::ConnectToService(
48 const GURL& application_url, 48 const GURL& application_url,
49 const std::string& service_name) { 49 const std::string& service_name) {
50 ServiceProviderPtr services; 50 ServiceProviderPtr services;
51 mojo::URLRequestPtr request(mojo::URLRequest::New()); 51 mojo::URLRequestPtr request(mojo::URLRequest::New());
52 request->url = mojo::String::From(application_url.spec()); 52 request->url = mojo::String::From(application_url.spec());
53 shell_context_.application_manager()->ConnectToApplication( 53 shell_context_.application_manager()->ConnectToApplication(
54 request.Pass(), GURL(), GetProxy(&services), nullptr, 54 request.Pass(), std::string(), GURL(), GetProxy(&services), nullptr,
55 base::Bind(&QuitIfRunning)); 55 base::Bind(&QuitIfRunning));
56 MessagePipe pipe; 56 MessagePipe pipe;
57 services->ConnectToService(service_name, pipe.handle1.Pass()); 57 services->ConnectToService(service_name, pipe.handle1.Pass());
58 return pipe.handle0.Pass(); 58 return pipe.handle0.Pass();
59 } 59 }
60 60
61 #if !defined(OS_ANDROID) 61 #if !defined(OS_ANDROID)
62 void ShellTestBase::SetUpTestApplications() { 62 void ShellTestBase::SetUpTestApplications() {
63 // Set the URLResolver origin to be the same as the base file path for 63 // Set the URLResolver origin to be the same as the base file path for
64 // local files. This is primarily for test convenience, so that references 64 // local files. This is primarily for test convenience, so that references
65 // to unknown mojo: urls that do not have specific local file or custom 65 // to unknown mojo: urls that do not have specific local file or custom
66 // mappings registered on the URL resolver are treated as shared libraries. 66 // mappings registered on the URL resolver are treated as shared libraries.
67 base::FilePath service_dir; 67 base::FilePath service_dir;
68 CHECK(PathService::Get(base::DIR_MODULE, &service_dir)); 68 CHECK(PathService::Get(base::DIR_MODULE, &service_dir));
69 shell_context_.url_resolver()->SetMojoBaseURL( 69 shell_context_.url_resolver()->SetMojoBaseURL(
70 util::FilePathToFileURL(service_dir)); 70 util::FilePathToFileURL(service_dir));
71 } 71 }
72 #endif 72 #endif
73 73
74 } // namespace test 74 } // namespace test
75 } // namespace runner 75 } // namespace runner
76 } // namespace mojo 76 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/runner/native_runner_unittest.cc ('k') | mojo/shell/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698