Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1477)

Unified Diff: Tools/GardeningServer/scripts/ui/results_unittests.js

Issue 173133003: Convert garden-o-matic guts over to promises where appropriate (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: update to ToT Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Tools/GardeningServer/scripts/ui/results.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Tools/GardeningServer/scripts/ui/results_unittests.js
diff --git a/Tools/GardeningServer/scripts/ui/results_unittests.js b/Tools/GardeningServer/scripts/ui/results_unittests.js
index 4dd546f33a5555933b9327323a4b2d457f24d369..66ef774084fe77979575fe5de7403c7041f8ffeb 100644
--- a/Tools/GardeningServer/scripts/ui/results_unittests.js
+++ b/Tools/GardeningServer/scripts/ui/results_unittests.js
@@ -124,7 +124,7 @@ var kExampleGreaterThanFourResultsByTest = {
test('View', 18, function() {
var delegate = {
- fetchResultsURLs: function(failureInfo, callback) { return; }
+ fetchResultsURLs: function(failureInfo) { return Promise.resolve(); }
};
var view = new ui.results.View(delegate);
@@ -166,7 +166,7 @@ test('View', 18, function() {
test('View with more than four tests', 2, function() {
var delegate = {
- fetchResultsURLs: function(failureInfo, callback) { return; }
+ fetchResultsURLs: function(failureInfo) { return Promise.resolve(); }
};
var view = new ui.results.View(delegate);
@@ -181,7 +181,7 @@ test('View with more than four tests', 2, function() {
test('View with reftests', 2, function() {
var delegate = {
- fetchResultsURLs: function(failureInfo, callback) { return; }
+ fetchResultsURLs: function(failureInfo) { return Promise.resolve(); }
};
var view = new ui.results.View(delegate);
@@ -192,16 +192,19 @@ test('View with reftests', 2, function() {
equals($('.action', view).length, 0);
});
-test('View of timeouts', 1, function() {
+asyncTest('View of timeouts', 1, function() {
+ var emptyPromise = Promise.resolve([]);
var delegate = {
- fetchResultsURLs: function(failureInfo, callback) { callback([]); }
+ fetchResultsURLs: function(failureInfo) { return emptyPromise; }
};
var view = new ui.results.View(delegate);
view.setResultsByTest(kExampleResultsWithTimeoutByTest);
view.firstResult();
-
- equals($('.results-grid', view).html(), 'No results to display.');
+ emptyPromise.then(function() {
+ equals($('.results-grid', view).html(), 'No results to display.');
+ start();
+ });
});
})();
« no previous file with comments | « Tools/GardeningServer/scripts/ui/results.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698