Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Utilities.js (91028 => 91029)
--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Utilities.js 2011-07-14 21:21:24 UTC (rev 91028)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Utilities.js 2011-07-14 21:49:53 UTC (rev 91029)
@@ -140,6 +140,29 @@
return this[this.length - 1];
}
+Element.prototype.hasStyleClass = function(klass) {
+ var regex = new RegExp('\\b' + klass + '\\b');
+ return regex.test(this.className);
+}
+
+Element.prototype.addStyleClass = function(klass) {
+ if (this.hasStyleClass(klass))
+ return;
+ this.className += ' ' + klass;
+}
+
+Element.prototype.removeStyleClass = function(klass) {
+ var regex = new RegExp('\\b' + klass + '\\b', 'g');
+ this.className = this.className.replace(regex, '');
+}
+
+Element.prototype.toggleStyleClass = function(klass) {
+ if (this.hasStyleClass(klass))
+ this.removeStyleClass(klass);
+ else
+ this.addStyleClass(klass);
+}
+
Node.prototype.appendChildren = function(children) {
for (var i = 0; i < children.length; ++i)
this.appendChild(children[i]);
Added: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Utilities_unittests.js (0 => 91029)
--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Utilities_unittests.js (rev 0)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Utilities_unittests.js 2011-07-14 21:49:53 UTC (rev 91029)
@@ -0,0 +1,127 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+(function() {
+
+module('Utilities');
+
+test('hasStyleClass', 11, function() {
+ var element = document.createElement('div');
+
+ ok(!element.hasStyleClass('foo'));
+ ok(!element.hasStyleClass('bar'));
+
+ element.className = 'foo';
+ ok(element.hasStyleClass('foo'))
+ ok(!element.hasStyleClass('bar'));
+
+ element.className = 'foo foo';
+ ok(element.hasStyleClass('foo'))
+ ok(!element.hasStyleClass('bar'));
+
+ element.className = 'foo bar';
+ ok(element.hasStyleClass('foo'))
+ ok(element.hasStyleClass('bar'));
+ ok(!element.hasStyleClass('baz'));
+
+ element.className = 'food';
+ ok(!element.hasStyleClass('foo'));
+ ok(element.hasStyleClass('food'));
+});
+
+test('addStyleClass', 4, function() {
+ var element = document.createElement('div');
+
+ element.addStyleClass('foo');
+ equal(element.className, ' foo');
+
+ element.addStyleClass('foo');
+ equal(element.className, ' foo');
+
+ element.addStyleClass('bar');
+ equal(element.className, ' foo bar');
+
+ element.addStyleClass('foo');
+ equal(element.className, ' foo bar');
+});
+
+test('removeStyleClass', 8, function() {
+ var element = document.createElement('div');
+
+ element.removeStyleClass('foo');
+ equal(element.className, '');
+
+ element.className = 'foo';
+ element.removeStyleClass('foo');
+ equal(element.className, '');
+
+ element.className = ' foo';
+ element.removeStyleClass('foo');
+ equal(element.className, ' ');
+
+ element.className = 'foo foo';
+ element.removeStyleClass('foo');
+ equal(element.className, ' ');
+
+ element.className = 'foo bar';
+ element.removeStyleClass('foo');
+ equal(element.className, ' bar');
+
+ element.className = 'foo bar foo bar';
+ element.removeStyleClass('bar');
+ equal(element.className, 'foo foo ');
+
+ element.className = 'food';
+ element.removeStyleClass('foo');
+ equal(element.className, 'food');
+
+ element.className = 'foo';
+ element.removeStyleClass('food');
+ equal(element.className, 'foo');
+});
+
+test('toggleStyleClass', 5, function() {
+ var element = document.createElement('div');
+
+ element.toggleStyleClass('foo');
+ equal(element.className, ' foo');
+
+ element.toggleStyleClass('foo');
+ equal(element.className, ' ');
+
+ element.className = 'bar';
+ element.toggleStyleClass('foo');
+ equal(element.className, 'bar foo');
+
+ element.className = 'food';
+ element.toggleStyleClass('foo');
+ equal(element.className, 'food foo');
+
+ element.className = 'foo';
+ element.toggleStyleClass('food');
+ equal(element.className, 'foo food');
+});
+
+})();
Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js (91028 => 91029)
--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js 2011-07-14 21:21:24 UTC (rev 91028)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js 2011-07-14 21:49:53 UTC (rev 91029)
@@ -436,8 +436,8 @@
failureList.className = 'flakiness-examples-list';
disclosureTriangle.addEventListener('click', function() {
- item.classList.toggle('expanded');
- if (!item.classList.contains('expanded')) {
+ item.toggleStyleClass('expanded');
+ if (!item.hasStyleClass('expanded')) {
failureList.style.height = '';
return;
}
Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/run-unittests.html (91028 => 91029)
--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/run-unittests.html 2011-07-14 21:21:24 UTC (rev 91028)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/run-unittests.html 2011-07-14 21:49:53 UTC (rev 91029)
@@ -13,16 +13,22 @@
<ol id="qunit-tests"></ol>
<!-- FIXME: We should have tests for these files! -->
<script src=""
+
<script src=""
+<script src=""
+<script src=""
+<script src=""
+
+<script src=""
+<script src=""
+
<script src=""
<script src=""
+
<script src=""
<script src=""
-<script src=""
-<script src=""
-<script src=""
-<script src=""
+
<script src=""
<script src=""
</body>
Modified: trunk/Tools/ChangeLog (91028 => 91029)
--- trunk/Tools/ChangeLog 2011-07-14 21:21:24 UTC (rev 91028)
+++ trunk/Tools/ChangeLog 2011-07-14 21:49:53 UTC (rev 91029)
@@ -1,3 +1,32 @@
+2011-07-14 Adam Roben <[email protected]>
+
+ Don't use Element.prototype.classList in TestFailures
+
+ Safari 5 doesn't support it.
+
+ Fixes <http://webkit.org/b/64550> Can't expand flaky tests on TestFailures page in Safari 5
+
+ Reviewed by Daniel Bates.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Utilities.js:
+ (Element.prototype.hasStyleClass):
+ (Element.prototype.addStyleClass):
+ (Element.prototype.removeStyleClass):
+ (Element.prototype.toggleStyleClass):
+ Added these helper functions which simulate classList functionality.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Utilities_unittests.js:
+ Added. Tests for the above.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js:
+ (ViewController.prototype._domForPossiblyFlakyTests): Changed to use
+ toggleStyleClass/hasStyleClass instead of classList.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/run-unittests.html:
+ Added Utilities_unittests.js, and reordered the tested files to be in
+ roughly dependency order (i.e., the lowest-level files are imported
+ and tested first).
+
2011-07-14 Eric Seidel <[email protected]>
NRWT doesn't store the svn revision in full_results.json on chromium-win