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

Commit fed46624 authored by Winson Chung's avatar Winson Chung Committed by Automerger Merge Worker
Browse files

Merge "Removing legacy launcher winscope tracing for tests" into udc-dev am:...

Merge "Removing legacy launcher winscope tracing for tests" into udc-dev am: 883871e2 am: 395ed225

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/23384355



Change-Id: I235ed03d74f0317a17249dfc19bbdf47fa580416
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents ec06cd10 395ed225
Loading
Loading
Loading
Loading
+0 −19
Original line number Original line Diff line number Diff line
@@ -2,7 +2,6 @@ package com.android.launcher3.util.rule;


import static androidx.test.InstrumentationRegistry.getInstrumentation;
import static androidx.test.InstrumentationRegistry.getInstrumentation;


import android.content.Context;
import android.os.FileUtils;
import android.os.FileUtils;
import android.os.ParcelFileDescriptor.AutoCloseInputStream;
import android.os.ParcelFileDescriptor.AutoCloseInputStream;
import android.util.Log;
import android.util.Log;
@@ -54,27 +53,9 @@ public class FailureWatcher extends TestWatcher {
        return new Statement() {
        return new Statement() {
            @Override
            @Override
            public void evaluate() throws Throwable {
            public void evaluate() throws Throwable {
                boolean success = false;
                try {
                try {
                    mDevice.executeShellCommand("cmd statusbar tracing start");
                    FailureWatcher.super.apply(base, description).evaluate();
                    FailureWatcher.super.apply(base, description).evaluate();
                    success = true;
                } finally {
                } finally {
                    // Save artifact for Launcher Winscope trace.
                    mDevice.executeShellCommand("cmd statusbar tracing stop");
                    final Context nexusLauncherContext =
                            getInstrumentation().getTargetContext()
                                    .createPackageContext("com.google.android.apps.nexuslauncher",
                                            0);
                    final File launcherTrace =
                            new File(nexusLauncherContext.getFilesDir(), "launcher_trace.pb");
                    if (success) {
                        mDevice.executeShellCommand("rm " + launcherTrace);
                    } else {
                        mDevice.executeShellCommand("mv " + launcherTrace + " "
                                + diagFile(description, "LauncherWinscope", "pb"));
                    }

                    // Detect touch events coming from physical screen.
                    // Detect touch events coming from physical screen.
                    if (mLauncher.hadNontestEvents()) {
                    if (mLauncher.hadNontestEvents()) {
                        throw new AssertionError(
                        throw new AssertionError(