diff options
author | Maksymilian Osowski <maxosowski@google.com> | 2010-08-27 13:54:58 +0100 |
---|---|---|
committer | Maksymilian Osowski <maxosowski@google.com> | 2010-09-01 12:31:33 +0100 |
commit | 603b70dd8b1ef8acabf71c52089c6cd5396fe931 (patch) | |
tree | 8da1f3b1a71e086b15a7537117bda1873af28a70 /tests/DumpRenderTree2/src/com/android/dumprendertree2/Summarizer.java | |
parent | c6f7413973bfca0432e8cf987cf821bf416cf7d8 (diff) | |
download | frameworks_base-603b70dd8b1ef8acabf71c52089c6cd5396fe931.zip frameworks_base-603b70dd8b1ef8acabf71c52089c6cd5396fe931.tar.gz frameworks_base-603b70dd8b1ef8acabf71c52089c6cd5396fe931.tar.bz2 |
Updated the Summarizer to link to the source of the tests.
Change-Id: I90018898c627b99f5a49c301e87593b52cd18ce4
Bug-Id: 2889573
Diffstat (limited to 'tests/DumpRenderTree2/src/com/android/dumprendertree2/Summarizer.java')
-rw-r--r-- | tests/DumpRenderTree2/src/com/android/dumprendertree2/Summarizer.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/DumpRenderTree2/src/com/android/dumprendertree2/Summarizer.java b/tests/DumpRenderTree2/src/com/android/dumprendertree2/Summarizer.java index 43bc0b1..7bbbc05 100644 --- a/tests/DumpRenderTree2/src/com/android/dumprendertree2/Summarizer.java +++ b/tests/DumpRenderTree2/src/com/android/dumprendertree2/Summarizer.java @@ -21,8 +21,13 @@ import android.content.res.Configuration; import android.content.res.Resources; import android.os.Build; import android.util.DisplayMetrics; +import android.util.Log; + +import com.android.dumprendertree2.forwarder.ForwarderManager; import java.io.File; +import java.net.MalformedURLException; +import java.net.URL; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Collections; @@ -369,6 +374,9 @@ public class Summarizer { html.append(result.getDiffAsHtml()); html.append("<a href=\"#\" onClick=\"toggleDisplay('" + id + "');"); html.append("return false;\">Hide</a>"); + html.append(" | "); + html.append("<a href=\"" + getViewSourceUrl(relativePath).toString() + "\""); + html.append(" target=\"_blank\">Show source</a>"); html.append("</div>"); } @@ -382,10 +390,25 @@ public class Summarizer { html.append("<h2>Passed [" + resultsList.size() + "]</h2>"); for (String result : resultsList) { html.append("<h3>"); + html.append("<a href=\"" + getViewSourceUrl(result).toString() + "\""); + html.append(" target=\"_blank\">"); html.append("<span class=\"sqr\">■ </span>"); html.append("<span class=\"path\">" + result + "</span>"); + html.append("</a>"); html.append("</h3>"); html.append("<div class=\"space\"></div>"); } } + + private static final URL getViewSourceUrl(String relativePath) { + URL url = null; + try { + url = new URL("http", "localhost", ForwarderManager.HTTP_PORT, + "/WebKitTools/DumpRenderTree/android/view_source.php?src=" + + relativePath); + } catch (MalformedURLException e) { + assert false : "relativePath=" + relativePath; + } + return url; + } }
\ No newline at end of file |