diff options
author | Maksymilian Osowski <maxosowski@google.com> | 2010-09-02 15:46:38 +0100 |
---|---|---|
committer | Maksymilian Osowski <maxosowski@google.com> | 2010-09-02 17:27:35 +0100 |
commit | 2ca8acdb5622b03a4ef56159477087adcf87db62 (patch) | |
tree | f39f991603b377dd15279b747c46d5d4ba38283d /tests | |
parent | eaa511fd03e01bdae2bc09e2f29b51f76f64e0d7 (diff) | |
download | frameworks_base-2ca8acdb5622b03a4ef56159477087adcf87db62.zip frameworks_base-2ca8acdb5622b03a4ef56159477087adcf87db62.tar.gz frameworks_base-2ca8acdb5622b03a4ef56159477087adcf87db62.tar.bz2 |
Adds webkit revision to the summary and details.
The revision number is taken from external/webkit/WEBKIT_MERGE_REVISION and is served to the java code by apache server. To be able to do that, the new alias directive had to be
added to the run_apache2.py script.
Bug: 2889572
Change-Id: Ie3d147e4d8ea9edd0144b819152121563b8bd759
Diffstat (limited to 'tests')
-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); |