Loading tests/DumpRenderTree2/AndroidManifest.xml +2 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,8 @@ limitations under the License. It can lead to some weird behaviour in the future. --> <activity android:name=".TestsListActivity" android:label="Tests' list activity" android:launchMode="singleTask"> android:launchMode="singleTask" android:configChanges="orientation"> </activity> <activity android:name=".LayoutTestsExecutor" Loading tests/DumpRenderTree2/src/com/android/dumprendertree2/Summarizer.java +6 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import com.android.dumprendertree2.forwarder.ForwarderManager; import java.io.File; import java.net.MalformedURLException; import java.net.URI; import java.net.URL; import java.text.SimpleDateFormat; import java.util.ArrayList; Loading Loading @@ -200,6 +201,11 @@ public class Summarizer { mResultsRootDirPath = resultsRootDirPath; } public static URI getDetailsUri() { return new File(ManagerService.RESULTS_ROOT_DIR_PATH + File.separator + HTML_DETAILS_RELATIVE_PATH).toURI(); } public void appendTest(AbstractResult result) { String relativePath = result.getRelativePath(); Loading tests/DumpRenderTree2/src/com/android/dumprendertree2/TestsListActivity.java +30 −1 Original line number Diff line number Diff line Loading @@ -19,10 +19,14 @@ package com.android.dumprendertree2; import android.app.Activity; import android.app.ProgressDialog; import android.content.Intent; import android.content.res.Configuration; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.view.Gravity; import android.view.Window; import android.webkit.WebView; import android.widget.Toast; import com.android.dumprendertree2.scriptsupport.OnEverythingFinishedCallback; Loading Loading @@ -124,13 +128,38 @@ public class TestsListActivity extends Activity { } private void onEverythingFinishedIntent(Intent intent) { /** TODO: Show some kind of summary to the user */ Toast toast = Toast.makeText(this, "All tests finished.\nPress back key to return to the tests' list.", Toast.LENGTH_LONG); toast.setGravity(Gravity.CENTER, -40, 0); toast.show(); /** Show the details to the user */ WebView webView = new WebView(this); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setBuiltInZoomControls(true); webView.getSettings().setEnableSmoothTransition(true); /** This enables double-tap to zoom */ webView.getSettings().setUseWideViewPort(true); setContentView(webView); webView.loadUrl(Summarizer.getDetailsUri().toString()); mEverythingFinished = true; if (mOnEverythingFinishedCallback != null) { mOnEverythingFinishedCallback.onFinished(); } } /** * This, together with android:configChanges="orientation" in manifest file, prevents * the activity from restarting on orientation change. */ @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); } @Override protected void onSaveInstanceState(Bundle outState) { outState.putStringArrayList("testsList", mTestsList); Loading Loading
tests/DumpRenderTree2/AndroidManifest.xml +2 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,8 @@ limitations under the License. It can lead to some weird behaviour in the future. --> <activity android:name=".TestsListActivity" android:label="Tests' list activity" android:launchMode="singleTask"> android:launchMode="singleTask" android:configChanges="orientation"> </activity> <activity android:name=".LayoutTestsExecutor" Loading
tests/DumpRenderTree2/src/com/android/dumprendertree2/Summarizer.java +6 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import com.android.dumprendertree2.forwarder.ForwarderManager; import java.io.File; import java.net.MalformedURLException; import java.net.URI; import java.net.URL; import java.text.SimpleDateFormat; import java.util.ArrayList; Loading Loading @@ -200,6 +201,11 @@ public class Summarizer { mResultsRootDirPath = resultsRootDirPath; } public static URI getDetailsUri() { return new File(ManagerService.RESULTS_ROOT_DIR_PATH + File.separator + HTML_DETAILS_RELATIVE_PATH).toURI(); } public void appendTest(AbstractResult result) { String relativePath = result.getRelativePath(); Loading
tests/DumpRenderTree2/src/com/android/dumprendertree2/TestsListActivity.java +30 −1 Original line number Diff line number Diff line Loading @@ -19,10 +19,14 @@ package com.android.dumprendertree2; import android.app.Activity; import android.app.ProgressDialog; import android.content.Intent; import android.content.res.Configuration; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.view.Gravity; import android.view.Window; import android.webkit.WebView; import android.widget.Toast; import com.android.dumprendertree2.scriptsupport.OnEverythingFinishedCallback; Loading Loading @@ -124,13 +128,38 @@ public class TestsListActivity extends Activity { } private void onEverythingFinishedIntent(Intent intent) { /** TODO: Show some kind of summary to the user */ Toast toast = Toast.makeText(this, "All tests finished.\nPress back key to return to the tests' list.", Toast.LENGTH_LONG); toast.setGravity(Gravity.CENTER, -40, 0); toast.show(); /** Show the details to the user */ WebView webView = new WebView(this); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setBuiltInZoomControls(true); webView.getSettings().setEnableSmoothTransition(true); /** This enables double-tap to zoom */ webView.getSettings().setUseWideViewPort(true); setContentView(webView); webView.loadUrl(Summarizer.getDetailsUri().toString()); mEverythingFinished = true; if (mOnEverythingFinishedCallback != null) { mOnEverythingFinishedCallback.onFinished(); } } /** * This, together with android:configChanges="orientation" in manifest file, prevents * the activity from restarting on orientation change. */ @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); } @Override protected void onSaveInstanceState(Bundle outState) { outState.putStringArrayList("testsList", mTestsList); Loading