Title: [136352] trunk/Tools
- Revision
- 136352
- Author
- [email protected]
- Date
- 2012-12-02 13:18:38 -0800 (Sun, 02 Dec 2012)
Log Message
Garden-o-matic shouldn't die when blank JSON results are received.
https://bugs.webkit.org/show_bug.cgi?id=103838
Reviewed by Adam Barth.
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/base.js:
If the JSONP string doesn't contain '(' or ')', return an empty object.
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/base_unittests.js:
Check that this behavior stays in place.
Modified Paths
Diff
Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/base.js (136351 => 136352)
--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/base.js 2012-12-02 20:48:09 UTC (rev 136351)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/base.js 2012-12-02 21:18:38 UTC (rev 136352)
@@ -178,6 +178,8 @@
{
var startIndex = jsonp.indexOf('(') + 1;
var endIndex = jsonp.lastIndexOf(')');
+ if (startIndex == 0 || endIndex == -1)
+ return {};
return JSON.parse(jsonp.substr(startIndex, endIndex - startIndex));
};
Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/base_unittests.js (136351 => 136352)
--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/base_unittests.js 2012-12-02 20:48:09 UTC (rev 136351)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/base_unittests.js 2012-12-02 21:18:38 UTC (rev 136352)
@@ -466,4 +466,9 @@
ok(!base.getURLParameter('non-existant'));
});
+test("parseJSONP", 2, function() {
+ deepEqual(base.parseJSONP(""), {});
+ deepEqual(base.parseJSONP('p({"key": "value"})'), {"key": "value"});
+});
+
})();
Modified: trunk/Tools/ChangeLog (136351 => 136352)
--- trunk/Tools/ChangeLog 2012-12-02 20:48:09 UTC (rev 136351)
+++ trunk/Tools/ChangeLog 2012-12-02 21:18:38 UTC (rev 136352)
@@ -1,3 +1,15 @@
+2012-12-02 Mike West <[email protected]>
+
+ Garden-o-matic shouldn't die when blank JSON results are received.
+ https://bugs.webkit.org/show_bug.cgi?id=103838
+
+ Reviewed by Adam Barth.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/base.js:
+ If the JSONP string doesn't contain '(' or ')', return an empty object.
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/base_unittests.js:
+ Check that this behavior stays in place.
+
2012-12-02 Eric Seidel <[email protected]>
run-perf-tests --profile should use iprofiler instead of instruments on Mac
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes