diff options
-rwxr-xr-x | tests/DumpRenderTree2/assets/run_apache2.py | 2 | ||||
-rw-r--r-- | tests/DumpRenderTree2/src/com/android/dumprendertree2/Summarizer.java | 25 |
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/DumpRenderTree2/assets/run_apache2.py b/tests/DumpRenderTree2/assets/run_apache2.py index 5764f0e..e0e4be7 100755 --- a/tests/DumpRenderTree2/assets/run_apache2.py +++ b/tests/DumpRenderTree2/assets/run_apache2.py @@ -76,6 +76,8 @@ def main(): directives += " -c \"Alias /LayoutTests " + layout_tests_path + "\"" directives += " -c \"Alias /WebKitTools/DumpRenderTree/android " + \ os.path.join(webkit_path, "WebKitTools", "DumpRenderTree", "android") + "\"" + directives += " -c \"Alias /WEBKIT_MERGE_REVISION " + \ + os.path.join(webkit_path, "WEBKIT_MERGE_REVISION") + "\"" # This directive is commented out in apache2-debian-httpd.conf for some reason # However, it is useful to browse through tests in the browser, so it's added here. diff --git a/tests/DumpRenderTree2/src/com/android/dumprendertree2/Summarizer.java b/tests/DumpRenderTree2/src/com/android/dumprendertree2/Summarizer.java index ea8b097..d18fb14 100644 --- a/tests/DumpRenderTree2/src/com/android/dumprendertree2/Summarizer.java +++ b/tests/DumpRenderTree2/src/com/android/dumprendertree2/Summarizer.java @@ -263,6 +263,7 @@ public class Summarizer { txt.append("Date: " + dateFormat.format(mDate) + "\n"); txt.append("Build fingerprint: " + Build.FINGERPRINT + "\n"); txt.append("WebKit version: " + getWebKitVersionFromUserAgentString() + "\n"); + txt.append("WebKit revision: " + getWebKitRevision() + "\n"); txt.append("TOTAL: " + getTotalTestCount() + "\n"); if (mCrashedTestsCount > 0) { @@ -322,6 +323,24 @@ public class Summarizer { return "unknown"; } + private String getWebKitRevision() { + URL url = null; + try { + url = new URL(ForwarderManager.getHostSchemePort(false) + "WEBKIT_MERGE_REVISION"); + } catch (MalformedURLException e) { + assert false; + } + + String webkitMergeRevisionFileContents = new String(FsUtils.readDataFromUrl(url)); + Matcher matcher = + Pattern.compile("http://svn.webkit.org/repository/webkit/trunk@([0-9]+)").matcher( + webkitMergeRevisionFileContents); + if (matcher.find()) { + return matcher.group(1); + } + return "unknown"; + } + private void createTopSummaryTable(StringBuilder html) { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); html.append("<h1>" + mTestsRelativePath + "</h1>"); @@ -329,6 +348,12 @@ public class Summarizer { html.append("<h3>" + "Build fingerprint: " + Build.FINGERPRINT + "</h3>"); html.append("<h3>" + "WebKit version: " + getWebKitVersionFromUserAgentString() + "</h3>"); + String webkitRevision = getWebKitRevision(); + html.append("<h3>" + "WebKit revision: "); + html.append("<a href=\"http://trac.webkit.org/browser/trunk?rev=" + webkitRevision + + "\" target=\"_blank\"><span class=\"path\">" + webkitRevision + "</span></a>"); + html.append("</h3>"); + html.append("<table class=\"summary\">"); createSummaryTableRow(html, "TOTAL", getTotalTestCount()); createSummaryTableRow(html, "CRASHED", mCrashedTestsCount); |