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

Commit 8cfe7622 authored by ramindani's avatar ramindani Committed by Rachel Lee
Browse files

Attached choreographer tests

Creates an attached Choreographer and
listens for the vsync with a 10Hz and 30Hz refresh rate
Verify callbacks on the attached choreographer
and no callbacks when released.

Test: atest ChoreographerTests
BUG: 258235754
Change-Id: I2f981e6929ff9a5406730d53aa96a7299eb830b8
parent b13f16cf
Loading
Loading
Loading
Loading
+46 −0
Original line number Diff line number Diff line
// Copyright 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: "ChoreographerTests",
    srcs: ["src/**/*.java"],
    libs: [
        "android.test.runner",
        "android.test.base",
    ],
    static_libs: [
        "androidx.test.core",
        "androidx.test.ext.junit",
        "androidx.test.rules",
        "compatibility-device-util-axt",
        "com.google.android.material_material",
        "truth-prebuilt",
    ],
    resource_dirs: ["src/main/res"],
    certificate: "platform",
    platform_apis: true,
    test_suites: ["device-tests"],
    optimize: {
        enabled: false,
    },
}
+33 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright 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="android.view.choreographertests">

    <application android:debuggable="true" android:testOnly="true">
        <uses-library android:name="android.test.runner"/>
        <activity
            android:name=".GraphicsActivity"
            android:exported="false">
        </activity>
    </application>

    <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
        android:targetPackage="android.view.choreographertests"
        android:label="Tests of android.view.ChoreographerTests">
    </instrumentation>
</manifest>
 No newline at end of file
+30 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright 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="Config for ChoreographerTests cases">
    <option name="test-suite-tag" value="cts" />
    <option name="test-tag" value="ChoreographerTests"/>
    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
        <option name="cleanup-apks" value="true" />
        <option name="install-arg" value="-t" />
        <option name="test-file-name" value="ChoreographerTests.apk" />
    </target_preparer>
    <test class="com.android.tradefed.testtype.AndroidJUnitTest" >
        <option name="package" value="android.view.choreographertests" />
        <option name="hidden-api-checks" value="false" />
        <option name="isolated-storage" value="false" />
    </test>
</configuration>
 No newline at end of file
+2 −0
Original line number Diff line number Diff line
include platform/frameworks/base:/graphics/java/android/graphics/OWNERS
include platform/frameworks/native:/services/surfaceflinger/OWNERS
 No newline at end of file
+7 −0
Original line number Diff line number Diff line
{
  "presubmit": [
    {
      "name": "ChoreographerTests"
    }
  ]
}
 No newline at end of file
Loading