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

Commit 7f0a1a40 authored by Robert Wu's avatar Robert Wu
Browse files

MIDI: Add test for MidiEventMultiScheduler

This CL adds a new folder in frameworks/base for MIDI tests.
This folder can act as a folder for unit tests.

A new test is added for MidiEventMultiScheduler.
com.android.internal.midi is used so this test has to be here.

Bug: 266473128
Test: atest MidiTests --rebuild-module-info
Change-Id: If0d33bd46f8c8adf3a3425888f469f942594aca9
parent ca9e2463
Loading
Loading
Loading
Loading
+40 −0
Original line number Diff line number Diff line
//
// Copyright (C) 2023 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 {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "frameworks_base_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["frameworks_base_license"],
}

android_test {
    name: "MidiTests",
    srcs: ["**/*.java"],
    static_libs: [
        "androidx.test.rules",
        "mockito-target-inline-minus-junit4",
        "platform-test-annotations",
        "services.midi",
        "truth-prebuilt",
    ],
    jni_libs: ["libdexmakerjvmtiagent"],
    certificate: "platform",
    platform_apis: true,
    test_suites: ["device-tests"],
}
+30 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2023 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.server.midi" >

    <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" />
    <uses-permission android:name="android.permission.MANAGE_USERS" />

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

    <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
                     android:targetPackage="com.android.server.midi"
                     android:label="MidiTests"/>
</manifest>
+30 −0
Original line number Diff line number Diff line
<!-- Copyright (C) 2023 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="Runs sample instrumentation test.">
    <target_preparer class="com.android.tradefed.targetprep.TestFilePushSetup"/>
    <target_preparer class="com.android.tradefed.targetprep.TestAppInstallSetup">
        <option name="test-file-name" value="MidiTests.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="MidiTests"/>

    <test class="com.android.tradefed.testtype.AndroidJUnitTest">
        <option name="package" value="com.android.server.midi"/>
        <option name="runner" value="androidx.test.runner.AndroidJUnitRunner"/>
        <option name="hidden-api-checks" value="false"/>
    </test>
</configuration>

tests/MidiTests/OWNERS

0 → 100644
+1 −0
Original line number Diff line number Diff line
include /services/midi/OWNERS
+7 −0
Original line number Diff line number Diff line
{
  "presubmit": [
    {
      "name": "MidiTests"
    }
  ]
}
Loading