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

Side by Side Diff: Tools/GardeningServer/scripts/rollbot_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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Tools/GardeningServer/scripts/rollbot.js ('k') | Tools/GardeningServer/scripts/svn-log.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 }; 155 };
156 156
157 asyncTest("fetchCurrentRoll", 6, function() { 157 asyncTest("fetchCurrentRoll", 6, function() {
158 var simulator = new NetworkSimulator(); 158 var simulator = new NetworkSimulator();
159 simulator.json = function(url) 159 simulator.json = function(url)
160 { 160 {
161 return Promise.resolve(kSearchResults); 161 return Promise.resolve(kSearchResults);
162 }; 162 };
163 163
164 simulator.runTest(function() { 164 simulator.runTest(function() {
165 rollbot.fetchCurrentRoll(function(roll) { 165 rollbot.fetchCurrentRoll().then(function(roll) {
166 equals(roll.issue, 16337011); 166 equals(roll.issue, 16337011);
167 equals(roll.url, "https://codereview.chromium.org/16337011"); 167 equals(roll.url, "https://codereview.chromium.org/16337011");
168 equals(roll.isStopped, false); 168 equals(roll.isStopped, false);
169 equals(roll.fromRevision, "151668"); 169 equals(roll.fromRevision, "151668");
170 equals(roll.toRevision, "151677"); 170 equals(roll.toRevision, "151677");
171 }); 171 });
172 }).then(start); 172 }).then(start);
173 }); 173 });
174 174
175 test("_isRollbotStopped", 1, function() { 175 test("_isRollbotStopped", 1, function() {
176 equals(true, rollbot._isRollbotStopped(kStoppedIssue)); 176 equals(true, rollbot._isRollbotStopped(kStoppedIssue));
177 }); 177 });
178 178
179 })(); 179 })();
OLDNEW
« no previous file with comments | « Tools/GardeningServer/scripts/rollbot.js ('k') | Tools/GardeningServer/scripts/svn-log.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698