summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/HwAccelerationTest/src/com/android/test/hwui/GLTextureViewActivity.java52
-rw-r--r--tests/RenderScriptTests/FBOTest/res/drawable-nodpi/robot.png (renamed from tests/RenderScriptTests/FBOTest/res/drawable/robot.png)bin292580 -> 292580 bytes
-rw-r--r--tests/RenderScriptTests/ImageProcessing/res/drawable-nodpi/city.png (renamed from tests/RenderScriptTests/ImageProcessing/res/drawable/city.png)bin611708 -> 611708 bytes
-rw-r--r--tests/RenderScriptTests/ModelViewer/res/drawable-nodpi/robot.png (renamed from tests/RenderScriptTests/ModelViewer/res/drawable/robot.png)bin292580 -> 292580 bytes
-rw-r--r--tests/RenderScriptTests/PerfTest/res/drawable-nodpi/checker.png (renamed from tests/RenderScriptTests/PerfTest/res/drawable/checker.png)bin3732 -> 3732 bytes
-rw-r--r--tests/RenderScriptTests/PerfTest/res/drawable-nodpi/data.png (renamed from tests/RenderScriptTests/PerfTest/res/drawable/data.png)bin97800 -> 97800 bytes
-rw-r--r--tests/RenderScriptTests/PerfTest/res/drawable-nodpi/flares.png (renamed from tests/RenderScriptTests/PerfTest/res/drawable/flares.png)bin413 -> 413 bytes
-rwxr-xr-xtests/RenderScriptTests/PerfTest/res/drawable-nodpi/globe.png (renamed from tests/RenderScriptTests/PerfTest/res/drawable/globe.png)bin4142 -> 4142 bytes
-rw-r--r--tests/RenderScriptTests/PerfTest/res/drawable-nodpi/leaf.png (renamed from tests/RenderScriptTests/PerfTest/res/drawable/leaf.png)bin18837 -> 18837 bytes
-rw-r--r--tests/RenderScriptTests/PerfTest/res/drawable-nodpi/light1.jpg (renamed from tests/RenderScriptTests/PerfTest/res/drawable/light1.jpg)bin11314 -> 11314 bytes
-rw-r--r--tests/RenderScriptTests/PerfTest/res/drawable-nodpi/space.jpg (renamed from tests/RenderScriptTests/PerfTest/res/drawable/space.jpg)bin137126 -> 137126 bytes
-rw-r--r--tests/RenderScriptTests/PerfTest/res/drawable-nodpi/test_pattern.png (renamed from tests/RenderScriptTests/PerfTest/res/drawable/test_pattern.png)bin307 -> 307 bytes
-rw-r--r--tests/RenderScriptTests/PerfTest/res/drawable-nodpi/torusmap.png (renamed from tests/RenderScriptTests/PerfTest/res/drawable/torusmap.png)bin47127 -> 47127 bytes
-rw-r--r--tests/RenderScriptTests/tests/res/drawable-nodpi/test_pattern.png (renamed from tests/RenderScriptTests/tests/res/drawable/test_pattern.png)bin307 -> 307 bytes
-rw-r--r--tests/TileBenchmark/res/values/strings.xml2
-rw-r--r--tests/TileBenchmark/src/com/test/tilebenchmark/ProfileActivity.java14
-rw-r--r--tests/TileBenchmark/src/com/test/tilebenchmark/ProfiledWebView.java51
-rw-r--r--tests/TileBenchmark/tests/src/com/test/tilebenchmark/PerformanceTest.java2
18 files changed, 54 insertions, 67 deletions
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/GLTextureViewActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/GLTextureViewActivity.java
index e77178d..3232eed 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/GLTextureViewActivity.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/GLTextureViewActivity.java
@@ -33,7 +33,6 @@ import android.view.ViewGroup;
import android.widget.FrameLayout;
import javax.microedition.khronos.egl.EGL10;
-import javax.microedition.khronos.egl.EGL11;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.egl.EGLContext;
import javax.microedition.khronos.egl.EGLDisplay;
@@ -207,7 +206,7 @@ public class GLTextureViewActivity extends Activity implements TextureView.Surfa
glEnableVertexAttribArray(attribTexCoords);
checkGlError();
- glUniform1i(texture, 0);
+ glUniform1i(uniformTexture, texture);
checkGlError();
while (!mFinished) {
@@ -350,7 +349,7 @@ public class GLTextureViewActivity extends Activity implements TextureView.Surfa
!mEglSurface.equals(mEgl.eglGetCurrentSurface(EGL10.EGL_DRAW))) {
if (!mEgl.eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface, mEglContext)) {
throw new RuntimeException("eglMakeCurrent failed "
- + getEGLErrorString(mEgl.eglGetError()));
+ + GLUtils.getEGLErrorString(mEgl.eglGetError()));
}
}
}
@@ -361,13 +360,13 @@ public class GLTextureViewActivity extends Activity implements TextureView.Surfa
mEglDisplay = mEgl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
if (mEglDisplay == EGL10.EGL_NO_DISPLAY) {
throw new RuntimeException("eglGetDisplay failed "
- + getEGLErrorString(mEgl.eglGetError()));
+ + GLUtils.getEGLErrorString(mEgl.eglGetError()));
}
int[] version = new int[2];
if (!mEgl.eglInitialize(mEglDisplay, version)) {
throw new RuntimeException("eglInitialize failed " +
- getEGLErrorString(mEgl.eglGetError()));
+ GLUtils.getEGLErrorString(mEgl.eglGetError()));
}
mEglConfig = chooseEglConfig();
@@ -386,12 +385,12 @@ public class GLTextureViewActivity extends Activity implements TextureView.Surfa
return;
}
throw new RuntimeException("createWindowSurface failed "
- + getEGLErrorString(error));
+ + GLUtils.getEGLErrorString(error));
}
if (!mEgl.eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface, mEglContext)) {
throw new RuntimeException("eglMakeCurrent failed "
- + getEGLErrorString(mEgl.eglGetError()));
+ + GLUtils.getEGLErrorString(mEgl.eglGetError()));
}
mGL = mEglContext.getGL();
@@ -409,7 +408,7 @@ public class GLTextureViewActivity extends Activity implements TextureView.Surfa
int[] configSpec = getConfig();
if (!mEgl.eglChooseConfig(mEglDisplay, configSpec, configs, 1, configsCount)) {
throw new IllegalArgumentException("eglChooseConfig failed " +
- getEGLErrorString(mEgl.eglGetError()));
+ GLUtils.getEGLErrorString(mEgl.eglGetError()));
} else if (configsCount[0] > 0) {
return configs[0];
}
@@ -429,43 +428,6 @@ public class GLTextureViewActivity extends Activity implements TextureView.Surfa
};
}
- static String getEGLErrorString(int error) {
- switch (error) {
- case EGL10.EGL_SUCCESS:
- return "EGL_SUCCESS";
- case EGL10.EGL_NOT_INITIALIZED:
- return "EGL_NOT_INITIALIZED";
- case EGL10.EGL_BAD_ACCESS:
- return "EGL_BAD_ACCESS";
- case EGL10.EGL_BAD_ALLOC:
- return "EGL_BAD_ALLOC";
- case EGL10.EGL_BAD_ATTRIBUTE:
- return "EGL_BAD_ATTRIBUTE";
- case EGL10.EGL_BAD_CONFIG:
- return "EGL_BAD_CONFIG";
- case EGL10.EGL_BAD_CONTEXT:
- return "EGL_BAD_CONTEXT";
- case EGL10.EGL_BAD_CURRENT_SURFACE:
- return "EGL_BAD_CURRENT_SURFACE";
- case EGL10.EGL_BAD_DISPLAY:
- return "EGL_BAD_DISPLAY";
- case EGL10.EGL_BAD_MATCH:
- return "EGL_BAD_MATCH";
- case EGL10.EGL_BAD_NATIVE_PIXMAP:
- return "EGL_BAD_NATIVE_PIXMAP";
- case EGL10.EGL_BAD_NATIVE_WINDOW:
- return "EGL_BAD_NATIVE_WINDOW";
- case EGL10.EGL_BAD_PARAMETER:
- return "EGL_BAD_PARAMETER";
- case EGL10.EGL_BAD_SURFACE:
- return "EGL_BAD_SURFACE";
- case EGL11.EGL_CONTEXT_LOST:
- return "EGL_CONTEXT_LOST";
- default:
- return "0x" + Integer.toHexString(error);
- }
- }
-
void finish() {
mFinished = true;
}
diff --git a/tests/RenderScriptTests/FBOTest/res/drawable/robot.png b/tests/RenderScriptTests/FBOTest/res/drawable-nodpi/robot.png
index f7353fd..f7353fd 100644
--- a/tests/RenderScriptTests/FBOTest/res/drawable/robot.png
+++ b/tests/RenderScriptTests/FBOTest/res/drawable-nodpi/robot.png
Binary files differ
diff --git a/tests/RenderScriptTests/ImageProcessing/res/drawable/city.png b/tests/RenderScriptTests/ImageProcessing/res/drawable-nodpi/city.png
index 856eeff..856eeff 100644
--- a/tests/RenderScriptTests/ImageProcessing/res/drawable/city.png
+++ b/tests/RenderScriptTests/ImageProcessing/res/drawable-nodpi/city.png
Binary files differ
diff --git a/tests/RenderScriptTests/ModelViewer/res/drawable/robot.png b/tests/RenderScriptTests/ModelViewer/res/drawable-nodpi/robot.png
index f7353fd..f7353fd 100644
--- a/tests/RenderScriptTests/ModelViewer/res/drawable/robot.png
+++ b/tests/RenderScriptTests/ModelViewer/res/drawable-nodpi/robot.png
Binary files differ
diff --git a/tests/RenderScriptTests/PerfTest/res/drawable/checker.png b/tests/RenderScriptTests/PerfTest/res/drawable-nodpi/checker.png
index b631e1e..b631e1e 100644
--- a/tests/RenderScriptTests/PerfTest/res/drawable/checker.png
+++ b/tests/RenderScriptTests/PerfTest/res/drawable-nodpi/checker.png
Binary files differ
diff --git a/tests/RenderScriptTests/PerfTest/res/drawable/data.png b/tests/RenderScriptTests/PerfTest/res/drawable-nodpi/data.png
index 8e34714..8e34714 100644
--- a/tests/RenderScriptTests/PerfTest/res/drawable/data.png
+++ b/tests/RenderScriptTests/PerfTest/res/drawable-nodpi/data.png
Binary files differ
diff --git a/tests/RenderScriptTests/PerfTest/res/drawable/flares.png b/tests/RenderScriptTests/PerfTest/res/drawable-nodpi/flares.png
index 3a5c970..3a5c970 100644
--- a/tests/RenderScriptTests/PerfTest/res/drawable/flares.png
+++ b/tests/RenderScriptTests/PerfTest/res/drawable-nodpi/flares.png
Binary files differ
diff --git a/tests/RenderScriptTests/PerfTest/res/drawable/globe.png b/tests/RenderScriptTests/PerfTest/res/drawable-nodpi/globe.png
index f9d6172..f9d6172 100755
--- a/tests/RenderScriptTests/PerfTest/res/drawable/globe.png
+++ b/tests/RenderScriptTests/PerfTest/res/drawable-nodpi/globe.png
Binary files differ
diff --git a/tests/RenderScriptTests/PerfTest/res/drawable/leaf.png b/tests/RenderScriptTests/PerfTest/res/drawable-nodpi/leaf.png
index 3cd3775..3cd3775 100644
--- a/tests/RenderScriptTests/PerfTest/res/drawable/leaf.png
+++ b/tests/RenderScriptTests/PerfTest/res/drawable-nodpi/leaf.png
Binary files differ
diff --git a/tests/RenderScriptTests/PerfTest/res/drawable/light1.jpg b/tests/RenderScriptTests/PerfTest/res/drawable-nodpi/light1.jpg
index 2f2f10e..2f2f10e 100644
--- a/tests/RenderScriptTests/PerfTest/res/drawable/light1.jpg
+++ b/tests/RenderScriptTests/PerfTest/res/drawable-nodpi/light1.jpg
Binary files differ
diff --git a/tests/RenderScriptTests/PerfTest/res/drawable/space.jpg b/tests/RenderScriptTests/PerfTest/res/drawable-nodpi/space.jpg
index b61f6a3..b61f6a3 100644
--- a/tests/RenderScriptTests/PerfTest/res/drawable/space.jpg
+++ b/tests/RenderScriptTests/PerfTest/res/drawable-nodpi/space.jpg
Binary files differ
diff --git a/tests/RenderScriptTests/PerfTest/res/drawable/test_pattern.png b/tests/RenderScriptTests/PerfTest/res/drawable-nodpi/test_pattern.png
index e7d1455..e7d1455 100644
--- a/tests/RenderScriptTests/PerfTest/res/drawable/test_pattern.png
+++ b/tests/RenderScriptTests/PerfTest/res/drawable-nodpi/test_pattern.png
Binary files differ
diff --git a/tests/RenderScriptTests/PerfTest/res/drawable/torusmap.png b/tests/RenderScriptTests/PerfTest/res/drawable-nodpi/torusmap.png
index 1e08f3b..1e08f3b 100644
--- a/tests/RenderScriptTests/PerfTest/res/drawable/torusmap.png
+++ b/tests/RenderScriptTests/PerfTest/res/drawable-nodpi/torusmap.png
Binary files differ
diff --git a/tests/RenderScriptTests/tests/res/drawable/test_pattern.png b/tests/RenderScriptTests/tests/res/drawable-nodpi/test_pattern.png
index e7d1455..e7d1455 100644
--- a/tests/RenderScriptTests/tests/res/drawable/test_pattern.png
+++ b/tests/RenderScriptTests/tests/res/drawable-nodpi/test_pattern.png
Binary files differ
diff --git a/tests/TileBenchmark/res/values/strings.xml b/tests/TileBenchmark/res/values/strings.xml
index c4fd189..5af52dc 100644
--- a/tests/TileBenchmark/res/values/strings.xml
+++ b/tests/TileBenchmark/res/values/strings.xml
@@ -73,6 +73,8 @@
<string name="viewport_coverage">Coverage</string>
<!-- Milliseconds taken to inval, and re-render the page [CHAR LIMIT=15] -->
<string name="render_millis">RenderMillis</string>
+ <!-- Number of rendering stalls while running the test [CHAR LIMIT=15] -->
+ <string name="render_stalls">Stalls</string>
<!-- Format string for stat value overlay [CHAR LIMIT=15] -->
<string name="format_stat">%4.4f</string>
diff --git a/tests/TileBenchmark/src/com/test/tilebenchmark/ProfileActivity.java b/tests/TileBenchmark/src/com/test/tilebenchmark/ProfileActivity.java
index 82a7e82..e7a21ad 100644
--- a/tests/TileBenchmark/src/com/test/tilebenchmark/ProfileActivity.java
+++ b/tests/TileBenchmark/src/com/test/tilebenchmark/ProfileActivity.java
@@ -22,7 +22,6 @@ import android.content.Context;
import android.graphics.Bitmap;
import android.os.AsyncTask;
import android.os.Bundle;
-import android.os.CountDownTimer;
import android.util.Pair;
import android.view.KeyEvent;
import android.view.View;
@@ -55,8 +54,6 @@ public class ProfileActivity extends Activity {
}
public static final String TEMP_FILENAME = "profile.tiles";
- private static final int LOAD_TEST_DELAY = 1000; // nr of millis after load,
- // before test
Button mInspectButton;
ToggleButton mCaptureButton;
@@ -136,16 +133,7 @@ public class ProfileActivity extends Activity {
super.onPageFinished(view, url);
view.requestFocus();
- new CountDownTimer(LOAD_TEST_DELAY, LOAD_TEST_DELAY) {
- @Override
- public void onTick(long millisUntilFinished) {
- }
-
- @Override
- public void onFinish() {
- startViewProfiling(true);
- }
- }.start();
+ startViewProfiling(true);
}
@Override
diff --git a/tests/TileBenchmark/src/com/test/tilebenchmark/ProfiledWebView.java b/tests/TileBenchmark/src/com/test/tilebenchmark/ProfiledWebView.java
index 3fc4665..b1cef15 100644
--- a/tests/TileBenchmark/src/com/test/tilebenchmark/ProfiledWebView.java
+++ b/tests/TileBenchmark/src/com/test/tilebenchmark/ProfiledWebView.java
@@ -17,6 +17,7 @@
package com.test.tilebenchmark;
import android.content.Context;
+import android.os.CountDownTimer;
import android.util.AttributeSet;
import android.util.Log;
import android.webkit.WebView;
@@ -27,10 +28,14 @@ import com.test.tilebenchmark.RunData.TileData;
public class ProfiledWebView extends WebView {
private int mSpeed;
- private boolean isTesting = false;
- private boolean isScrolling = false;
+ private boolean mIsTesting = false;
+ private boolean mIsScrolling = false;
private ProfileCallback mCallback;
private long mContentInvalMillis;
+ private boolean mHadToBeForced = false;
+ private int mTestCount = 0;
+ private static final int LOAD_STALL_MILLIS = 5000; // nr of millis after load,
+ // before test is forced
public ProfiledWebView(Context context) {
super(context);
@@ -51,12 +56,12 @@ public class ProfiledWebView extends WebView {
@Override
protected void onDraw(android.graphics.Canvas canvas) {
- if (isTesting && isScrolling) {
+ if (mIsTesting && mIsScrolling) {
if (canScrollVertically(1)) {
scrollBy(0, mSpeed);
} else {
stopScrollTest();
- isScrolling = false;
+ mIsScrolling = false;
}
}
super.onDraw(canvas);
@@ -68,13 +73,36 @@ public class ProfiledWebView extends WebView {
* scrolling, invalidate all content and redraw it, measuring time taken.
*/
public void startScrollTest(ProfileCallback callback, boolean autoScrolling) {
- isScrolling = autoScrolling;
+ mIsScrolling = autoScrolling;
mCallback = callback;
- isTesting = false;
+ mIsTesting = false;
mContentInvalMillis = System.currentTimeMillis();
registerPageSwapCallback();
contentInvalidateAll();
invalidate();
+
+ mTestCount++;
+ final int testCount = mTestCount;
+
+ if (autoScrolling) {
+ // after a while, force it to start even if the pages haven't swapped
+ new CountDownTimer(LOAD_STALL_MILLIS, LOAD_STALL_MILLIS) {
+ @Override
+ public void onTick(long millisUntilFinished) {
+ }
+
+ @Override
+ public void onFinish() {
+ if (testCount == mTestCount && !mIsTesting) {
+ mHadToBeForced = true;
+ Log.d("ProfiledWebView", "num " + testCount
+ + " forcing a page swap with a scroll...");
+ scrollBy(0, 1);
+ invalidate(); // ensure a redraw so that auto-scrolling can occur
+ }
+ }
+ }.start();
+ }
}
/*
@@ -87,7 +115,7 @@ public class ProfiledWebView extends WebView {
super.pageSwapCallback();
Log.d("ProfiledWebView", "REDRAW TOOK " + mContentInvalMillis
+ "millis");
- isTesting = true;
+ mIsTesting = true;
invalidate(); // ensure a redraw so that auto-scrolling can occur
tileProfilingStart();
}
@@ -97,7 +125,7 @@ public class ProfiledWebView extends WebView {
*/
public void stopScrollTest() {
tileProfilingStop();
- isTesting = false;
+ mIsTesting = false;
if (mCallback == null) {
tileProfilingClear();
@@ -105,8 +133,15 @@ public class ProfiledWebView extends WebView {
}
RunData data = new RunData(super.tileProfilingNumFrames());
+ // record the time spent (before scrolling) rendering the page
data.singleStats.put(getResources().getString(R.string.render_millis),
(double)mContentInvalMillis);
+ // record if the page render timed out
+ Log.d("ProfiledWebView", "hadtobeforced = " + mHadToBeForced);
+ data.singleStats.put(getResources().getString(R.string.render_stalls),
+ mHadToBeForced ? 1.0 : 0.0);
+ mHadToBeForced = false;
+
for (int frame = 0; frame < data.frames.length; frame++) {
data.frames[frame] = new TileData[
tileProfilingNumTilesInFrame(frame)];
diff --git a/tests/TileBenchmark/tests/src/com/test/tilebenchmark/PerformanceTest.java b/tests/TileBenchmark/tests/src/com/test/tilebenchmark/PerformanceTest.java
index 0f02239..6bf6f6b 100644
--- a/tests/TileBenchmark/tests/src/com/test/tilebenchmark/PerformanceTest.java
+++ b/tests/TileBenchmark/tests/src/com/test/tilebenchmark/PerformanceTest.java
@@ -80,7 +80,7 @@ public class PerformanceTest extends
private static final String URL_POSTFIX = "/index.html?skip=true";
private static final int MAX_ITERATIONS = 4;
private static final String TEST_DIRS[] = {
- "alexa_us"//, "android", "dom", "intl1", "intl2", "moz", "moz2"
+ "intl1"//, "alexa_us", "android", "dom", "intl2", "moz", "moz2"
};
public PerformanceTest() {