aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-20 15:27:34 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-20 15:27:34 +0000
commitb42105a4a27275da1f52847f60e0615b61d15229 (patch)
tree1c3e0edb859980346a334f48cccfe3db0c2a7f73 /gm
parent130dc91b9359497237191ffd165996fc6d1f84bc (diff)
rebaseline_server: image URLs are relative to JSON file's location
BUG=skia:1455, skia:2230 NOTREECHECKS=True NOTRY=True R=borenet@google.com Author: epoger@google.com Review URL: https://codereview.chromium.org/205273002 git-svn-id: http://skia.googlecode.com/svn/trunk@13874 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm')
-rw-r--r--gm/rebaseline_server/static/loader.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/gm/rebaseline_server/static/loader.js b/gm/rebaseline_server/static/loader.js
index fea5aa0404..562426d406 100644
--- a/gm/rebaseline_server/static/loader.js
+++ b/gm/rebaseline_server/static/loader.js
@@ -164,6 +164,20 @@ Loader.controller(
// If any defaults were overridden in the URL, get them now.
$scope.queryParameters.load();
+ // Any image URLs which are relative should be relative to the JSON
+ // file's source directory; absolute URLs should be left alone.
+ var baseUrlKey = constants.KEY__IMAGESETS__FIELD__BASE_URL;
+ angular.forEach(
+ $scope.imageSets,
+ function(imageSet) {
+ var baseUrl = imageSet[baseUrlKey];
+ if ((baseUrl.substring(0, 1) != '/') &&
+ (baseUrl.indexOf('://') == -1)) {
+ imageSet[baseUrlKey] = $scope.resultsToLoad + '/../' + baseUrl;
+ }
+ }
+ );
+
$scope.updateResults();
$scope.loadingMessage = "";
$scope.windowTitle = "Current GM Results";