summaryrefslogtreecommitdiffstats
path: root/mojo
diff options
context:
space:
mode:
authorjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-13 00:22:04 +0000
committerjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-13 00:22:55 +0000
commitb1867c911e8525d5c203299b04a7756733f6f88e (patch)
tree7fde02cddad685bc19de3acbe8fdedede56c30ec /mojo
parent4bf1d748acb3bae7ea8447ae80b6f24bb626eedd (diff)
downloadchromium_src-b1867c911e8525d5c203299b04a7756733f6f88e.zip
chromium_src-b1867c911e8525d5c203299b04a7756733f6f88e.tar.gz
chromium_src-b1867c911e8525d5c203299b04a7756733f6f88e.tar.bz2
GN: Add mojo_shell_tests, get more things working on android
R=brettw@chromium.org Review URL: https://codereview.chromium.org/461903002 Cr-Commit-Position: refs/heads/master@{#289133} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289133 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'mojo')
-rw-r--r--mojo/BUILD.gn1
-rw-r--r--mojo/environment/BUILD.gn4
-rw-r--r--mojo/gles2/BUILD.gn25
-rw-r--r--mojo/mojo.gyp1
-rw-r--r--mojo/mojo_public.gypi1
-rw-r--r--mojo/services/native_viewport/BUILD.gn6
-rw-r--r--mojo/services/public/cpp/geometry/BUILD.gn7
-rw-r--r--mojo/services/public/cpp/input_events/BUILD.gn7
-rw-r--r--mojo/services/test_service/BUILD.gn49
-rw-r--r--mojo/services/view_manager/BUILD.gn7
-rw-r--r--mojo/shell/BUILD.gn43
-rw-r--r--mojo/system.gni24
12 files changed, 151 insertions, 24 deletions
diff --git a/mojo/BUILD.gn b/mojo/BUILD.gn
index 62c6ba8..3125612 100644
--- a/mojo/BUILD.gn
+++ b/mojo/BUILD.gn
@@ -8,6 +8,7 @@ group("mojo") {
"//mojo/public",
"//mojo/services",
"//mojo/shell:mojo_shell",
+ "//mojo/shell:mojo_shell_tests",
]
}
diff --git a/mojo/environment/BUILD.gn b/mojo/environment/BUILD.gn
index 5c9fe75..cba8cac 100644
--- a/mojo/environment/BUILD.gn
+++ b/mojo/environment/BUILD.gn
@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-# GYP version: mojo.gyp:mojo_environment_chromium
+# GYP version: mojo_base.gyp:mojo_environment_chromium
source_set("chromium") {
output_name = "mojo_environment_chromium"
@@ -22,7 +22,7 @@ source_set("chromium") {
]
}
-# GYP version: mojo.gyp:mojo_environment_chromium_impl
+# GYP version: mojo_base.gyp:mojo_environment_chromium_impl
component("chromium_impl") {
output_name = "mojo_environment_impl"
visibility = "//mojo/*"
diff --git a/mojo/gles2/BUILD.gn b/mojo/gles2/BUILD.gn
index 9b4ffb9..a37647a 100644
--- a/mojo/gles2/BUILD.gn
+++ b/mojo/gles2/BUILD.gn
@@ -3,7 +3,17 @@
# found in the LICENSE file.
import("//mojo/public/tools/bindings/mojom.gni")
+import("//mojo/system.gni")
+config("mojo_use_gles2") {
+ defines = [ "MOJO_USE_GLES2_IMPL" ]
+}
+
+config("gles2_use_mojo") {
+ defines = [ "USE_MOJO_GLES2" ]
+}
+
+# GYP version: mojo/mojo_base.gyp:mojo_gles2_impl
component("gles2") {
output_name = "mojo_gles2_impl"
@@ -18,12 +28,19 @@ component("gles2") {
"//mojo/services/gles2:interfaces",
"//mojo/environment:chromium",
]
+ deps += mojo_system_for_component
- if (is_component_build) {
- deps += [ "//mojo/system" ]
- }
+ defines = [
+ "MOJO_GLES2_IMPL_IMPLEMENTATION",
+ "MOJO_GLES2_IMPLEMENTATION",
+ ]
- defines = [ "MOJO_GLES2_IMPL_IMPLEMENTATION" ]
+ configs += [
+ ":gles2_use_mojo",
+ ":mojo_use_gles2",
+ ]
+ direct_dependent_configs = [ ":gles2_use_mojo" ]
+ all_dependent_configs = [ ":mojo_use_gles2" ]
sources = [
"command_buffer_client_impl.cc",
diff --git a/mojo/mojo.gyp b/mojo/mojo.gyp
index 3d69496..4ba1770 100644
--- a/mojo/mojo.gyp
+++ b/mojo/mojo.gyp
@@ -263,6 +263,7 @@
],
},
{
+ # GN version: //mojo/shell:mojo_shell_tests
'target_name': 'mojo_shell_tests',
'type': '<(gtest_target_type)',
'dependencies': [
diff --git a/mojo/mojo_public.gypi b/mojo/mojo_public.gypi
index 20af45f..f1c7ede 100644
--- a/mojo/mojo_public.gypi
+++ b/mojo/mojo_public.gypi
@@ -251,6 +251,7 @@
],
},
{
+ # GN version: //mojo/public/cpp/application:standalone"
'target_name': 'mojo_application_standalone',
'type': 'static_library',
'sources': [
diff --git a/mojo/services/native_viewport/BUILD.gn b/mojo/services/native_viewport/BUILD.gn
index 31113ce..9513af9 100644
--- a/mojo/services/native_viewport/BUILD.gn
+++ b/mojo/services/native_viewport/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/ui.gni")
+import("//mojo/system.gni")
component("native_viewport") {
output_name = "mojo_native_viewport"
@@ -21,6 +22,7 @@ component("native_viewport") {
"//mojo/services/public/cpp/input_events",
"//mojo/services/public/interfaces/native_viewport",
]
+ deps += mojo_system_for_component
defines = [ "MOJO_NATIVE_VIEWPORT_IMPLEMENTATION" ]
@@ -56,8 +58,4 @@ component("native_viewport") {
if (use_ozone) {
sources += [ "native_viewport_ozone.cc" ]
}
-
- if (is_component_build) {
- deps += [ "//mojo/system" ]
- }
}
diff --git a/mojo/services/public/cpp/geometry/BUILD.gn b/mojo/services/public/cpp/geometry/BUILD.gn
index 5f8a9b9..21cf5d9 100644
--- a/mojo/services/public/cpp/geometry/BUILD.gn
+++ b/mojo/services/public/cpp/geometry/BUILD.gn
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//mojo/system.gni")
+
component("geometry") {
output_name = "mojo_geometry_lib"
@@ -12,6 +14,7 @@ component("geometry") {
"//mojo/environment:chromium",
"//mojo/services/public/interfaces/geometry",
]
+ deps += mojo_system_for_component
forward_dependent_configs_from = [ "//ui/gfx" ]
@@ -24,8 +27,4 @@ component("geometry") {
"geometry_type_converters.h",
"mojo_geometry_export.h",
]
-
- if (is_component_build) {
- deps += [ "//mojo/system" ]
- }
}
diff --git a/mojo/services/public/cpp/input_events/BUILD.gn b/mojo/services/public/cpp/input_events/BUILD.gn
index 92222db..92cc205 100644
--- a/mojo/services/public/cpp/input_events/BUILD.gn
+++ b/mojo/services/public/cpp/input_events/BUILD.gn
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//mojo/system.gni")
+
component("input_events") {
deps = [
"//base",
@@ -12,6 +14,7 @@ component("input_events") {
"//mojo/services/public/interfaces/geometry",
"//mojo/services/public/cpp/geometry",
]
+ deps += mojo_system_for_component
defines = [
"MOJO_INPUT_EVENTS_IMPLEMENTATION",
@@ -22,8 +25,4 @@ component("input_events") {
"input_events_type_converters.h",
"mojo_input_events_export.h",
]
-
- if (is_component_build) {
- deps += [ "//mojo/system" ]
- }
}
diff --git a/mojo/services/test_service/BUILD.gn b/mojo/services/test_service/BUILD.gn
index 684826f..0d1d99c 100644
--- a/mojo/services/test_service/BUILD.gn
+++ b/mojo/services/test_service/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//mojo/public/tools/bindings/mojom.gni")
+import("//mojo/system.gni")
# GYP version: mojo/mojo_services.gypi:mojo_test_service_bindings
mojom("bindings") {
@@ -11,3 +12,51 @@ mojom("bindings") {
"test_service.mojom",
]
}
+
+# GYP version: mojo/mojo_services.gypi:mojo_test_app
+shared_library("mojo_test_app") {
+ deps = [
+ ":bindings",
+ "//base",
+ "//mojo/public/cpp/application:main_standalone",
+ "//mojo/public/cpp/application:standalone",
+ "//mojo/public/cpp/environment:standalone",
+ "//mojo/public/cpp/utility",
+ ]
+ deps += mojo_system_for_shared_library
+
+ sources = [
+ "test_request_tracker_client_impl.cc",
+ "test_request_tracker_client_impl.h",
+ "test_service_application.cc",
+ "test_service_application.h",
+ "test_service_impl.cc",
+ "test_service_impl.h",
+ "test_time_service_impl.cc",
+ "test_time_service_impl.h",
+ ]
+}
+
+# GYP version: //mojo/mojo_services.gypi:mojo_test_request_tracker_app
+shared_library("mojo_test_request_tracker_app") {
+ deps = [
+ ":bindings",
+ "//base",
+ "//mojo/public/cpp/application:main_standalone",
+ "//mojo/public/cpp/application:standalone",
+ "//mojo/public/cpp/environment:standalone",
+ "//mojo/public/cpp/utility",
+ ]
+ deps += mojo_system_for_shared_library
+
+ sources = [
+ "test_request_tracker_client_impl.cc",
+ "test_request_tracker_client_impl.h",
+ "test_request_tracker_application.cc",
+ "test_request_tracker_application.h",
+ "test_time_service_impl.cc",
+ "test_time_service_impl.h",
+ "test_request_tracker_impl.cc",
+ "test_request_tracker_impl.h",
+ ]
+}
diff --git a/mojo/services/view_manager/BUILD.gn b/mojo/services/view_manager/BUILD.gn
index 5bcb638..bae54f1 100644
--- a/mojo/services/view_manager/BUILD.gn
+++ b/mojo/services/view_manager/BUILD.gn
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//mojo/system.gni")
+
component("view_manager") {
deps = [
"//base",
@@ -30,6 +32,7 @@ component("view_manager") {
"//ui/gl",
"//webkit/common/gpu",
]
+ deps += mojo_system_for_component
defines = [
"MOJO_VIEW_MANAGER_IMPLEMENTATION",
@@ -66,8 +69,4 @@ component("view_manager") {
"window_tree_host_impl.cc",
"window_tree_host_impl.h",
]
-
- if (is_component_build) {
- deps += [ "//mojo/system" ]
- }
}
diff --git a/mojo/shell/BUILD.gn b/mojo/shell/BUILD.gn
index 700b9ab..1038b6f 100644
--- a/mojo/shell/BUILD.gn
+++ b/mojo/shell/BUILD.gn
@@ -33,11 +33,12 @@ source_set("lib") {
"//base",
"//base/third_party/dynamic_annotations",
"//base:base_static",
+ "//mojo/application_manager",
"//mojo/common",
"//mojo/gles2",
"//mojo/public/cpp/application:chromium",
+ "//mojo/public/gles2",
"//mojo/public/interfaces/application",
- "//mojo/application_manager",
"//mojo/services/native_viewport",
"//mojo/services/public/interfaces/native_viewport",
"//mojo/services/public/interfaces/network",
@@ -102,7 +103,6 @@ source_set("lib") {
deps += [
# These are only necessary as long as we hard code use of ViewManager.
"//skia",
- "//mojo/public/gles2",
"//mojo/services/view_manager",
"//mojo/services/public/interfaces/view_manager",
]
@@ -124,3 +124,42 @@ mojom("external_service_bindings") {
"external_service.mojom"
]
}
+
+test("mojo_shell_tests") {
+ deps = [
+ ":lib",
+ "//base",
+ "//base:i18n",
+ "//base/test:test_support",
+ "//testing/gtest",
+ "//net:test_support",
+ "//url",
+ "//mojo/application_manager",
+ "//mojo/services/test_service:bindings",
+ "//mojo/common",
+ "//mojo/environment:chromium",
+ "//mojo/system",
+ ]
+
+ datadeps = [
+ "//mojo/services/test_service:mojo_test_app",
+ "//mojo/services/test_service:mojo_test_request_tracker_app",
+ ]
+
+ sources = [
+ "child_process_host_unittest.cc",
+ "dynamic_application_loader_unittest.cc",
+ "in_process_dynamic_service_runner_unittest.cc",
+ "shell_test_base.cc",
+ "shell_test_base.h",
+ "shell_test_base_unittest.cc",
+ "shell_test_main.cc",
+ ]
+
+ if (is_android) {
+ deps += [
+ # TODO(GYP):
+ #'../testing/android/native_test.gyp:native_test_native_code',
+ ]
+ }
+}
diff --git a/mojo/system.gni b/mojo/system.gni
new file mode 100644
index 0000000..c7c07ad
--- /dev/null
+++ b/mojo/system.gni
@@ -0,0 +1,24 @@
+# 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.
+
+# The following mojo_system-prefixed variables are used to express a dependency
+# on the mojo system APIs.
+#
+# In an is_component_build build, everything can link against
+# mojo_system_impl because it is built as a shared library. However, in a static
+# build, mojo_system_impl is linked into an executable (e.g.,
+# mojo_shell), and must be injected into other shared libraries (i.e., Mojo
+# Apps) that need the mojo system API.
+#
+# For component targets, add mojo_system_for_component to your deps section.
+# For shared_library targets (e.g., a Mojo App), add
+# mojo_system_for_shared_library to your deps
+
+if (is_component_build) {
+ mojo_system_for_component = [ "//mojo/system" ]
+ mojo_system_for_shared_library = [ "//mojo/system" ]
+} else {
+ mojo_system_for_component = [] # nothing to link against here
+ mojo_system_for_shared_library = [ "//mojo/public/c/system" ]
+}