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

Commit d4a5fc58 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Add TEST_MAPPING to schedule auto test" am: 5c262a92 am: 374153a5

Change-Id: Ibc8da453623946b48b0b0cb8b9ad05295a1ad80c
parents 8ef20ea9 374153a5
Loading
Loading
Loading
Loading

TEST_MAPPING

0 → 100644
+15 −0
Original line number Diff line number Diff line
{
  "postsubmit": [
    {
      "name": "SettingsUnitTests",
      "options": [
        {
          "exclude-annotation": "androidx.test.filters.FlakyTest"
        }
      ]
    },
    {
      "name": "SettingsPerfTests"
    }
  ]
}
+22 −0
Original line number Diff line number Diff line
android_test {
    name: "SettingsPerfTests",

    certificate: "platform",

    libs: [
        "android.test.runner",
    ],

    static_libs: [
        "androidx.test.rules",
        "ub-uiautomator",
    ],

    // Include all test java files.
    srcs: ["src/**/*.java"],

    platform_apis: true,
    test_suites: ["device-tests"],

    instrumentation_for: "Settings",
}
+29 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2020 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.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.android.settings.tests.perf">

    <application>
        <uses-library android:name="android.test.runner" />
    </application>

    <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
        android:targetPackage="com.android.settings"
        android:label="Settings Performance Test Cases">
    </instrumentation>

</manifest>
+48 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2020 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.settings.tests.perf;

import android.app.Instrumentation;
import android.os.Bundle;

import androidx.test.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(AndroidJUnit4.class)
public class LaunchSettingsTest {

    @Before
    public void setUp() throws Exception {
    }

    @After
    public void tearDown() throws Exception {
    }

    @Test
    public void testReportMetrics() throws Exception {
        Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
        final Bundle result = new Bundle();
        result.putString("LaunchSettingsTest_metric_key1", "1000");
        result.putString("LaunchSettingsTest_metric_key2", "5000");
        instrumentation.sendStatus(0, result);
    }
}