forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an Android sample app for Telemetry tests.
The purpose of this app is to be launched and push other apps to the background during Android telemetry tests. It is just a super simple Android app. BUG=586148 Review URL: https://codereview.chromium.org/1744423002 Cr-Commit-Position: refs/heads/master@{#380680}
- Loading branch information
Showing
13 changed files
with
149 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!-- | ||
* Copyright 2016 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. | ||
--> | ||
|
||
<manifest | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="org.chromium.push_apps_to_background" | ||
android:versionCode="1" | ||
android:versionName="1.0" > | ||
|
||
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="23" /> | ||
|
||
<application | ||
android:icon="@drawable/ic_launcher" | ||
android:label="@string/app_name" | ||
android:theme="@android:style/Theme.Light" > | ||
<activity | ||
android:name="org.chromium.push_apps_to_background.PushAppsToBackgroundActivity" | ||
android:label="@string/title_activity_push_apps_to_background" | ||
android:exported="true"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Copyright 2016 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") | ||
import("//testing/test.gni") | ||
|
||
# Mark all targets as test only. | ||
testonly = true | ||
|
||
android_apk("push_apps_to_background_apk") { | ||
apk_name = "PushAppsToBackground" | ||
java_files = [ "src/org/chromium/push_apps_to_background/PushAppsToBackgroundActivity.java" ] | ||
android_manifest = "AndroidManifest.xml" | ||
deps = [ | ||
":push_apps_to_background_apk_resources", | ||
] | ||
} | ||
|
||
android_resources("push_apps_to_background_apk_resources") { | ||
resource_dirs = [ "res" ] | ||
custom_package = "org.chromium.push_apps_to_background" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
mikecase@chromium.org | ||
perezju@chromium.org |
21 changes: 21 additions & 0 deletions
21
tools/android/push_apps_to_background/push_apps_to_background.gyp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright 2016 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. | ||
{ | ||
'targets': [ | ||
# GN: //tools/android/push_apps_to_background:push_apps_to_background_apk | ||
{ | ||
'target_name': 'push_apps_to_background_apk', | ||
'type': 'none', | ||
'variables': { | ||
'apk_name': 'PushAppsToBackground', | ||
'java_in_dir': '.', | ||
'resource_dir': 'res', | ||
'android_manifest_path': 'AndroidManifest.xml', | ||
}, | ||
'includes': [ | ||
'../../../build/java_apk.gypi', | ||
], | ||
}, | ||
], | ||
} |
Binary file added
BIN
+9.18 KB
tools/android/push_apps_to_background/res/drawable-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions
19
tools/android/push_apps_to_background/res/layout/activity_push_apps_to_background.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright 2016 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. | ||
--> | ||
|
||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:id="@+id/container" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical" | ||
android:gravity="center"> | ||
<TextView | ||
android:id="@+id/text_view" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:text="@string/push_apps_to_background_message" /> | ||
</LinearLayout> |
15 changes: 15 additions & 0 deletions
15
tools/android/push_apps_to_background/res/values/strings.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright 2016 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. | ||
--> | ||
|
||
<resources> | ||
<string name="app_name">Push Apps To Background</string> | ||
<string name="push_apps_to_background_message"> | ||
"<b>What is my purpose?</b>\n | ||
<i>You push apps to the background.</i>\n | ||
<b>Oh my God</b>." | ||
</string> | ||
<string name="title_activity_push_apps_to_background">Push Apps To Background</string> | ||
</resources> |
21 changes: 21 additions & 0 deletions
21
..._to_background/src/org/chromium/push_apps_to_background/PushAppsToBackgroundActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright 2016 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. | ||
|
||
package org.chromium.push_apps_to_background; | ||
|
||
import android.app.Activity; | ||
import android.os.Bundle; | ||
|
||
/** | ||
* This activity is used in performance tests to push other apps | ||
* to the background while running automated user stories. | ||
*/ | ||
public class PushAppsToBackgroundActivity extends Activity { | ||
|
||
@Override | ||
public void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_push_apps_to_background); | ||
} | ||
} |