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 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 var kPreferredSuffixOrder = [ | 53 var kPreferredSuffixOrder = [ |
54 kExpectedImageSuffix, | 54 kExpectedImageSuffix, |
55 kActualImageSuffix, | 55 kActualImageSuffix, |
56 kImageDiffSuffix, | 56 kImageDiffSuffix, |
57 kExpectedTextSuffix, | 57 kExpectedTextSuffix, |
58 kActualTextSuffix, | 58 kActualTextSuffix, |
59 kDiffTextSuffix, | 59 kDiffTextSuffix, |
60 kCrashLogSuffix, | 60 kCrashLogSuffix, |
61 kExpectedAudioSuffix, | 61 kExpectedAudioSuffix, |
62 kActualAudioSuffix, | 62 kActualAudioSuffix, |
63 // FIXME: Add support for the rest of the result types. | |
64 ]; | 63 ]; |
65 | 64 |
66 // Kinds of results. | 65 // Kinds of results. |
67 results.kActualKind = 'actual'; | 66 results.kActualKind = 'actual'; |
68 results.kExpectedKind = 'expected'; | 67 results.kExpectedKind = 'expected'; |
69 results.kDiffKind = 'diff'; | 68 results.kDiffKind = 'diff'; |
70 results.kUnknownKind = 'unknown'; | 69 results.kUnknownKind = 'unknown'; |
71 | 70 |
72 // Types of tests. | 71 // Types of tests. |
73 results.kImageType = 'image'; | 72 results.kImageType = 'image'; |
74 results.kAudioType = 'audio'; | 73 results.kAudioType = 'audio'; |
75 results.kTextType = 'text'; | 74 results.kTextType = 'text'; |
76 // FIXME: There are more types of tests. | |
77 | 75 |
78 function possibleSuffixListFor(failureTypeList) | 76 function possibleSuffixListFor(failureTypeList) |
79 { | 77 { |
80 var suffixList = []; | 78 var suffixList = []; |
81 | 79 |
82 function pushImageSuffixes() | 80 function pushImageSuffixes() |
83 { | 81 { |
84 suffixList.push(kExpectedImageSuffix); | 82 suffixList.push(kExpectedImageSuffix); |
85 suffixList.push(kActualImageSuffix); | 83 suffixList.push(kActualImageSuffix); |
86 suffixList.push(kImageDiffSuffix); | 84 suffixList.push(kImageDiffSuffix); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 return base.uniquifyArray(suffixList); | 133 return base.uniquifyArray(suffixList); |
136 } | 134 } |
137 | 135 |
138 function failureTypeList(failureBlob) | 136 function failureTypeList(failureBlob) |
139 { | 137 { |
140 return failureBlob.split(' '); | 138 return failureBlob.split(' '); |
141 }; | 139 }; |
142 | 140 |
143 function resultsDirectoryURL(builderName) | 141 function resultsDirectoryURL(builderName) |
144 { | 142 { |
145 if (config.useLocalResults) | |
146 return '/localresult?path='; | |
147 return config.layoutTestResultsURL + '/' + config.resultsDirectoryNameFromBu
ilderName(builderName) + '/results/layout-test-results/'; | 143 return config.layoutTestResultsURL + '/' + config.resultsDirectoryNameFromBu
ilderName(builderName) + '/results/layout-test-results/'; |
148 } | 144 } |
149 | 145 |
150 function resultsDirectoryURLForBuildNumber(builderName, buildNumber) | 146 function resultsDirectoryURLForBuildNumber(builderName, buildNumber) |
151 { | 147 { |
152 return config.layoutTestResultsURL + '/' + config.resultsDirectoryNameFromBu
ilderName(builderName) + '/' + buildNumber + '/' ; | 148 return config.layoutTestResultsURL + '/' + config.resultsDirectoryNameFromBu
ilderName(builderName) + '/' + buildNumber + '/' ; |
153 } | 149 } |
154 | 150 |
155 function resultsSummaryURL(builderName) | 151 function resultsSummaryURL(builderName) |
156 { | 152 { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 | 235 |
240 results.failureInfo = function(testName, builderName, result) | 236 results.failureInfo = function(testName, builderName, result) |
241 { | 237 { |
242 return { | 238 return { |
243 'testName': testName, | 239 'testName': testName, |
244 'builderName': builderName, | 240 'builderName': builderName, |
245 'failureTypeList': failureTypeList(result), | 241 'failureTypeList': failureTypeList(result), |
246 }; | 242 }; |
247 } | 243 } |
248 | 244 |
249 results.failureInfoForTestAndBuilder = function(resultsByTest, testName, builder
Name) | |
250 { | |
251 return results.failureInfo(testName, builderName, resultsByTest[testName][bu
ilderName].actual) | |
252 }; | |
253 | |
254 results.collectUnexpectedResults = function(dictionaryOfResultNodes) | |
255 { | |
256 var collectedResults = []; | |
257 Object.keys(dictionaryOfResultNodes, function(key, resultNode) { | |
258 var analyzer = new results.ResultAnalyzer(resultNode); | |
259 collectedResults = collectedResults.concat(analyzer.unexpectedResults())
; | |
260 }); | |
261 return base.uniquifyArray(collectedResults); | |
262 }; | |
263 | |
264 // Callback data is [{ buildNumber:, url: }] | 245 // Callback data is [{ buildNumber:, url: }] |
265 function historicalResultsLocations(builderName) | 246 function historicalResultsLocations(builderName) |
266 { | 247 { |
267 return builders.mostRecentBuildForBuilder(builderName).then(function (mostRe
centBuildNumber) { | 248 return builders.mostRecentBuildForBuilder(builderName).then(function (mostRe
centBuildNumber) { |
268 var resultsLocations = []; | 249 var resultsLocations = []; |
269 // Return the builds in reverse chronological order in order to load the
most recent data first. | 250 // Return the builds in reverse chronological order in order to load the
most recent data first. |
270 for (var buildNumber = mostRecentBuildNumber; buildNumber > mostRecentBu
ildNumber - 100; --buildNumber) { | 251 for (var buildNumber = mostRecentBuildNumber; buildNumber > mostRecentBu
ildNumber - 100; --buildNumber) { |
271 resultsLocations.push({ | 252 resultsLocations.push({ |
272 'buildNumber': buildNumber, | 253 'buildNumber': buildNumber, |
273 'url': resultsDirectoryURLForBuildNumber(builderName, buildNumbe
r) + "failing_results.json" | 254 'url': resultsDirectoryURLForBuildNumber(builderName, buildNumbe
r) + "failing_results.json" |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 fetchPromises.push(net.jsonp(resultsURL).then(function(resultsTree) { | 451 fetchPromises.push(net.jsonp(resultsURL).then(function(resultsTree) { |
471 resultsByBuilder[builderName] = resultsTree; | 452 resultsByBuilder[builderName] = resultsTree; |
472 })); | 453 })); |
473 }); | 454 }); |
474 return Promise.all(fetchPromises).then(function() { | 455 return Promise.all(fetchPromises).then(function() { |
475 return resultsByBuilder; | 456 return resultsByBuilder; |
476 }); | 457 }); |
477 }; | 458 }; |
478 | 459 |
479 })(); | 460 })(); |
OLD | NEW |