Title: [116062] trunk/Tools
Revision
116062
Author
o...@chromium.org
Date
2012-05-03 18:57:18 -0700 (Thu, 03 May 2012)

Log Message

Improve UI for garden-o-matic examine view when there are fewer than 5 tests.
https://bugs.webkit.org/show_bug.cgi?id=85566

Reviewed by Adam Barth.

* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results.js:
(.):
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results_unittests.js:
(.):
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/results.css:

Modified Paths

Diff

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results.js (116061 => 116062)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results.js	2012-05-04 01:53:05 UTC (rev 116061)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results.js	2012-05-04 01:57:18 UTC (rev 116062)
@@ -240,7 +240,8 @@
         this._flakinessData = new ui.results.FlakinessData();
         this.appendChild(this._flakinessData);
 
-        Object.keys(resultsByTest).sort().forEach(function(testName) {
+        var testNames = Object.keys(resultsByTest);
+        testNames.sort().forEach(function(testName) {
             var nonLinkTitle = document.createElement('a');
             nonLinkTitle.classList.add('non-link-title');
             nonLinkTitle.textContent = testName;
@@ -256,6 +257,14 @@
             header.addEventListener('click', this._showResults.bind(this, header));
             topPanel.appendChild(header);
         }, this);
+
+        // If we have a small amount of content, don't show the resize handler.
+        // Otherwise, set the minHeight so that the percentage height of the 
+        // topPanel is not too small.
+        if (testNames.length <= 4)
+            this.removeChild(this.querySelector('.resize-handle'));
+        else
+            topPanel.style.minHeight = '100px';
     },
     _appendResizeHandle: function()
     {

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results_unittests.js (116061 => 116062)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results_unittests.js	2012-05-04 01:53:05 UTC (rev 116061)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results_unittests.js	2012-05-04 01:57:18 UTC (rev 116062)
@@ -89,7 +89,40 @@
     }
 };
 
-test('View', 16, function() {
+var kExampleGreaterThanFourResultsByTest = {
+    "scrollbars/custom-scrollbar-with-incomplete-style.html": {
+        "Mock Linux": {
+            "expected": "TEXT",
+            "actual": "CRASH"
+        }
+    },
+    "scrollbars/1.html": {
+        "Mock Linux": {
+            "expected": "TEXT",
+            "actual": "CRASH"
+        }
+    },
+    "scrollbars/2.html": {
+        "Mock Linux": {
+            "expected": "TEXT",
+            "actual": "CRASH"
+        }
+    },
+    "scrollbars/3.html": {
+        "Mock Linux": {
+            "expected": "TEXT",
+            "actual": "CRASH"
+        }
+    },
+    "userscripts/another-test.html": {
+        "Mock Builder": {
+            "expected": "PASS",
+            "actual": "TEXT"
+        }
+    }
+};
+
+test('View', 18, function() {
     var delegate = {
         fetchResultsURLs: function(failureInfo, callback) { return; }
     };
@@ -126,14 +159,32 @@
     equals(topPanel.childNodes[0], topPanel.querySelector('.active'));;
     equals($($('.builder-selector', view)[0]).tabs('option', 'selected'), 1);
     equals(view.currentTestName(), 'scrollbars/custom-scrollbar-with-incomplete-style.html');
+
+    ok(!testSelector.querySelector('.resize-handle'));
+    equals(topPanel.style.minHeight, '');
 });
 
-test('View', 2, function() {
+test('View with more than four tests', 2, function() {
     var delegate = {
         fetchResultsURLs: function(failureInfo, callback) { return; }
     };
 
     var view = new ui.results.View(delegate);
+    view.setResultsByTest(kExampleGreaterThanFourResultsByTest);
+
+    var testSelector = view.querySelector('.test-selector');
+    var topPanel = testSelector.querySelector('.top-panel');
+
+    ok(testSelector.querySelector('.resize-handle'));
+    equals(topPanel.style.minHeight, '100px');
+});
+
+test('View with reftests', 2, function() {
+    var delegate = {
+        fetchResultsURLs: function(failureInfo, callback) { return; }
+    };
+
+    var view = new ui.results.View(delegate);
     view.setResultsByTest(kExampleReftestResults);
     view.firstResult();
 

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/results.css (116061 => 116062)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/results.css	2012-05-04 01:53:05 UTC (rev 116061)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/results.css	2012-05-04 01:57:18 UTC (rev 116062)
@@ -92,7 +92,6 @@
 }
 
 .results-view .top-panel {
-    min-height: 100px;
     max-height: 20%;
     overflow: auto;
     position: relative;

Modified: trunk/Tools/ChangeLog (116061 => 116062)


--- trunk/Tools/ChangeLog	2012-05-04 01:53:05 UTC (rev 116061)
+++ trunk/Tools/ChangeLog	2012-05-04 01:57:18 UTC (rev 116062)
@@ -1,3 +1,16 @@
+2012-05-03  Ojan Vafai  <o...@chromium.org>
+
+        Improve UI for garden-o-matic examine view when there are fewer than 5 tests.
+        https://bugs.webkit.org/show_bug.cgi?id=85566
+
+        Reviewed by Adam Barth.
+
+        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results.js:
+        (.):
+        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results_unittests.js:
+        (.):
+        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/results.css:
+
 2012-05-03  Raphael Kubo da Costa  <rak...@webkit.org>
 
         webkitpy: Recognize FreeBSD as a valid platform.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to