Added: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/bugzilla_unittests.js (0 => 92356)
--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/bugzilla_unittests.js (rev 0)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/bugzilla_unittests.js 2011-08-04 07:14:58 UTC (rev 92356)
@@ -0,0 +1,233 @@
+/*
+ * 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("bugzilla");
+
+var kExampleResponseXML =
+ '<?xml version="1.0" encoding="UTF-8"?>' +
+ '<feed xmlns="http://www.w3.org/2005/Atom">' +
+ ' <title>Bugzilla Bugs</title>' +
+ ' <link rel="alternate" type="text/html"' +
+ ' href="" +
+ ' <link rel="self" type="application/atom+xml"' +
+ ' href="" +
+ ' <updated>2011-08-04T00:22:49Z</updated>' +
+ ' <id>https://bugs.webkit.org/buglist.cgi?bug_status=REOPENED&bug_status=NEW&bug_status=ASSIGNED&bug_status=UNCONFIRMED&ctype=atom&field-1-0-0=bug_status&field0-0-0=product&field0-0-1=component&field0-0-2=short_desc&field0-0-3=status_whiteboard&field0-0-4=longdesc&query_format=advanced&remaction=&type-1-0-0=anyexact&type0-0-0=substring&type0-0-1=substring&type0-0-2=substring&type0-0-3=substring&type0-0-4=substring&value-1-0-0=REOPENED%2CNEW%2CASSIGNED%2CUNCONFIRMED&value0-0-0=garden-o-matic&value0-0-1=garden-o-matic&value0-0-2=garden-o-matic&value0-0-3=garden-o-matic&value0-0-4=garden-o-matic</id>' +
+ '' +
+ ' <entry>' +
+ ' <title>[Bug 65654] Add missing license blocks to garden-o-matic</title>' +
+ ' <link rel="alternate" type="text/html"' +
+ ' href="" +
+ ' <id>https://bugs.webkit.org/show_bug.cgi?id=65654</id>' +
+ ' <author>' +
+ ' <name>Adam Barth</name>' +
+ ' </author>' +
+ ' <updated>2011-08-04T00:22:26Z</updated> ' +
+ ' <summary type="html">' +
+ ' ' +
+ ' <table>' +
+ ' <tr>' +
+ ' <th>Field</th><th>Value</th>' +
+ ' </tr><tr class="bz_feed_product">' +
+ ' <td>Product</td>' +
+ ' <td>WebKit</td>' +
+ ' </tr><tr class="bz_feed_component">' +
+ ' <td>Component</td>' +
+ ' <td>New Bugs</td>' +
+ ' </tr><tr class="bz_feed_assignee">' +
+ ' <td>Assignee</td>' +
+ ' <td>Adam Barth</td>' +
+ ' </tr><tr class="bz_feed_reporter">' +
+ ' <td>Reporter</td>' +
+ ' <td>Adam Barth</td>' +
+ ' </tr><tr class="bz_feed_bug_status">' +
+ ' <td>Status</td>' +
+ ' <td>NEW</td>' +
+ ' </tr><tr class="bz_feed_resolution">' +
+ ' <td>Resolution </td>' +
+ ' <td></td>' +
+ ' </tr><tr class="bz_feed_priority">' +
+ ' <td>Priority</td>' +
+ ' <td>P2</td>' +
+ ' </tr><tr class="bz_feed_severity">' +
+ ' <td>Severity </td>' +
+ ' <td>Normal</td>' +
+ ' </tr><tr class="bz_feed_creation_date">' +
+ ' <td>Opened</td>' +
+ ' <td>16:21:52</td>' +
+ ' </tr><tr class="bz_feed_changed_date">' +
+ ' <td>Changed</td>' +
+ ' <td>16:22:26</td>' +
+ ' </tr>' +
+ ' </table>' +
+ ' </summary>' +
+ ' </entry>' +
+ ' <entry>' +
+ ' <title>[Bug 65653] garden-o-matic needs a way to mock out the network</title>' +
+ ' <link rel="alternate" type="text/html"' +
+ ' href="" +
+ ' <id>https://bugs.webkit.org/show_bug.cgi?id=65653</id>' +
+ ' <author>' +
+ ' <name>Adam Barth</name>' +
+ ' </author>' +
+ ' <updated>2011-08-04T00:22:49Z</updated> ' +
+ ' <summary type="html">' +
+ ' ' +
+ ' <table>' +
+ ' <tr>' +
+ ' <th>Field</th><th>Value</th>' +
+ ' </tr><tr class="bz_feed_product">' +
+ ' <td>Product</td>' +
+ ' <td>WebKit</td>' +
+ ' </tr><tr class="bz_feed_component">' +
+ ' <td>Component</td>' +
+ ' <td>New Bugs</td>' +
+ ' </tr><tr class="bz_feed_assignee">' +
+ ' <td>Assignee</td>' +
+ ' <td>Adam Barth</td>' +
+ ' </tr><tr class="bz_feed_reporter">' +
+ ' <td>Reporter</td>' +
+ ' <td>Adam Barth</td>' +
+ ' </tr><tr class="bz_feed_bug_status">' +
+ ' <td>Status</td>' +
+ ' <td>NEW</td>' +
+ ' </tr><tr class="bz_feed_resolution">' +
+ ' <td>Resolution </td>' +
+ ' <td></td>' +
+ ' </tr><tr class="bz_feed_priority">' +
+ ' <td>Priority</td>' +
+ ' <td>P2</td>' +
+ ' </tr><tr class="bz_feed_severity">' +
+ ' <td>Severity </td>' +
+ ' <td>Normal</td>' +
+ ' </tr><tr class="bz_feed_creation_date">' +
+ ' <td>Opened</td>' +
+ ' <td>16:16:44</td>' +
+ ' </tr><tr class="bz_feed_changed_date">' +
+ ' <td>Changed</td>' +
+ ' <td>16:22:49</td>' +
+ ' </tr>' +
+ ' </table>' +
+ ' </summary>' +
+ ' </entry>' +
+ ' <entry>' +
+ ' <title>[Bug 65650] Use failureInfo more pervasively in garden-o-matic</title>' +
+ ' <link rel="alternate" type="text/html"' +
+ ' href="" +
+ ' <id>https://bugs.webkit.org/show_bug.cgi?id=65650</id>' +
+ ' <author>' +
+ ' <name>Adam Barth</name>' +
+ ' </author>' +
+ ' <updated>2011-08-03T23:40:34Z</updated> ' +
+ ' <summary type="html">' +
+ ' ' +
+ ' <table>' +
+ ' <tr>' +
+ ' <th>Field</th><th>Value</th>' +
+ ' </tr><tr class="bz_feed_product">' +
+ ' <td>Product</td>' +
+ ' <td>WebKit</td>' +
+ ' </tr><tr class="bz_feed_component">' +
+ ' <td>Component</td>' +
+ ' <td>New Bugs</td>' +
+ ' </tr><tr class="bz_feed_assignee">' +
+ ' <td>Assignee</td>' +
+ ' <td>Adam Barth</td>' +
+ ' </tr><tr class="bz_feed_reporter">' +
+ ' <td>Reporter</td>' +
+ ' <td>Adam Barth</td>' +
+ ' </tr><tr class="bz_feed_bug_status">' +
+ ' <td>Status</td>' +
+ ' <td>NEW</td>' +
+ ' </tr><tr class="bz_feed_resolution">' +
+ ' <td>Resolution </td>' +
+ ' <td></td>' +
+ ' </tr><tr class="bz_feed_priority">' +
+ ' <td>Priority</td>' +
+ ' <td>P2</td>' +
+ ' </tr><tr class="bz_feed_severity">' +
+ ' <td>Severity </td>' +
+ ' <td>Normal</td>' +
+ ' </tr><tr class="bz_feed_creation_date">' +
+ ' <td>Opened</td>' +
+ ' <td>15:35:55</td>' +
+ ' </tr><tr class="bz_feed_changed_date">' +
+ ' <td>Changed</td>' +
+ ' <td>15:40:34</td>' +
+ ' </tr>' +
+ ' </table>' +
+ ' </summary>' +
+ ' </entry>' +
+ '</feed>'
+
+test("quickSearch", 3, function() {
+ var simulator = new NetworkSimulator();
+
+ var requestedURLs = [];
+ simulator.get = function(url, callback)
+ {
+ requestedURLs.push(url);
+ simulator.scheduleCallback(function() {
+ var parser = new DOMParser();
+ var responseDOM = parser.parseFromString(kExampleResponseXML, "application/xml");
+ callback(responseDOM);
+ });
+ };
+
+ simulator.runTest(function() {
+ bugzilla.quickSearch('garden-o-matic', function(bugs) {
+ deepEqual(bugs, [{
+ "title": "[Bug 65654] Add missing license blocks to garden-o-matic",
+ "url": "https://bugs.webkit.org/show_bug.cgi?id=65654",
+ "status": "NEW"
+ }, {
+ "title": "[Bug 65653] garden-o-matic needs a way to mock out the network",
+ "url": "https://bugs.webkit.org/show_bug.cgi?id=65653",
+ "status": "NEW"
+ }, {
+ "title": "[Bug 65650] Use failureInfo more pervasively in garden-o-matic",
+ "url": "https://bugs.webkit.org/show_bug.cgi?id=65650",
+ "status": "NEW"
+ }]);
+ });
+ });
+
+ deepEqual(requestedURLs, [
+ "https://bugs.webkit.org/buglist.cgi?ctype=rss&order=bugs.bug_id+desc&quicksearch=garden-o-matic",
+ ]);
+});
+
+test("isOpenStatus", 6, function() {
+ ok(bugzilla.isOpenStatus('UNCONFIRMED'));
+ ok(bugzilla.isOpenStatus('NEW'));
+ ok(bugzilla.isOpenStatus('ASSIGNED'));
+ ok(bugzilla.isOpenStatus('REOPENED'));
+ ok(!bugzilla.isOpenStatus('FIXED'));
+ ok(!bugzilla.isOpenStatus('VERIFIED'));
+});
+
+})();
Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/net_unittests.js (92355 => 92356)
--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/net_unittests.js 2011-08-04 07:14:24 UTC (rev 92355)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/net_unittests.js 2011-08-04 07:14:58 UTC (rev 92356)
@@ -44,6 +44,12 @@
net.probe = self.probe;
if (self.jsonp)
net.jsonp = self.jsonp;
+ if (self.get)
+ net.get = self.get;
+ if (self.post)
+ net.post = self.post;
+ if (self.ajax)
+ net.ajax = self.ajax;
testCase();
Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/run-unittests.html (92355 => 92356)
--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/run-unittests.html 2011-08-04 07:14:24 UTC (rev 92355)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/run-unittests.html 2011-08-04 07:14:58 UTC (rev 92356)
@@ -43,6 +43,8 @@
<script src=""
<script src=""
<script src=""
+<script src=""
+<script src=""
<script src=""
<script src=""
<script src=""
Modified: trunk/Tools/ChangeLog (92355 => 92356)
--- trunk/Tools/ChangeLog 2011-08-04 07:14:24 UTC (rev 92355)
+++ trunk/Tools/ChangeLog 2011-08-04 07:14:58 UTC (rev 92356)
@@ -1,5 +1,19 @@
2011-08-04 Adam Barth <[email protected]>
+ bugzilla.js is missing unit tests
+ https://bugs.webkit.org/show_bug.cgi?id=65656
+
+ Reviewed by Adam Roben.
+
+ Testing makes perfect.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/bugzilla_unittests.js: Added.
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/net_unittests.js:
+ (NetworkSimulator.prototype.runTest.get if):
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/run-unittests.html:
+
+2011-08-04 Adam Barth <[email protected]>
+
Add missing license blocks to garden-o-matic
https://bugs.webkit.org/show_bug.cgi?id=65654