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

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

Issue 1354003002: Make CapabilityFilter be part of Identity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 3 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 "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 29 matching lines...) Expand all
40 } 40 }
41 41
42 void ShellTestBase::TearDown() { 42 void ShellTestBase::TearDown() {
43 shell_context_.Shutdown(); 43 shell_context_.Shutdown();
44 } 44 }
45 45
46 ScopedMessagePipeHandle ShellTestBase::ConnectToService( 46 ScopedMessagePipeHandle ShellTestBase::ConnectToService(
47 const GURL& application_url, 47 const GURL& application_url,
48 const std::string& service_name) { 48 const std::string& service_name) {
49 ServiceProviderPtr services; 49 ServiceProviderPtr services;
50 mojo::URLRequestPtr request(mojo::URLRequest::New());
51 request->url = mojo::String::From(application_url.spec());
52 50
53 scoped_ptr<shell::ConnectToApplicationParams> params( 51 scoped_ptr<shell::ConnectToApplicationParams> params(
54 new shell::ConnectToApplicationParams); 52 new shell::ConnectToApplicationParams);
55 params->SetURLInfo(request.Pass()); 53 params->SetTargetURL(application_url);
56 params->set_services(GetProxy(&services)); 54 params->set_services(GetProxy(&services));
57 params->set_filter(shell::GetPermissiveCapabilityFilter());
58 params->set_on_application_end(base::Bind(&QuitIfRunning)); 55 params->set_on_application_end(base::Bind(&QuitIfRunning));
59 shell_context_.application_manager()->ConnectToApplication(params.Pass()); 56 shell_context_.application_manager()->ConnectToApplication(params.Pass());
60 MessagePipe pipe; 57 MessagePipe pipe;
61 services->ConnectToService(service_name, pipe.handle1.Pass()); 58 services->ConnectToService(service_name, pipe.handle1.Pass());
62 return pipe.handle0.Pass(); 59 return pipe.handle0.Pass();
63 } 60 }
64 61
65 #if !defined(OS_ANDROID) 62 #if !defined(OS_ANDROID)
66 base::FilePath ShellTestBase::GetTestAppFilePath() const { 63 base::FilePath ShellTestBase::GetTestAppFilePath() const {
67 base::FilePath shell_dir; 64 base::FilePath shell_dir;
68 PathService::Get(base::DIR_MODULE, &shell_dir); 65 PathService::Get(base::DIR_MODULE, &shell_dir);
69 return shell_dir; 66 return shell_dir;
70 } 67 }
71 #endif 68 #endif
72 69
73 } // namespace test 70 } // namespace test
74 } // namespace runner 71 } // namespace runner
75 } // namespace mojo 72 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698