Added: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/model_unittests.js (0 => 92442)
--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/model_unittests.js (rev 0)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/model_unittests.js 2011-08-05 03:26:02 UTC (rev 92442)
@@ -0,0 +1,180 @@
+/*
+ * Copyright (C) 2011 Google 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("model");
+
+var kExampleCommitDataXML =
+ '<?xml version="1.0"?>\n\n' +
+ '<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">\n\n' +
+ ' \n\n' +
+ '\n\n' +
+ ' <channel>\n\n' +
+ ' <title>Revisions of /trunk</title>\n\n' +
+ ' <link>http://trac.webkit.org/log/trunk?rev=92362</link>\n\n' +
+ ' <description>Trac Log - Revisions of /trunk</description>\n\n' +
+ ' <language>en-US</language>\n\n' +
+ ' <generator>Trac 0.11.7</generator>\n\n' +
+ ' <image>\n\n' +
+ ' <title>WebKit</title>\n\n' +
+ ' <url>http://trac.webkit.org/chrome/site/icon.png</url>\n\n' +
+ ' <link>http://trac.webkit.org/log/trunk?rev=92362</link>\n\n' +
+ ' </image>\n\n' +
+ ' <item>\n' +
+ ' <author>[email protected]</author>\n' +
+ ' <pubDate>Wed, 03 Aug 2011 04:26:52 GMT</pubDate>\n' +
+ ' <title>Revision 92259: Unreviewed, rolling out r92256.\n' +
+ 'http://trac.webkit.org/changeset/92256 ...</title>\n' +
+ ' <link>http://trac.webkit.org/changeset/92259/trunk</link>\n' +
+ ' <guid isPermaLink="false">http://trac.webkit.org/changeset/92259/trunk</guid>\n' +
+ ' <description><p>\n' +
+ 'Unreviewed, rolling out <a class="changeset" href="" title="Make EventDispatchMediator RefCounted. ...">r92256</a>.\n' +
+ '<a class="ext-link" href="" class="icon"> </span>http://trac.webkit.org/changeset/92256</a>\n' +
+ '<a class="ext-link" href="" class="icon"> </span>https://bugs.webkit.org/show_bug.cgi?id=65593</a>\n' +
+ '</p>\n' +
+ '<p>\n' +
+ 'Causing tons of crashes on the chromium win bots (Requested by\n' +
+ 'jamesr on #webkit).\n' +
+ '</p>\n' +
+ '<p>\n' +
+ 'Patch by Sheriff Bot &lt;<a class="mail-link" href="" class="icon"> </span>[email protected]</a>&gt; on 2011-08-02\n' +
+ '</p>\n' +
+ '<p>\n' +
+ '* dom/Event.cpp:\n' +
+ '* dom/Event.h:\n' +
+ '* dom/EventDispatcher.cpp:\n' +
+ '(WebCore::EventDispatcher::dispatchEvent):\n' +
+ '* dom/EventDispatcher.h:\n' +
+ '* dom/KeyboardEvent.cpp:\n' +
+ '* dom/KeyboardEvent.h:\n' +
+ '* dom/MouseEvent.cpp:\n' +
+ '* dom/MouseEvent.h:\n' +
+ '* dom/Node.cpp:\n' +
+ '(WebCore::Node::dispatchEvent):\n' +
+ '(WebCore::Node::dispatchKeyEvent):\n' +
+ '(WebCore::Node::dispatchMouseEvent):\n' +
+ '(WebCore::Node::dispatchWheelEvent):\n' +
+ '* dom/WheelEvent.cpp:\n' +
+ '* dom/WheelEvent.h:\n' +
+ '</p>\n' +
+ '</description>\n' +
+ ' <category>Log</category>\n' +
+ ' </item><item>\n' +
+ ' <author>[email protected]</author>\n\n' +
+ ' <pubDate>Thu, 04 Aug 2011 02:09:19 GMT</pubDate>\n\n' +
+ ' <title>Revision 92256: Support cast between CSSPrimitiveValue and EBoxSizing, use in ...</title>\n\n' +
+ ' <link>http://trac.webkit.org/changeset/92256/trunk</link>\n\n' +
+ ' <guid isPermaLink="false">http://trac.webkit.org/changeset/92256/trunk</guid>\n\n' +
+ ' <description><p>\n\n' +
+ 'Support cast between CSSPrimitiveValue and EBoxSizing, use in CSSStyleSelector.\n\n' +
+ '<a class="ext-link" href="" class="icon"> </span>https://bugs.webkit.org/show_bug.cgi?id=65657</a>\n\n' +
+ '</p>\n\n' +
+ '<p>\n\n' +
+ 'Reviewed by Simon Fraser.\n\n' +
+ '</p>\n\n' +
+ '<p>\n\n' +
+ 'No new tests / refactoring only.\n\n' +
+ '</p>\n\n' +
+ '<p>\n\n' +
+ '* css/CSSPrimitiveValueMappings.h:\n\n' +
+ '(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):\n\n' +
+ 'Implement cast from EBoxSizing.\n' +
+ '(WebCore::CSSPrimitiveValue::operator EBoxSizing):\n' +
+ 'Implement cast to EBoxSizing.\n' +
+ '* css/CSSStyleSelector.cpp:\n' +
+ '(WebCore::CSSStyleSelector::applyProperty):\n' +
+ 'Use appropriate macro to simplify code using cast.\n' +
+ '</p>\n' +
+ '</description>\n' +
+ ' <category>Log</category>\n' +
+ ' </item>\n' +
+ ' </channel>\n' +
+ '</rss>\n'
+
+test("rebaselineQueue", 3, function() {
+ var queue = model.takeRebaselineQueue();
+ deepEqual(queue, []);
+ model.queueForRebaseline('failureInfo1');
+ model.queueForRebaseline('failureInfo2');
+ var queue = model.takeRebaselineQueue();
+ deepEqual(queue, ['failureInfo1', 'failureInfo2']);
+ var queue = model.takeRebaselineQueue();
+ deepEqual(queue, []);
+});
+
+test("rebaselineQueue", 3, function() {
+ var queue = model.takeExpectationUpdateQueue();
+ deepEqual(queue, []);
+ model.queueForExpectationUpdate('failureInfo1');
+ model.queueForExpectationUpdate('failureInfo2');
+ var queue = model.takeExpectationUpdateQueue();
+ deepEqual(queue, ['failureInfo1', 'failureInfo2']);
+ var queue = model.takeExpectationUpdateQueue();
+ deepEqual(queue, []);
+});
+
+test("updateRecentCommits", 2, function() {
+ var simulator = new NetworkSimulator();
+
+ simulator.get = function(url, callback)
+ {
+ simulator.scheduleCallback(function() {
+ var parser = new DOMParser();
+ var responseDOM = parser.parseFromString(kExampleCommitDataXML, "application/xml");
+ callback(responseDOM);
+ });
+ };
+
+ simulator.runTest(function() {
+ model.updateRecentCommits(function() {
+ var recentCommits = model.state.recentCommits;
+ delete model.state.recentCommits;
+ $.each(recentCommits, function(index, commitData) {
+ delete commitData.message;
+ });
+ deepEqual(recentCommits, [{
+ "revision": 92259,
+ "title": "Revision 92259: Unreviewed, rolling out r92256.\nhttp://trac.webkit.org/changeset/92256 ...",
+ "summary": "Unreviewed, rolling out r92256.",
+ "author": "Sheriff Bot",
+ "reviewer": null,
+ "bugID": 65593,
+ "revertedRevision": 92256
+ }, {
+ "revision": 92256,
+ "title": "Revision 92256: Support cast between CSSPrimitiveValue and EBoxSizing, use in ...",
+ "summary": "Support cast between CSSPrimitiveValue and EBoxSizing, use in CSSStyleSelector.",
+ "author": "[email protected]",
+ "reviewer": "Simon Fraser",
+ "bugID": 65657,
+ "revertedRevision": undefined,
+ "wasReverted": true
+ }]);
+ });
+ });
+});
+
+})();