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

Side by Side Diff: Tools/GardeningServer/scripts/ui_unittests.js

Issue 316033002: [GOM] Warn when the roll is running behind (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Even better change! Created 6 years, 6 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/ui.js ('k') | Tools/GardeningServer/styles/common.css » ('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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 216
217 var treestatus; 217 var treestatus;
218 simulator.runTest(function() { 218 simulator.runTest(function() {
219 treeStatus = new ui.TreeStatus(); 219 treeStatus = new ui.TreeStatus();
220 }).then(function() { 220 }).then(function() {
221 equal(treeStatus.innerHTML, '<div> blink status: <span>OPEN</span></div> <div> chromium status: <span>OPEN</span></div>'); 221 equal(treeStatus.innerHTML, '<div> blink status: <span>OPEN</span></div> <div> chromium status: <span>OPEN</span></div>');
222 start(); 222 start();
223 }); 223 });
224 }); 224 });
225 225
226 var currentRoll = { 226 function generateRoll(fromRevision, toRevision)
227 "results": [ 227 {
228 {"messages":[], "base_url":"svn://svn.chromium.org/chrome/trunk/src", "s ubject":"Blink roll 540:550", "closed":false, "issue":1000} 228 return {
229 ] 229 "results": [
230 }; 230 {"messages":[], "base_url":"svn://svn.chromium.org/chrome/trunk/src" , "subject":"Blink roll " + fromRevision + ":" + toRevision, "closed":false, "is sue":1000}
231 ]
232 };
233 }
231 234
232 asyncTest("RevisionDetails", 2, function() { 235 asyncTest("RevisionDetailsSmallRoll", 2, function() {
236 var rollFromRevision = 540;
237 var rollToRevision = 550;
233 var simulator = new NetworkSimulator(); 238 var simulator = new NetworkSimulator();
234 simulator.json = function(url) 239 simulator.json = function(url)
235 { 240 {
236 return Promise.resolve(currentRoll); 241 return Promise.resolve(generateRoll(rollFromRevision, rollToRevision));
237 } 242 }
243
238 simulator.get = function (url) 244 simulator.get = function (url)
239 { 245 {
240 return Promise.resolve("540"); 246 return Promise.resolve(rollFromRevision);
241 } 247 }
242 248
243 model.state.resultsByBuilder = { 249 model.state.resultsByBuilder = {
244 "Linux": { 250 "Linux": {
245 "blink_revision": "554", 251 "blink_revision": "554",
246 } 252 }
247 }; 253 };
248 model.state.recentCommits = [ 254 model.state.recentCommits = [
249 { 255 {
250 "revision": "555", 256 "revision": "555",
(...skipping 25 matching lines...) Expand all
276 '</tr>' + 282 '</tr>' +
277 '</table>' + 283 '</table>' +
278 '</details>' + 284 '</details>' +
279 ', trunk is at <a href="http://src.chromium.org/viewvc/blink?vie w=rev&amp;revision=555">555</a>' + 285 ', trunk is at <a href="http://src.chromium.org/viewvc/blink?vie w=rev&amp;revision=555">555</a>' +
280 '<br>' + 286 '<br>' +
281 'Last roll is to <a href="http://src.chromium.org/viewvc/blink?v iew=rev&amp;revision=540">540</a>, current autoroll <a href="https://codereview. chromium.org/1000">540:550</a>'); 287 'Last roll is to <a href="http://src.chromium.org/viewvc/blink?v iew=rev&amp;revision=540">540</a>, current autoroll <a href="https://codereview. chromium.org/1000">540:550</a>');
282 start(); 288 start();
283 }); 289 });
284 }); 290 });
285 291
292 asyncTest("RevisionDetailsMediumRoll", 2, function() {
293 var rollFromRevision = 500;
294 var rollToRevision = 550;
295 var simulator = new NetworkSimulator();
296 simulator.json = function(url)
297 {
298 return Promise.resolve(generateRoll(rollFromRevision, rollToRevision));
299 }
300
301 simulator.get = function (url)
302 {
303 return Promise.resolve(rollFromRevision);
304 }
305
306 model.state.resultsByBuilder = {
307 "Linux": {
308 "blink_revision": "554",
309 }
310 };
311 model.state.recentCommits = [
312 {
313 "revision": "555",
314 }];
315
316 var revisionDetails;
317 simulator.runTest(function() {
318 revisionDetails = ui.revisionDetails();
319 }).then(function() {
320 equal(revisionDetails.innerHTML,
321 'Latest revision processed by every bot: ' +
322 '<details>' +
323 '<summary>' +
324 '<a href="http://src.chromium.org/viewvc/blink?view=rev& amp;revision=554">554' +
325 '<span id="revisionPopUp">' +
326 '<table>' +
327 '<tr>' +
328 '<td><a href="http://build.chromium.org/ p/chromium.webkit/waterfall?builder=Linux">Linux</a></td>' +
329 '<td>554</td>' +
330 '</tr>' +
331 '</table>' +
332 '</span>' +
333 '</a>' +
334 '</summary>' +
335 '<table>' +
336 '<tr>' +
337 '<td><a href="http://build.chromium.org/p/chromium.w ebkit/waterfall?builder=Linux">Linux</a></td>' +
338 '<td>554</td>' +
339 '</tr>' +
340 '</table>' +
341 '</details>' +
342 ', trunk is at <a href="http://src.chromium.org/viewvc/blink?vie w=rev&amp;revision=555">555</a>' +
343 '<br>' +
344 'Last roll is to <a href="http://src.chromium.org/viewvc/blink?v iew=rev&amp;revision=500">500</a><span class="warning">(55 revisions behind)</sp an>, current autoroll <a href="https://codereview.chromium.org/1000">500:550</a> ');
345 start();
346 });
347 });
348
349 asyncTest("RevisionDetailsBigRoll", 2, function() {
350 var rollFromRevision = 440;
351 var rollToRevision = 550;
352 var simulator = new NetworkSimulator();
353 simulator.json = function(url)
354 {
355 return Promise.resolve(generateRoll(rollFromRevision, rollToRevision));
356 }
357
358 simulator.get = function (url)
359 {
360 return Promise.resolve(rollFromRevision);
361 }
362
363 model.state.resultsByBuilder = {
364 "Linux": {
365 "blink_revision": "554",
366 }
367 };
368 model.state.recentCommits = [
369 {
370 "revision": "555",
371 }];
372
373 var revisionDetails;
374 simulator.runTest(function() {
375 revisionDetails = ui.revisionDetails();
376 }).then(function() {
377 equal(revisionDetails.innerHTML,
378 'Latest revision processed by every bot: ' +
379 '<details>' +
380 '<summary>' +
381 '<a href="http://src.chromium.org/viewvc/blink?view=rev& amp;revision=554">554' +
382 '<span id="revisionPopUp">' +
383 '<table>' +
384 '<tr>' +
385 '<td><a href="http://build.chromium.org/ p/chromium.webkit/waterfall?builder=Linux">Linux</a></td>' +
386 '<td>554</td>' +
387 '</tr>' +
388 '</table>' +
389 '</span>' +
390 '</a>' +
391 '</summary>' +
392 '<table>' +
393 '<tr>' +
394 '<td><a href="http://build.chromium.org/p/chromium.w ebkit/waterfall?builder=Linux">Linux</a></td>' +
395 '<td>554</td>' +
396 '</tr>' +
397 '</table>' +
398 '</details>' +
399 ', trunk is at <a href="http://src.chromium.org/viewvc/blink?vie w=rev&amp;revision=555">555</a>' +
400 '<br>' +
401 'Last roll is to <a href="http://src.chromium.org/viewvc/blink?v iew=rev&amp;revision=440">440</a><span class="critical">(115 revisions behind)</ span>, current autoroll <a href="https://codereview.chromium.org/1000">440:550</ a>');
402 start();
403 });
404 });
405
286 })(); 406 })();
OLDNEW
« no previous file with comments | « Tools/GardeningServer/scripts/ui.js ('k') | Tools/GardeningServer/styles/common.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698