Merge "Revert "setup robolectric for sysui"" into tm-qpr-dev-plus-aosp
This commit is contained in:
committed by
Android (Google) Code Review
commit
4ed034f28a
@@ -167,8 +167,9 @@ java_library {
|
|||||||
}
|
}
|
||||||
|
|
||||||
android_library {
|
android_library {
|
||||||
name: "SystemUI-tests-base",
|
name: "SystemUI-tests",
|
||||||
manifest: "tests/AndroidManifest-base.xml",
|
manifest: "tests/AndroidManifest-base.xml",
|
||||||
|
additional_manifests: ["tests/AndroidManifest.xml"],
|
||||||
|
|
||||||
resource_dirs: [
|
resource_dirs: [
|
||||||
"tests/res",
|
"tests/res",
|
||||||
@@ -176,6 +177,15 @@ android_library {
|
|||||||
"res-keyguard",
|
"res-keyguard",
|
||||||
"res",
|
"res",
|
||||||
],
|
],
|
||||||
|
srcs: [
|
||||||
|
"tests/src/**/*.kt",
|
||||||
|
"tests/src/**/*.java",
|
||||||
|
"src/**/*.kt",
|
||||||
|
"src/**/*.java",
|
||||||
|
"src/**/I*.aidl",
|
||||||
|
":ReleaseJavaFiles",
|
||||||
|
":SystemUI-tests-utils",
|
||||||
|
],
|
||||||
static_libs: [
|
static_libs: [
|
||||||
"WifiTrackerLib",
|
"WifiTrackerLib",
|
||||||
"SystemUIAnimationLib",
|
"SystemUIAnimationLib",
|
||||||
@@ -214,6 +224,9 @@ android_library {
|
|||||||
"metrics-helper-lib",
|
"metrics-helper-lib",
|
||||||
"hamcrest-library",
|
"hamcrest-library",
|
||||||
"androidx.test.rules",
|
"androidx.test.rules",
|
||||||
|
"androidx.test.uiautomator_uiautomator",
|
||||||
|
"mockito-target-extended-minus-junit4",
|
||||||
|
"androidx.test.ext.junit",
|
||||||
"testables",
|
"testables",
|
||||||
"truth-prebuilt",
|
"truth-prebuilt",
|
||||||
"monet",
|
"monet",
|
||||||
@@ -228,36 +241,6 @@ android_library {
|
|||||||
"android.test.base",
|
"android.test.base",
|
||||||
"android.test.mock",
|
"android.test.mock",
|
||||||
],
|
],
|
||||||
}
|
|
||||||
|
|
||||||
// Device tests only
|
|
||||||
android_library {
|
|
||||||
name: "SystemUI-tests",
|
|
||||||
manifest: "tests/AndroidManifest.xml",
|
|
||||||
additional_manifests: ["tests/AndroidManifest.xml"],
|
|
||||||
resource_dirs: [],
|
|
||||||
srcs: [
|
|
||||||
// Kotlin likes all files in the same module for internal
|
|
||||||
"src/**/*.kt",
|
|
||||||
"src/**/*.java",
|
|
||||||
"src/**/I*.aidl",
|
|
||||||
":ReleaseJavaFiles",
|
|
||||||
"tests/src/**/*.kt",
|
|
||||||
"tests/src/**/*.java",
|
|
||||||
":SystemUI-tests-utils",
|
|
||||||
],
|
|
||||||
dont_merge_manifests: true,
|
|
||||||
static_libs: [
|
|
||||||
"SystemUI-tests-base",
|
|
||||||
"androidx.test.uiautomator_uiautomator",
|
|
||||||
"mockito-target-extended-minus-junit4",
|
|
||||||
"androidx.test.ext.junit",
|
|
||||||
],
|
|
||||||
libs: [
|
|
||||||
"android.test.runner",
|
|
||||||
"android.test.base",
|
|
||||||
"android.test.mock",
|
|
||||||
],
|
|
||||||
kotlincflags: ["-Xjvm-default=enable"],
|
kotlincflags: ["-Xjvm-default=enable"],
|
||||||
aaptflags: [
|
aaptflags: [
|
||||||
"--extra-packages",
|
"--extra-packages",
|
||||||
@@ -269,58 +252,6 @@ android_library {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
android_app {
|
|
||||||
name: "SystemUIRobo-stub",
|
|
||||||
defaults: [
|
|
||||||
"platform_app_defaults",
|
|
||||||
"SystemUI_app_defaults",
|
|
||||||
],
|
|
||||||
srcs: [
|
|
||||||
"src/**/*.kt",
|
|
||||||
"src/**/*.java",
|
|
||||||
"src/**/I*.aidl",
|
|
||||||
":ReleaseJavaFiles",
|
|
||||||
],
|
|
||||||
manifest: "tests/AndroidManifest-base.xml",
|
|
||||||
static_libs: [
|
|
||||||
"SystemUI-tests-base",
|
|
||||||
],
|
|
||||||
aaptflags: [
|
|
||||||
"--extra-packages",
|
|
||||||
"com.android.systemui",
|
|
||||||
],
|
|
||||||
dont_merge_manifests: true,
|
|
||||||
platform_apis: true,
|
|
||||||
system_ext_specific: true,
|
|
||||||
certificate: "platform",
|
|
||||||
privileged: true,
|
|
||||||
resource_dirs: [],
|
|
||||||
|
|
||||||
kotlincflags: ["-Xjvm-default=enable"],
|
|
||||||
dxflags: ["--multi-dex"],
|
|
||||||
required: [
|
|
||||||
"privapp_whitelist_com.android.systemui",
|
|
||||||
],
|
|
||||||
plugins: ["dagger2-compiler"],
|
|
||||||
}
|
|
||||||
|
|
||||||
android_robolectric_test {
|
|
||||||
name: "SystemUiRoboTests",
|
|
||||||
srcs: [
|
|
||||||
"tests/robolectric/src/**/*.kt",
|
|
||||||
"tests/robolectric/src/**/*.java",
|
|
||||||
],
|
|
||||||
libs: [
|
|
||||||
"android.test.runner",
|
|
||||||
"android.test.base",
|
|
||||||
"android.test.mock",
|
|
||||||
"truth-prebuilt",
|
|
||||||
],
|
|
||||||
kotlincflags: ["-Xjvm-default=enable"],
|
|
||||||
instrumentation_for: "SystemUIRobo-stub",
|
|
||||||
java_resource_dirs: ["tests/robolectric/config"],
|
|
||||||
}
|
|
||||||
|
|
||||||
// Opt-out config for optimizing the SystemUI target using R8.
|
// Opt-out config for optimizing the SystemUI target using R8.
|
||||||
// Disabled via `export SYSTEMUI_OPTIMIZE_JAVA=false`, or explicitly in Make via
|
// Disabled via `export SYSTEMUI_OPTIMIZE_JAVA=false`, or explicitly in Make via
|
||||||
// `SYSTEMUI_OPTIMIZE_JAVA := false`.
|
// `SYSTEMUI_OPTIMIZE_JAVA := false`.
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (C) 2022 The Android Open Source Project
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
#
|
|
||||||
sdk=NEWEST_SDK
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2022 The Android Open Source Project
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.android.systemui.robotests;
|
|
||||||
|
|
||||||
import androidx.test.filters.SmallTest;
|
|
||||||
import androidx.test.runner.AndroidJUnit4;
|
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
@SmallTest
|
|
||||||
@RunWith(AndroidJUnit4.class)
|
|
||||||
public class SysuiResourceLoadingTest extends SysuiRoboBase {
|
|
||||||
@Test
|
|
||||||
public void testResources() {
|
|
||||||
assertThat(getContext().getString(com.android.systemui.R.string.app_label))
|
|
||||||
.isEqualTo("System UI");
|
|
||||||
assertThat(getContext().getString(com.android.systemui.tests.R.string.test_content))
|
|
||||||
.isNotEmpty();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2022 The Android Open Source Project
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.android.systemui.robotests;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
import androidx.test.InstrumentationRegistry;
|
|
||||||
|
|
||||||
public class SysuiRoboBase {
|
|
||||||
public Context getContext() {
|
|
||||||
return InstrumentationRegistry.getContext();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user