OLD | NEW |
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 |
11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
12 * | 12 * |
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' | 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' |
14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS | 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS |
17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
23 * THE POSSIBILITY OF SUCH DAMAGE. | 23 * THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 var controllers = controllers || {}; | 26 var controllers = controllers || {}; |
27 | 27 |
28 (function(){ | 28 (function(){ |
29 | 29 |
30 var kCheckoutUnavailableMessage = 'Failed! Garden-o-matic needs a local server t
o modify your working copy. Please run "webkit-patch garden-o-matic" start the l
ocal server.'; | |
31 | |
32 // FIXME: This is duplicated from ui/results.js :(. | 30 // FIXME: This is duplicated from ui/results.js :(. |
33 function isAnyReftest(testName, resultsByTest) | 31 function isAnyReftest(testName, resultsByTest) |
34 { | 32 { |
35 return Object.keys(resultsByTest[testName]).map(function(builder) { | 33 return Object.keys(resultsByTest[testName]).map(function(builder) { |
36 return resultsByTest[testName][builder]; | 34 return resultsByTest[testName][builder]; |
37 }).some(function(resultNode) { | 35 }).some(function(resultNode) { |
38 return resultNode.reftest_type && resultNode.reftest_type.length; | 36 return resultNode.reftest_type && resultNode.reftest_type.length; |
39 }); | 37 }); |
40 } | 38 } |
41 | 39 |
42 // FIXME: Where should this function go? | 40 // FIXME: Where should this function go? |
43 function updateExpectationsWithStatusUpdates(failureInfoList) | 41 function updateExpectationsWithStatusUpdates(failureInfoList) |
44 { | 42 { |
45 var statusView = new ui.StatusArea('Expectations Update'); | 43 var statusView = new ui.StatusArea('Expectations Update'); |
46 var id = statusView.newId(); | 44 var id = statusView.newId(); |
47 | 45 |
48 var testNames = base.uniquifyArray(failureInfoList.map(function(failureInfo)
{ return failureInfo.testName; })); | 46 var testNames = base.uniquifyArray(failureInfoList.map(function(failureInfo)
{ return failureInfo.testName; })); |
49 var testName = testNames.length == 1 ? testNames[0] : testNames.length + ' t
ests'; | 47 var testName = testNames.length == 1 ? testNames[0] : testNames.length + ' t
ests'; |
50 statusView.addMessage(id, 'Updating expectations of ' + testName + '...'); | 48 statusView.addMessage(id, 'Updating expectations of ' + testName + '...'); |
51 | |
52 checkout.updateExpectations(failureInfoList, function() { | |
53 statusView.addFinalMessage(id, 'Expectations update done! Please commit
them locally and land with "git cl dcommit".'); | |
54 }, function() { | |
55 statusView.addFinalMessage(id, kCheckoutUnavailableMessage); | |
56 }); | |
57 } | 49 } |
58 | 50 |
59 controllers.ResultsDetails = base.extends(Object, { | 51 controllers.ResultsDetails = base.extends(Object, { |
60 init: function(view, resultsByTest) | 52 init: function(view, resultsByTest) |
61 { | 53 { |
62 this._view = view; | 54 this._view = view; |
63 this._resultsByTest = resultsByTest; | 55 this._resultsByTest = resultsByTest; |
64 this._view.setResultsByTest(resultsByTest); | 56 this._view.setResultsByTest(resultsByTest); |
65 | 57 |
66 this._view.firstResult(); | 58 this._view.firstResult(); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 }, | 207 }, |
216 update: function(failureAnalysis) | 208 update: function(failureAnalysis) |
217 { | 209 { |
218 var failure = FailureStreamController.prototype.update.call(this, failur
eAnalysis); | 210 var failure = FailureStreamController.prototype.update.call(this, failur
eAnalysis); |
219 failure.updateBuilderResults(model.buildersInFlightForRevision(this._imp
liedFirstFailingRevision(failureAnalysis))); | 211 failure.updateBuilderResults(model.buildersInFlightForRevision(this._imp
liedFirstFailingRevision(failureAnalysis))); |
220 }, | 212 }, |
221 length: function() | 213 length: function() |
222 { | 214 { |
223 return this._testFailures.length(); | 215 return this._testFailures.length(); |
224 }, | 216 }, |
225 onRollout: function(revision, testNameList) | |
226 { | |
227 checkout.rollout(revision, ui.rolloutReasonForTestNameList(testNameList)
).then($.noop, function() { | |
228 // FIXME: We should have a better error UI. | |
229 alert(kCheckoutUnavailableMessage); | |
230 }); | |
231 } | |
232 }); | 217 }); |
233 | 218 |
234 controllers.FailingBuilders = base.extends(Object, { | 219 controllers.FailingBuilders = base.extends(Object, { |
235 init: function(view, message) | 220 init: function(view, message) |
236 { | 221 { |
237 this._view = view; | 222 this._view = view; |
238 this._message = message; | 223 this._message = message; |
239 this._notification = null; | 224 this._notification = null; |
240 }, | 225 }, |
241 hasFailures: function() | 226 hasFailures: function() |
(...skipping 13 matching lines...) Expand all Loading... |
255 this._notification = new ui.notifications.BuildersFailing(this._mess
age); | 240 this._notification = new ui.notifications.BuildersFailing(this._mess
age); |
256 this._view.add(this._notification); | 241 this._view.add(this._notification); |
257 } | 242 } |
258 // FIXME: We should provide regression ranges for the failing builders. | 243 // FIXME: We should provide regression ranges for the failing builders. |
259 // This doesn't seem to happen often enough to worry too much about that
, however. | 244 // This doesn't seem to happen often enough to worry too much about that
, however. |
260 this._notification.setFailingBuilders(failuresList); | 245 this._notification.setFailingBuilders(failuresList); |
261 } | 246 } |
262 }); | 247 }); |
263 | 248 |
264 })(); | 249 })(); |
OLD | NEW |