| Index: Tools/GardeningServer/scripts/ui_unittests.js
|
| diff --git a/Tools/GardeningServer/scripts/treestatus.js b/Tools/GardeningServer/scripts/ui_unittests.js
|
| similarity index 61%
|
| copy from Tools/GardeningServer/scripts/treestatus.js
|
| copy to Tools/GardeningServer/scripts/ui_unittests.js
|
| index 3e7514bab125ab2fd91a878c6f7981b5703485e6..c9b361896877819022042aa77bae4a609ede05f2 100644
|
| --- a/Tools/GardeningServer/scripts/treestatus.js
|
| +++ b/Tools/GardeningServer/scripts/ui_unittests.js
|
| @@ -23,26 +23,26 @@
|
| * THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| -var treestatus = treestatus || {};
|
| +(function () {
|
|
|
| -(function() {
|
| +module("ui");
|
|
|
| -// FIXME: Turn this into a model-object class.
|
| -treestatus.urlByName = function(name) {
|
| - if (name == 'blink')
|
| - return "http://blink-status.appspot.com/";
|
| - if (name == 'chromium')
|
| - return "http://chromium-status.appspot.com/";
|
| - return null;
|
| -}
|
| +var flakinessBaseUrl = 'http://test-results.appspot.com/dashboards/flakiness_dashboard.html#';
|
|
|
| -treestatus.fetchTreeStatus = function(statusURL, resultSpan) {
|
| - return net.json(statusURL).then(function(statusJSON) {
|
| - if (statusJSON.can_commit_freely)
|
| - resultSpan.textContent = "OPEN";
|
| - else
|
| - resultSpan.textContent = statusJSON.message + " by " + statusJSON.username;
|
| - });
|
| -};
|
| +test('urlForFlakinessDashboard', 4, function() {
|
| + equal(ui.urlForFlakinessDashboard('foo', 'bar'),
|
| + flakinessBaseUrl + 'tests=foo&testType=bar');
|
| + equal(ui.urlForFlakinessDashboard(['foo', 'baz'], 'bar'),
|
| + flakinessBaseUrl + 'tests=foo%2Cbaz&testType=bar');
|
| + equal(ui.urlForFlakinessDashboard('foo', 'webkit_tests'),
|
| + flakinessBaseUrl + 'tests=foo&testType=layout-tests');
|
| + equal(ui.urlForFlakinessDashboard('foo', 'layout-tests'),
|
| + flakinessBaseUrl + 'tests=foo&testType=layout-tests');
|
| +});
|
| +
|
| +test('urlForEmbeddedFlakinessDashboard', 1, function() {
|
| + equal(ui.urlForEmbeddedFlakinessDashboard('foo', 'bar'),
|
| + flakinessBaseUrl + 'tests=foo&testType=bar&showChrome=false');
|
| +});
|
|
|
| })();
|
|
|