Skip to content

Commit

Permalink
Add ChromeShellTestApk and other chrome/ test stuff
Browse files Browse the repository at this point in the history
Adds these targets:
//chrome/android:chrome_javatests
//chrome/android:chrome_shell_test_java
//chrome/android:chrome_shell_test_apk
//chrome/android:chrome_sync_shell_test_apk
//chrome/android:uiautomator_tests_java
//chrome/android:uiautomator_tests
//chrome/test/android:chrome_java_test_support
//chrome/test/chromedriver/test/webview_shell:chromedriver_webview_shell_apk
//chrome/test/chromedriver/test/webview_shell:chromedriver_webview_shell_resources

depends on https://codereview.chromium.org/570203002/

TBR=ben
BUG=359249

Review URL: https://codereview.chromium.org/586383002

Cr-Commit-Position: refs/heads/master@{#299926}
  • Loading branch information
cjhopman authored and Commit bot committed Oct 16, 2014
1 parent 042b047 commit 4fe114e
Show file tree
Hide file tree
Showing 8 changed files with 170 additions and 14 deletions.
1 change: 1 addition & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ group("root") {
"//third_party/openmax_dl/dl",
"//content/shell/android:content_shell_apk",
"//chrome/android:chrome_shell_apk",
"//chrome/test/chromedriver/test/webview_shell:chromedriver_webview_shell_apk",
"//ui/android:ui_java",
"//third_party/android_tools:android_gcm_java",
"//third_party/android_tools:uiautomator_java",
Expand Down
3 changes: 3 additions & 0 deletions build/android/gyp/find.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ def main(argv):
options, directories = parser.parse_args(argv)

for d in directories:
if not os.path.exists(d):
print >> sys.stderr, '%s does not exist' % d
return 1
for root, _, filenames in os.walk(d):
for f in fnmatch.filter(filenames, options.pattern):
print os.path.join(root, f)
Expand Down
9 changes: 9 additions & 0 deletions build/config/android/rules.gni
Original file line number Diff line number Diff line change
Expand Up @@ -1203,3 +1203,12 @@ template("proto_java_library") {
]
}
}

# TODO(GYP): implement this.
template("uiautomator_test") {
if (defined(invoker.testonly)) { testonly = invoker.testonly }
assert(target_name != "")
assert(invoker.deps != [] || true)
group(target_name) {
}
}
118 changes: 107 additions & 11 deletions chrome/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -349,17 +349,6 @@ copy_ex("chrome_shell_assets") {
}
}

#TODO(GYP):
#'variables': {
#'conditions': [
#['component != "shared_library" and target_arch != "arm64" and target_arch != "x64" and profiling_full_stack_frames != 1', {
## Only enable the chromium linker on regular builds, since the
## component build crashes on Android 4.4. See b/11379966
#'use_chromium_linker': '1',
#}],
#],
#},

# GYP: //chrome/chrome_browser.gypi:chrome_shell_apk
android_apk("chrome_shell_apk") {
testonly = true
Expand All @@ -375,6 +364,18 @@ android_apk("chrome_shell_apk") {
"$root_build_dir/lib.stripped/libchrome_shell.so"
]
asset_location = chrome_shell_assets_dir

#TODO(GYP):
#'variables': {
#'conditions': [
#['component != "shared_library" and target_arch != "arm64" and target_arch != "x64" and profiling_full_stack_frames != 1', {
## Only enable the chromium linker on regular builds, since the
## component build crashes on Android 4.4. See b/11379966
#'use_chromium_linker': '1',
#}],
#],
#},

}

# GYP: //chrome/chrome_browser.gypi:chrome_sync_shell_apk
Expand All @@ -394,6 +395,101 @@ android_apk("chrome_sync_shell_apk") {
asset_location = chrome_shell_assets_dir
}

# GYP: part of //chrome/chrome_tests.gypi:chrome_shell_test_apk
android_library("chrome_javatests") {
testonly = true
DEPRECATED_java_in_dir = "javatests/src"
deps = [
":chrome_java",
":chrome_java_resources",
":chrome_shell_java",
":chrome_shell_resources",
":chrome_shell_test_java",
"//base:base_java",
"//base:base_java_test_support",
"//chrome/test/android:chrome_java_test_support",
"//components/bookmarks/common/android:bookmarks_java",
"//components/dom_distiller/android:dom_distiller_core_java",
"//components/invalidation:java",
"//content/public/android:content_java",
"//content/public/test/android:content_java_test_support",
"//printing:printing_java",
"//sync/android:sync_java",
"//sync:sync_java_test_support",
"//third_party/cacheinvalidation:cacheinvalidation_javalib",
"//third_party/cacheinvalidation:cacheinvalidation_proto_java",
"//third_party/jsr-305:jsr_305_javalib",
"//ui/android:ui_java",
]
}

android_library("chrome_shell_test_java") {
testonly = true
deps = [
":chrome_java",
":chrome_shell_java",
"//base:base_java",
"//base:base_java_test_support",
"//chrome/test/android:chrome_java_test_support",
"//content/public/android:content_java",
"//content/public/test/android:content_java_test_support",
"//ui/android:ui_java",
]
DEPRECATED_java_in_dir = "shell/javatests/src"
}

# GYP: //chrome/chrome_tests.gypi:chrome_shell_test_apk
android_apk("chrome_shell_test_apk") {
testonly = true
deps = [
":chrome_javatests",
":chrome_shell_test_java",
"//sync/android:sync_javatests",
]
apk_name = "ChromeShellTest"
android_manifest = "shell/javatests/AndroidManifest.xml"
}

# GYP: //chrome/chrome_tests.gypi:chrome_sync_shell_test_apk
android_apk("chrome_sync_shell_test_apk") {
testonly = true
deps = [
":chrome_java",
":chrome_shell_java",
":chrome_shell_test_java",
"//base:base_java",
"//base:base_java_test_support",
"//chrome/test/android:chrome_java_test_support",
"//components/invalidation:java",
"//content/public/android:content_java",
"//content/public/test/android:content_java_test_support",
"//sync/android:sync_java",
"//sync:sync_java_test_support",
]
apk_name = "ChromeSyncShellTest"
DEPRECATED_java_in_dir = "sync_shell/javatests/src"
android_manifest = "sync_shell/javatests/AndroidManifest.xml"
}


# GYP: //chrome/chrome_tests.gypi:chrome_shell_uiautomator_tests_java
android_library("uiautomator_tests_java") {
testonly = true
DEPRECATED_java_in_dir = "uiautomator_tests/src"
deps = [
"//base:base_java_test_support",
"//third_party/android_tools:uiautomator_java",
]
}

# GYP: //chrome/chrome_tests.gypi:chrome_shell_uiautomator_tests
uiautomator_test("uiautomator_tests") {
testonly = true
deps = [
":uiautomator_tests_java"
]
}

# GYP: //chrome/chrome_android.gypi:chrome_version_java
chrome_version_java_dir = "$root_gen_dir/templates/chrome_version_java"
chrome_version_java_file = "$chrome_version_java_dir/org/chromium/chrome/browser/ChromeVersionConstants.java"
Expand Down
6 changes: 6 additions & 0 deletions chrome/chrome_tests.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -2867,6 +2867,7 @@
['OS == "android"', {
'targets': [
{
# GN: //chrome/android:chrome_shell_test_apk
'target_name': 'chrome_shell_test_apk',
'type': 'none',
'dependencies': [
Expand All @@ -2888,6 +2889,7 @@
'includes': [ '../build/java_apk.gypi' ],
},
{
# GN: //chrome/test/chromedriver/test/webview_shell:chromedriver_webview_shell_apk
'target_name': 'chromedriver_webview_shell_apk',
'type': 'none',
'variables': {
Expand All @@ -2898,6 +2900,7 @@
'includes': [ '../build/java_apk.gypi' ],
},
{
# GN: //chrome/android:uiautomator_tests_java
'target_name': 'chrome_shell_uiautomator_tests_java',
'type': 'none',
'variables': {
Expand All @@ -2910,6 +2913,7 @@
'includes': [ '../build/java.gypi' ],
},
{
# GN: //chrome/android:uiautomator_tests
'target_name': 'chrome_shell_uiautomator_tests',
'type': 'none',
'dependencies': [
Expand All @@ -2918,6 +2922,7 @@
'includes': [ '../build/uiautomator_test.gypi' ],
},
{
# GN: //chrome/android:chrome_sync_shell_test_apk
'target_name': 'chrome_sync_shell_test_apk',
'type': 'none',
'dependencies': [
Expand All @@ -2937,6 +2942,7 @@
'includes': [ '../build/java_apk.gypi' ],
},
{
# GN: //chrome/test/android:chrome_java_test_support
'target_name': 'chrome_java_test_support',
'type': 'none',
'variables': {
Expand Down
23 changes: 23 additions & 0 deletions chrome/test/android/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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.

import("//build/config/android/rules.gni")


# GYP: //chrome/chrome_tests.gypi:chrome_java_test_support
android_library("chrome_java_test_support") {
testonly = true
DEPRECATED_java_in_dir = "javatests/src"
deps = [
"//base:base_java",
"//base:base_java_test_support",
"//chrome/android:chrome_java",
"//chrome/android:chrome_java_resources",
"//components/invalidation:java",
"//content/public/android:content_java",
"//content/public/test/android:content_java_test_support",
"//sync/android:sync_java",
"//sync:sync_java_test_support",
]
}
18 changes: 18 additions & 0 deletions chrome/test/chromedriver/test/webview_shell/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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.

import("//build/config/android/rules.gni")


# GYP: //chrome/chrome_tests.gypi:chrome_shell_test_apk
android_resources("chromedriver_webview_shell_resources") {
resource_dirs = [ "java/res" ]
android_manifest = "java/AndroidManifest.xml"
}
android_apk("chromedriver_webview_shell_apk") {
apk_name = "ChromeDriverWebViewShell"
deps = [ ":chromedriver_webview_shell_resources" ]
DEPRECATED_java_in_dir = "java/src"
android_manifest = "java/AndroidManifest.xml"
}
6 changes: 3 additions & 3 deletions components/bookmarks.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
['OS=="android"', {
'targets': [
{
# GN: //components/common/android:bookmarks_java
# GN: //components/bookmarks/common/android:bookmarks_java
'target_name': 'bookmarks_java',
'type': 'none',
'dependencies': [
Expand All @@ -138,7 +138,7 @@
'includes': [ '../build/java.gypi' ],
},
{
# GN: //components/common/android:bookmarks_jni_headers
# GN: //components/bookmarks/common/android:bookmarks_jni_headers
'target_name': 'bookmarks_jni_headers',
'type': 'none',
'sources': [
Expand All @@ -150,7 +150,7 @@
'includes': [ '../build/jni_generator.gypi' ],
},
{
# GN: //components/common/android:bookmarks_type_javagen
# GN: //components/bookmarks/common/android:bookmarks_type_javagen
'target_name': 'bookmark_type_java',
'type': 'none',
'sources': [
Expand Down

0 comments on commit 4fe114e

Please sign in to comment.