Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 02d81c0c authored by Andrei Onea's avatar Andrei Onea
Browse files

Revert "Revert submission from topic "separate-testing"."

This reverts commit 44d9a1d8.
Re-land testing for compatibility change gating. This should fix the art
buildbot breakage.

Bug: 140367850
Test: atest PlatformCompatGating
Test: art/tools/buildbot-build.sh --host
Change-Id: I1070e5e62aed67f1b09044b84674b06afc85c8cc
parent e21cd46d
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -170,6 +170,15 @@ interface IPlatformCompat
     */
    void clearOverrides(in String packageName);

    /**
     * Revert overrides to compatibility changes. Doesn't kill the app, to be only used in tests.
     *
     * @param packageName The package name of the app whose overrides will be cleared.
     *
     */
    void clearOverridesForTest(in String packageName);


    /**
     * Get configs for an application.
     *
+6 −0
Original line number Diff line number Diff line
@@ -125,6 +125,12 @@ public class PlatformCompat extends IPlatformCompat.Stub {
        killPackage(packageName);
    }

    @Override
    public void clearOverridesForTest(String packageName) {
        CompatConfig config = CompatConfig.get();
        config.removePackageOverrides(packageName);
    }

    @Override
    public boolean clearOverride(long changeId, String packageName) {
        boolean existed = CompatConfig.get().removeOverride(changeId, packageName);
+33 −0
Original line number Diff line number Diff line
//
// Copyright (C) 2019 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.
//

android_test {
    name: "PlatformCompatGating",
    // Only compile source java files in this apk.
    srcs: ["src/**/*.java"],
    certificate: "platform",
    libs: [
        "android.test.runner",
        "android.test.base",
    ],
    static_libs: [
        "junit",
        "android-support-test",
        "mockito-target-minus-junit4",
        "truth-prebuilt",
        "platform-compat-test-rules"
    ],
}
+11 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.android.tests.gating">
    <application android:label="GatingTest">
        <uses-library android:name="android.test.runner" />
    </application>

    <instrumentation android:name="android.support.test.runner.AndroidJUnitRunner"
                     android:targetPackage="com.android.tests.gating"/>
</manifest>
+30 −0
Original line number Diff line number Diff line
<!-- Copyright (C) 2018 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.
-->
<configuration description="Test compatibility change gating.">
    <target_preparer class="com.android.tradefed.targetprep.TestFilePushSetup"/>
    <target_preparer class="com.android.tradefed.targetprep.TestAppInstallSetup">
        <option name="test-file-name" value="PlatformCompatGating.apk"/>
    </target_preparer>
    <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer"/>
    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer"/>
    <option name="test-suite-tag" value="apct"/>
    <option name="test-tag" value="Gating"/>

    <test class="com.android.tradefed.testtype.AndroidJUnitTest">
        <option name="package" value="com.android.tests.gating"/>
        <option name="runner" value="android.support.test.runner.AndroidJUnitRunner"/>
        <option name="hidden-api-checks" value="false"/>
    </test>
</configuration>
Loading