[DevTools] Implement DevToolsManager::Observer which notifies about target updates.
[chromium-blink-merge.git] / mojo / shell / shell_test_helper.cc
blobd0f0f7aded8ff38f60d20d01c348eecd8c0c2a3e
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_helper.h"
7 #include "base/command_line.h"
8 #include "base/files/file_path.h"
9 #include "base/files/file_util.h"
10 #include "base/logging.h"
11 #include "base/path_service.h"
12 #include "mojo/shell/init.h"
13 #include "net/base/filename_util.h"
15 namespace mojo {
16 namespace shell {
18 ShellTestHelper::ShellTestHelper() {
19 base::CommandLine::Init(0, NULL);
20 mojo::shell::InitializeLogging();
23 ShellTestHelper::~ShellTestHelper() {
26 void ShellTestHelper::Init() {
27 context_.Init();
28 test_api_.reset(
29 new ApplicationManager::TestAPI(context_.application_manager()));
30 base::FilePath service_dir;
31 CHECK(PathService::Get(base::DIR_MODULE, &service_dir));
32 context_.mojo_url_resolver()->SetBaseURL(
33 net::FilePathToFileURL(service_dir));
36 void ShellTestHelper::SetLoaderForURL(scoped_ptr<ApplicationLoader> loader,
37 const GURL& url) {
38 context_.application_manager()->SetLoaderForURL(loader.Pass(), url);
41 } // namespace shell
42 } // namespace mojo