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
3 // found in the LICENSE file.
5 #include "mojo/shell/shell_test_base.h"
7 #include "base/command_line.h"
8 #include "base/file_util.h"
9 #include "base/files/file_path.h"
10 #include "base/logging.h"
11 #include "base/path_service.h"
12 #include "build/build_config.h"
13 #include "net/base/filename_util.h"
20 ShellTestBase::ShellTestBase() {
23 ShellTestBase::~ShellTestBase() {
26 ScopedMessagePipeHandle
ShellTestBase::ConnectToService(
27 const GURL
& application_url
,
28 const std::string
& service_name
) {
29 base::FilePath service_dir
;
30 CHECK(PathService::Get(base::DIR_MODULE
, &service_dir
));
31 shell_context_
.mojo_url_resolver()->set_origin(
32 net::FilePathToFileURL(service_dir
).spec());
34 return shell_context_
.service_manager()->ConnectToServiceByName(
35 application_url
, service_name
).Pass();