Loading tests/src/com/android/launcher3/util/rule/FailureWatcher.java +0 −19 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ package com.android.launcher3.util.rule; import static androidx.test.InstrumentationRegistry.getInstrumentation; import android.content.Context; import android.os.FileUtils; import android.os.ParcelFileDescriptor.AutoCloseInputStream; import android.util.Log; Loading Loading @@ -54,27 +53,9 @@ public class FailureWatcher extends TestWatcher { return new Statement() { @Override public void evaluate() throws Throwable { boolean success = false; try { mDevice.executeShellCommand("cmd statusbar tracing start"); FailureWatcher.super.apply(base, description).evaluate(); success = true; } 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. if (mLauncher.hadNontestEvents()) { throw new AssertionError( Loading Loading
tests/src/com/android/launcher3/util/rule/FailureWatcher.java +0 −19 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ package com.android.launcher3.util.rule; import static androidx.test.InstrumentationRegistry.getInstrumentation; import android.content.Context; import android.os.FileUtils; import android.os.ParcelFileDescriptor.AutoCloseInputStream; import android.util.Log; Loading Loading @@ -54,27 +53,9 @@ public class FailureWatcher extends TestWatcher { return new Statement() { @Override public void evaluate() throws Throwable { boolean success = false; try { mDevice.executeShellCommand("cmd statusbar tracing start"); FailureWatcher.super.apply(base, description).evaluate(); success = true; } 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. if (mLauncher.hadNontestEvents()) { throw new AssertionError( Loading