Index: tools/unittests/run_perf_test.py |
diff --git a/tools/unittests/run_perf_test.py b/tools/unittests/run_perf_test.py |
index a384fb6d35f3cf30a601c8275b0cd0b154be9206..5ac0789ae86438923576c07b88830281dc2a9a81 100644 |
--- a/tools/unittests/run_perf_test.py |
+++ b/tools/unittests/run_perf_test.py |
@@ -391,3 +391,22 @@ class PerfTest(unittest.TestCase): |
]) |
self._VerifyMock( |
path.join("out", "x64.release", "d7"), "--flag", "run.js", timeout=70) |
+ |
+ # Simple test that mocks out the android platform. Testing the platform would |
+ # require lots of complicated mocks for the android tools. |
+ def testAndroid(self): |
+ self._WriteTestInput(V8_JSON) |
+ platform = run_perf.Platform |
+ platform.PreExecution = MagicMock(return_value=None) |
+ platform.PostExecution = MagicMock(return_value=None) |
+ platform.PreTests = MagicMock(return_value=None) |
+ platform.Run = MagicMock( |
+ return_value="Richards: 1.234\nDeltaBlue: 10657567\n") |
+ run_perf.AndroidPlatform = MagicMock(return_value=platform) |
+ self.assertEquals( |
+ 0, self._CallMain("--android-build-tools", "/some/dir", |
+ "--arch", "android_arm")) |
+ self._VerifyResults("test", "score", [ |
+ {"name": "Richards", "results": ["1.234"], "stddev": ""}, |
+ {"name": "DeltaBlue", "results": ["10657567"], "stddev": ""}, |
+ ]) |