From 0006952a8dc5a115cceb597ac53ec5bce703fd4f Mon Sep 17 00:00:00 2001 From: Guang Zhu Date: Mon, 6 Dec 2010 11:17:38 -0800 Subject: [PATCH] change how assets are copied out of apk Currently test code use getActivity to get DRT's assets. However the side effect is that this will actually launch the activity. This is not affecting any tests yet, however there are cleaner ways to do this. The instrumentation framework provides a getTargetContext call which will give access to app under test's context, and therefore granting access to its assets. Change-Id: I0560b0fa5681f80bcb9296beec3fd0549c40cc8e --- .../android/dumprendertree/LayoutTestsAutoTest.java | 10 +++++++--- .../com/android/dumprendertree/LoadTestsAutoTest.java | 10 ++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java b/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java index 132f17ad0d556..8aa3c690b3794 100644 --- a/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java +++ b/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java @@ -20,6 +20,7 @@ import com.android.dumprendertree.TestShellActivity.DumpDataType; import com.android.dumprendertree.forwarder.AdbUtils; import com.android.dumprendertree.forwarder.ForwardService; +import android.content.Context; import android.content.Intent; import android.os.Environment; import android.test.ActivityInstrumentationTestCase2; @@ -471,11 +472,14 @@ public class LayoutTestsAutoTest extends ActivityInstrumentationTestCase2