From 7687a83272617c4e60e6a5ca68262853b826d48b Mon Sep 17 00:00:00 2001 From: "epoger@google.com" Date: Sun, 15 Sep 2013 02:18:07 +0000 Subject: Add live Javascript viewer for GM expectations BUG=skia:1599 This is similar to the live viewer for GM actuals, at https://skia-autogen.googlecode.com/svn/gm-actual/view.html It will be the basis for GM expectations analysis as described in bug 1599. R=rmistry@google.com Review URL: https://codereview.chromium.org/23493024 git-svn-id: http://skia.googlecode.com/svn/trunk@11280 2bbb7eff-a529-9590-31e7-b0007b416f81 --- expectations/gm/loader.js | 52 +++++++++++++ expectations/gm/view-platform.html | 153 +++++++++++++++++++++++++++++++++++++ 2 files changed, 205 insertions(+) create mode 100644 expectations/gm/loader.js create mode 100644 expectations/gm/view-platform.html (limited to 'expectations') diff --git a/expectations/gm/loader.js b/expectations/gm/loader.js new file mode 100644 index 0000000000..c5d8a7c8c1 --- /dev/null +++ b/expectations/gm/loader.js @@ -0,0 +1,52 @@ +/* + * GMExpectedResultsLoader: + * Reads an expected-results.json file, and imports its data into $scope. + */ +var GMExpectedResultsLoader = angular.module( + 'GMExpectedResultsLoader', + [], + function($httpProvider) { + /* Override transformResponse so that the numeric checksums are interpreted as + * strings instead, since Javascript cannot handle 64-bit integers. */ + $httpProvider.defaults.transformResponse = function(data, headersGetter) { + return JSON.parse(data.replace(/\s(\d+)\s/g, " \"$1\" ")); + } + } +); +GMExpectedResultsLoader.controller( + 'GMExpectedResultsLoader.Controller', + function($scope, $http) { + /* When the changePlatformPath function is called, download expected-results.json + * from the desired platform directory. + * + * When the JSON is received, predigest it and return it to the frontend as + * $scope.gmExpectedResults . + */ + $scope.changePlatformPath = function() { + $http.get($scope.platformPath + "/expected-results.json").success( + function(response) { + var jsonResults = []; + var imageNameRegex = /^(.+)_([^_]+).png/; + angular.forEach(response['expected-results'], function(imageExpectations, imageName) { + var matched = imageNameRegex.exec(imageName); + var allowedImages = []; + angular.forEach(imageExpectations['allowed-digests'], function(allowedDigest, key) { + var thisImage = { + hashType: allowedDigest[0], hashValue: allowedDigest[1] + }; + allowedImages.push(thisImage); + }); + var thisResult = { + test: matched[1], config: matched[2], + allowedImages: allowedImages, + bugs: imageExpectations['bugs'], + reviewedByHuman: imageExpectations['reviewed-by-human'] + }; + jsonResults.push(thisResult); + }); + $scope.gmExpectedResults = jsonResults; + } + ); + }; + } +); diff --git a/expectations/gm/view-platform.html b/expectations/gm/view-platform.html new file mode 100644 index 0000000000..47575bdaac --- /dev/null +++ b/expectations/gm/view-platform.html @@ -0,0 +1,153 @@ + + + + + + View GM Expected Results for One Platform + + + + + +
+ + Pick a platform... + + +

+ Expected GM results for platform {{platformPath}}: + + + + + + + + + + + + + + +
Test/ConfigAllowed ImagesBugsReviewed By Human?
{{result.test}}_{{result.config}} + + {{image.hashValue}}
+
+ {{bug}} + {{result.reviewedByHuman}}
+

+ + + + + -- cgit v1.2.3