From 4a89faa5d4e8b7ef84e8a1658359e2bc0dc1f1b1 Mon Sep 17 00:00:00 2001 From: "ojan@chromium.org" Date: Fri, 5 Mar 2010 02:25:00 +0000 Subject: Make the dashboard understand which builder linked to it so that it can use the right dataset for the v8-latest and webkit.org bots. Review URL: http://codereview.chromium.org/669138 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40706 0039d316-1c4b-4281-b951-d872f2087c98 --- .../layout_tests/dashboards/dashboard_base.js | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'webkit') diff --git a/webkit/tools/layout_tests/dashboards/dashboard_base.js b/webkit/tools/layout_tests/dashboards/dashboard_base.js index a98283a..832500e 100644 --- a/webkit/tools/layout_tests/dashboards/dashboard_base.js +++ b/webkit/tools/layout_tests/dashboards/dashboard_base.js @@ -68,6 +68,12 @@ function isFailingResult(value) { return 'FSTOCIZ'.indexOf(value) != -1; } +function reloadWindowIfKeyHasNewValue(key) { + // Changing certain keys requires reloading the page since it would result + // in pulling different JSON files. + if (oldState && oldState[key] != currentState[key]) + window.location.reload(); +} /** * Takes a key and a value and sets the currentState[key] = value iff key is @@ -93,6 +99,21 @@ function handleValidHashParameterWrapper(key, value) { currentState[key] = value == 'true'; return true; + case 'referringBuilder': + if (stringContains(value, "(webkit.org)")) { + currentState.useWebKitCanary = true; + reloadWindowIfKeyHasNewValue('useWebKitCanary'); + return true; + } + + if (stringContains(value, "(V8-Latest)")) { + currentState.useV8Canary = true; + reloadWindowIfKeyHasNewValue('useV8Canary'); + return true; + } + + return false; + case 'buildDir': currentState['testType'] = 'layout-test-results'; if (value === 'Debug' || value == 'Release') { @@ -155,6 +176,7 @@ function validateParameter(state, key, value, validateFn) { * Parses window.location.hash and set the currentState values appropriately. */ function parseParameters(parameterStr) { + oldState = currentState; currentState = {}; var params = window.location.hash.substring(1).split('&'); @@ -201,6 +223,10 @@ function appendScript(path) { // Permalinkable state of the page. var currentState; +// Saved value of previous currentState. This is used to detect changing from +// one set of builders to another, which requires reloading the page. +var oldState; + // Parse cross-dashboard parameters before using them. parseParameters(); -- cgit v1.1