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

Side by Side Diff: expectations/gm/loader.js

Issue 848073005: Revert "delete old things!" (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | expectations/gm/view-platform.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * GMExpectedResultsLoader:
3 * Reads an expected-results.json file, and imports its data into $scope.
4 */
5 var GMExpectedResultsLoader = angular.module(
6 'GMExpectedResultsLoader',
7 [],
8 function($httpProvider) {
9 /* Override transformResponse so that the numeric checksums are interprete d as
10 * strings instead, since Javascript cannot handle 64-bit integers. */
11 $httpProvider.defaults.transformResponse = function(data, headersGetter) {
12 return JSON.parse(data.replace(/\s(\d+)\s/g, " \"$1\" "));
13 }
14 }
15 );
16 GMExpectedResultsLoader.controller(
17 'GMExpectedResultsLoader.Controller',
18 function($scope, $http) {
19 /* When the changePlatformPath function is called, download expected-resul ts.json
20 * from the desired platform directory.
21 *
22 * When the JSON is received, predigest it and return it to the frontend a s
23 * $scope.gmExpectedResults .
24 */
25 $scope.changePlatformPath = function() {
26 $http.get($scope.platformPath + "/expected-results.json").success(
27 function(response) {
28 var jsonResults = [];
29 var imageNameRegex = /^(.+)_([^_]+).png/;
30 angular.forEach(response['expected-results'], function(imageExpect ations, imageName) {
31 var matched = imageNameRegex.exec(imageName);
32 var allowedImages = [];
33 angular.forEach(imageExpectations['allowed-digests'], function(a llowedDigest, key) {
34 var thisImage = {
35 hashType: allowedDigest[0], hashValue: allowedDigest[1]
36 };
37 allowedImages.push(thisImage);
38 });
39 var thisResult = {
40 test: matched[1], config: matched[2],
41 allowedImages: allowedImages,
42 bugs: imageExpectations['bugs'],
43 reviewedByHuman: imageExpectations['reviewed-by-human']
44 };
45 jsonResults.push(thisResult);
46 });
47 $scope.gmExpectedResults = jsonResults;
48 }
49 );
50 };
51 }
52 );
OLDNEW
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | expectations/gm/view-platform.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698