diff options
author | Chris Craik <ccraik@google.com> | 2012-04-19 15:08:47 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2012-04-19 15:08:47 -0700 |
commit | 9e6fa17b475a537605f9673c3a065c28ea29bb91 (patch) | |
tree | 050d4cb71219ba77569bb0d047bb2f574406c2d0 /tests | |
parent | d7f256dd2f31ec74c8154f783a660dfe3e55b036 (diff) | |
download | frameworks_base-9e6fa17b475a537605f9673c3a065c28ea29bb91.zip frameworks_base-9e6fa17b475a537605f9673c3a065c28ea29bb91.tar.gz frameworks_base-9e6fa17b475a537605f9673c3a065c28ea29bb91.tar.bz2 |
Add useMinimalMemory=true test to TileBenchmark
Change-Id: I1d0d0eebbf0847fe03dfbc7176275a40e7ca0c52
Diffstat (limited to 'tests')
-rw-r--r-- | tests/TileBenchmark/src/com/test/tilebenchmark/PerformanceTest.java | 16 | ||||
-rw-r--r-- | tests/TileBenchmark/src/com/test/tilebenchmark/ProfiledWebView.java | 5 |
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/TileBenchmark/src/com/test/tilebenchmark/PerformanceTest.java b/tests/TileBenchmark/src/com/test/tilebenchmark/PerformanceTest.java index 6356cc1..5763ad3 100644 --- a/tests/TileBenchmark/src/com/test/tilebenchmark/PerformanceTest.java +++ b/tests/TileBenchmark/src/com/test/tilebenchmark/PerformanceTest.java @@ -276,6 +276,22 @@ public class PerformanceTest extends } } + public void testMetricsMinimalMemory() { + mActivity.runOnUiThread(new Runnable() { + @Override + public void run() { + mWeb.setUseMinimalMemory(true); + } + }); + + setScrollingTestingMode(true); + if (checkMedia() && runTestDirs(SCROLL_TEST_DIRS)) { + getInstrumentation().sendStatus(0, mStats.getBundle()); + } else { + getInstrumentation().sendStatus(1, null); + } + } + private boolean runAnimationTests() { for (int doubleBuffer = 0; doubleBuffer <= 1; doubleBuffer++) { mDoubleBuffering = doubleBuffer == 1; diff --git a/tests/TileBenchmark/src/com/test/tilebenchmark/ProfiledWebView.java b/tests/TileBenchmark/src/com/test/tilebenchmark/ProfiledWebView.java index 7c03313..d3b572c 100644 --- a/tests/TileBenchmark/src/com/test/tilebenchmark/ProfiledWebView.java +++ b/tests/TileBenchmark/src/com/test/tilebenchmark/ProfiledWebView.java @@ -89,6 +89,11 @@ public class ProfiledWebView extends WebView implements WebViewClassic.PageSwapD mLoadTime = 0; } + public void setUseMinimalMemory(boolean minimal) { + WebSettingsClassic settings = getWebViewClassic().getSettings(); + settings.setProperty("use_minimal_memory", minimal ? "true" : "false"); + } + public void onPageFinished() { mLoadTime = System.currentTimeMillis(); } |