[SyncFS] Build indexes from FileTracker entries on disk.
[chromium-blink-merge.git] / mojo / shell / shell_test_base.cc
blob24cf859777b80617822bc999363553706b14b1c5
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"
14 #include "url/gurl.h"
16 namespace mojo {
17 namespace shell {
18 namespace test {
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();
38 } // namespace test
39 } // namespace shell
40 } // namespace mojo