summaryrefslogtreecommitdiffstats
path: root/mojo
diff options
context:
space:
mode:
authormsw <msw@chromium.org>2015-04-21 17:51:20 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-22 00:52:30 +0000
commit46cf2a915a4a6fbcc3a55e651760dad89901a113 (patch)
treea33d868dfa40d2dc6208924cc12f721ea003ec03 /mojo
parentbe024adb2e7f29ed7a446120d679db0996bbedee (diff)
downloadchromium_src-46cf2a915a4a6fbcc3a55e651760dad89901a113.zip
chromium_src-46cf2a915a4a6fbcc3a55e651760dad89901a113.tar.gz
chromium_src-46cf2a915a4a6fbcc3a55e651760dad89901a113.tar.bz2
Cleanup mojo shell test targets.
Remove the unused shell_test_helper files and target. Cleanup target names and consolidate. BUG=NONE TEST=Build mojo and pass mojo_shell_unittests, mojo_application_manager_unittests. R=sky@chromium.org Review URL: https://codereview.chromium.org/1101533004 Cr-Commit-Position: refs/heads/master@{#326200}
Diffstat (limited to 'mojo')
-rw-r--r--mojo/shell/BUILD.gn47
-rw-r--r--mojo/shell/application_manager/BUILD.gn4
-rw-r--r--mojo/shell/shell_test_helper.cc46
-rw-r--r--mojo/shell/shell_test_helper.h52
4 files changed, 10 insertions, 139 deletions
diff --git a/mojo/shell/BUILD.gn b/mojo/shell/BUILD.gn
index 512c455..3c06107 100644
--- a/mojo/shell/BUILD.gn
+++ b/mojo/shell/BUILD.gn
@@ -18,24 +18,17 @@ group("shell") {
deps = [
":mojo_shell",
":tests",
+ "//mojo/shell/application_manager:tests",
]
if (is_android) {
deps += [
":mojo_shell_apk",
- ":mojo_shell_tests_apk",
+ ":tests_apk",
]
}
}
-group("tests") {
- testonly = true
- deps = [
- ":mojo_shell_tests",
- "//mojo/shell/application_manager:mojo_application_manager_unittests",
- ]
-}
-
if (is_android) {
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
@@ -45,7 +38,6 @@ executable("mojo_shell") {
sources = []
deps = [
- ":init",
":lib",
"//base",
"//build/config/sanitizers:deps",
@@ -79,17 +71,6 @@ executable("mojo_shell") {
}
}
-source_set("init") {
- sources = [
- "init.cc",
- "init.h",
- ]
-
- deps = [
- "//base",
- ]
-}
-
source_set("in_process_native_runner") {
sources = [
"in_process_native_runner.cc",
@@ -116,6 +97,8 @@ source_set("lib") {
"context.h",
"filename_util.cc",
"filename_util.h",
+ "init.cc",
+ "init.h",
"out_of_process_native_runner.cc",
"out_of_process_native_runner.h",
"task_runners.cc",
@@ -126,7 +109,6 @@ source_set("lib") {
deps = [
":child_process_bindings",
- ":init",
":in_process_native_runner",
":native_application_support",
"//base",
@@ -350,8 +332,9 @@ mojom("child_process_bindings") {
]
}
-# GYP version: mojo/mojo.gyp:mojo_shell_tests
-test("mojo_shell_tests") {
+test("tests") {
+ output_name = "mojo_shell_unittests"
+
sources = [
"child_process_host_unittest.cc",
"data_pipe_peek_unittest.cc",
@@ -400,22 +383,6 @@ test("mojo_shell_tests") {
}
}
-# GYP version: mojo/mojo.gyp:mojo_shell_test_support
-source_set("test_support") {
- sources = [
- "shell_test_helper.cc",
- "shell_test_helper.h",
- ]
-
- deps = [
- ":init",
- ":lib",
- "//base",
- "//third_party/mojo/src/mojo/edk/system",
- "//mojo/shell/application_manager",
- ]
-}
-
mojo_native_application("apptests") {
output_name = "shell_apptests"
diff --git a/mojo/shell/application_manager/BUILD.gn b/mojo/shell/application_manager/BUILD.gn
index f220b43..9122e7e 100644
--- a/mojo/shell/application_manager/BUILD.gn
+++ b/mojo/shell/application_manager/BUILD.gn
@@ -47,7 +47,9 @@ source_set("application_manager") {
]
}
-test("mojo_application_manager_unittests") {
+test("tests") {
+ output_name = "mojo_application_manager_unittests"
+
sources = [
"application_manager_unittest.cc",
"query_util_unittest.cc",
diff --git a/mojo/shell/shell_test_helper.cc b/mojo/shell/shell_test_helper.cc
deleted file mode 100644
index 0a467303..0000000
--- a/mojo/shell/shell_test_helper.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "mojo/shell/shell_test_helper.h"
-
-#include "base/command_line.h"
-#include "base/files/file_path.h"
-#include "base/files/file_util.h"
-#include "base/logging.h"
-#include "base/path_service.h"
-#include "mojo/shell/filename_util.h"
-#include "mojo/shell/init.h"
-#include "mojo/shell/url_resolver.h"
-
-namespace mojo {
-namespace shell {
-
-ShellTestHelper::ShellTestHelper() {
- base::CommandLine::Init(0, nullptr);
- InitializeLogging();
-}
-
-ShellTestHelper::~ShellTestHelper() {
-}
-
-void ShellTestHelper::Init() {
- context_.Init();
- test_api_.reset(
- new ApplicationManager::TestAPI(context_.application_manager()));
- base::FilePath service_dir;
- CHECK(PathService::Get(base::DIR_MODULE, &service_dir));
- context_.url_resolver()->SetMojoBaseURL(FilePathToFileURL(service_dir));
-}
-
-void ShellTestHelper::SetLoaderForURL(scoped_ptr<ApplicationLoader> loader,
- const GURL& url) {
- context_.application_manager()->SetLoaderForURL(loader.Pass(), url);
-}
-
-void ShellTestHelper::AddURLMapping(const GURL& url, const GURL& resolved_url) {
- context_.url_resolver()->AddURLMapping(url, resolved_url);
-}
-
-} // namespace shell
-} // namespace mojo
diff --git a/mojo/shell/shell_test_helper.h b/mojo/shell/shell_test_helper.h
deleted file mode 100644
index 185d367..0000000
--- a/mojo/shell/shell_test_helper.h
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef SHELL_SHELL_TEST_HELPER_H_
-#define SHELL_SHELL_TEST_HELPER_H_
-
-#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/run_loop.h"
-#include "mojo/shell/application_manager/application_loader.h"
-#include "mojo/shell/context.h"
-
-class GURL;
-
-namespace mojo {
-namespace shell {
-
-// ShellTestHelper is useful for tests to establish a connection to the
-// ApplicationManager. Invoke Init() to establish the connection. Once done,
-// application_manager() returns the ApplicationManager.
-class ShellTestHelper {
- public:
- ShellTestHelper();
- ~ShellTestHelper();
-
- void Init();
-
- ApplicationManager* application_manager() {
- return context_.application_manager();
- }
-
- // Sets a ApplicationLoader for the specified URL. |loader| is ultimately used
- // on
- // the thread this class spawns.
- void SetLoaderForURL(scoped_ptr<ApplicationLoader> loader, const GURL& url);
-
- // Adds a mapping that is used when resolving mojo urls. See URLResolver
- // for details.
- void AddURLMapping(const GURL& url, const GURL& resolved_url);
-
- private:
- Context context_;
- base::MessageLoop shell_loop_;
- scoped_ptr<ApplicationManager::TestAPI> test_api_;
- DISALLOW_COPY_AND_ASSIGN(ShellTestHelper);
-};
-
-} // namespace shell
-} // namespace mojo
-
-#endif // SHELL_SHELL_TEST_HELPER_H_