Changeset 147457 in webkit
- Timestamp:
- Apr 2, 2013 10:59:14 AM (11 years ago)
- Location:
- trunk/Tools
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r147416 r147457 1 2013-04-02 Julie Parent <jparent@chromium.org> 2 3 Dashboard refactor: Move dashboard specific history related features to History. 4 https://bugs.webkit.org/show_bug.cgi?id=113717 5 6 Reviewed by Ojan Vafai. 7 8 Each dashboard now creates its own History object, with a custom 9 configuration. This changes from just overriding global functions 10 to passing in callbacks for generatePage, handleValidHashParameter, 11 and handleQueryParameterChange. Same with passing in defaultStateValues 12 and DB_SPECIFIC_INVALIDATING_PARAMS, rather than overriding the global 13 variables. 14 15 All functions related to these features are now (mostly) private 16 function on History. 17 18 Loader no longer needs a loadingComplete callback, since it can just 19 initialize the history object itself. 20 21 * TestResultServer/static-dashboards/aggregate_results.js: 22 (handleValidHashParameter): 23 * TestResultServer/static-dashboards/dashboard_base.js: 24 * TestResultServer/static-dashboards/flakiness_dashboard.js: 25 (generatePage): 26 (.switch.return): 27 (handleQueryParameterChange): 28 * TestResultServer/static-dashboards/flakiness_dashboard_unittests.js: 29 (resetGlobals): 30 * TestResultServer/static-dashboards/history.js: 31 (.): 32 * TestResultServer/static-dashboards/loader.js: 33 (.): 34 * TestResultServer/static-dashboards/loader_unittests.js: 35 * TestResultServer/static-dashboards/timeline_explorer.js: 36 (generatePage): 37 (initCurrentBuilderTestResults): 38 * TestResultServer/static-dashboards/treemap.js: 39 (generatePage): 40 (.switch.return): 41 (handleQueryParameterChange): 42 1 43 2013-04-02 Sheriff Bot <webkit.review.bot@gmail.com> 2 44 -
trunk/Tools/TestResultServer/static-dashboards/aggregate_results.js
r146797 r147457 35 35 // -add the builder name to the list of builders in dashboard_base.js. 36 36 37 ////////////////////////////////////////////////////////////////////////////// 38 // Methods and objects from dashboard_base.js to override. 39 ////////////////////////////////////////////////////////////////////////////// 40 function generatePage() 37 function generatePage(historyInstance) 41 38 { 42 39 var html = ui.html.testTypeSwitcher(true) + '<br>'; … … 46 43 } 47 44 48 function handleValidHashParameter( key, value)45 function handleValidHashParameter(historyInstance, key, value) 49 46 { 50 47 switch(key) { 51 48 case 'rawValues': 52 g_history.dashboardSpecificState[key] = value == 'true';49 historyInstance.dashboardSpecificState[key] = value == 'true'; 53 50 return true; 54 51 … … 58 55 } 59 56 60 g_defaultDashboardSpecificStateValues = {57 var defaultDashboardSpecificStateValues = { 61 58 rawValues: false 62 59 }; 60 61 62 var aggregateResultsConfig = { 63 defaultStateValues: defaultDashboardSpecificStateValues, 64 generatePage: generatePage, 65 handleValidHashParameter: handleValidHashParameter, 66 }; 67 68 // FIXME(jparent): Eventually remove all usage of global history object. 69 var g_history = new history.History(aggregateResultsConfig); 70 g_history.parseCrossDashboardParameters(); 63 71 64 72 function htmlForBuilder(builder) … … 268 276 269 277 window.addEventListener('load', function() { 270 var resourceLoader = new loader.Loader( intializeHistory);278 var resourceLoader = new loader.Loader(); 271 279 resourceLoader.load(); 272 280 }, false); -
trunk/Tools/TestResultServer/static-dashboards/dashboard_base.js
r146797 r147457 30 30 // from the testing bots. This deals with generic utility functions, visible 31 31 // history, popups and appending the script elements for the JSON files. 32 // 33 // The calling page is expected to implement the following "abstract" 34 // functions/objects: 35 36 // Generates the contents of the dashboard. The page should override this with 37 // a function that generates the page assuming all resources have loaded. 38 function generatePage() {} 39 40 // Takes a key and a value and sets the g_history.dashboardSpecificState[key] = value iff key is 41 // a valid hash parameter and the value is a valid value for that key. 42 // 43 // @return {boolean} Whether the key what inserted into the g_history.dashboardSpecificState. 44 function handleValidHashParameter(key, value) 45 { 46 return false; 47 } 48 49 // Default hash parameters for the page. The page should override this to create 50 // default states. 51 var g_defaultDashboardSpecificStateValues = {}; 52 53 54 // The page should override this to modify page state due to 55 // changing query parameters. 56 // @param {Object} params New or modified query params as key: value. 57 // @return {boolean} Whether changing this parameter should cause generatePage to be called. 58 function handleQueryParameterChange(params) 59 { 60 return true; 61 } 32 62 33 63 34 ////////////////////////////////////////////////////////////////////////////// … … 85 56 }; 86 57 87 // Map of parameter to other parameter it invalidates.88 var CROSS_DB_INVALIDATING_PARAMETERS = {89 'testType': 'group'90 };91 var DB_SPECIFIC_INVALIDATING_PARAMETERS;92 58 93 59 // Keys in the JSON files. … … 168 134 } 169 135 170 function parseDashboardSpecificParameters()171 {172 g_history.dashboardSpecificState = {};173 var parameters = history.queryHashAsMap();174 for (parameterName in g_defaultDashboardSpecificStateValues)175 g_history.parseParameter(parameters, parameterName);176 }177 178 function defaultValue(key)179 {180 if (key in g_defaultDashboardSpecificStateValues)181 return g_defaultDashboardSpecificStateValues[key];182 return history.DEFAULT_CROSS_DASHBOARD_STATE_VALUES[key];183 }184 185 // TODO(jparent): Each db should create their own history obj, not global.186 var g_history = new history.History();187 g_history.parseCrossDashboardParameters();188 189 136 function currentBuilderGroupCategory() 190 137 { … … 237 184 } 238 185 239 function handleLocationChange()240 {241 if (g_history.parseParameters())242 generatePage();243 }244 245 // TODO(jparent): Move this to upcoming History object.246 function intializeHistory() {247 window.onhashchange = handleLocationChange;248 handleLocationChange();249 }250 251 186 // Create a new function with some of its arguements 252 187 // pre-filled. -
trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js
r146926 r147457 137 137 var resourceLoader; 138 138 139 ////////////////////////////////////////////////////////////////////////////// 140 // Methods and objects from dashboard_base.js to override. 141 ////////////////////////////////////////////////////////////////////////////// 142 function generatePage() 143 { 144 if (g_history.crossDashboardState.useTestData) 139 function generatePage(historyInstance) 140 { 141 if (historyInstance.crossDashboardState.useTestData) 145 142 return; 146 143 … … 150 147 // tests expands to all tests that match the CSV list. 151 148 // result expands to all tests that ever have the given result 152 if ( g_history.dashboardSpecificState.tests || g_history.dashboardSpecificState.result)149 if (historyInstance.dashboardSpecificState.tests || historyInstance.dashboardSpecificState.result) 153 150 generatePageForIndividualTests(individualTests()); 154 else if ( g_history.dashboardSpecificState.expectationsUpdate)151 else if (historyInstance.dashboardSpecificState.expectationsUpdate) 155 152 generatePageForExpectationsUpdate(); 156 153 else 157 generatePageForBuilder( g_history.dashboardSpecificState.builder || currentBuilderGroup().defaultBuilder());154 generatePageForBuilder(historyInstance.dashboardSpecificState.builder || currentBuilderGroup().defaultBuilder()); 158 155 159 156 for (var builder in currentBuilders()) … … 163 160 } 164 161 165 function handleValidHashParameter( key, value)162 function handleValidHashParameter(historyInstance, key, value) 166 163 { 167 164 switch(key) { 168 165 case 'tests': 169 history.validateParameter( g_history.dashboardSpecificState, key, value,166 history.validateParameter(historyInstance.dashboardSpecificState, key, value, 170 167 function() { 171 168 return string.isValidName(value); … … 175 172 case 'result': 176 173 value = value.toUpperCase(); 177 history.validateParameter( g_history.dashboardSpecificState, key, value,174 history.validateParameter(historyInstance.dashboardSpecificState, key, value, 178 175 function() { 179 176 for (var result in LAYOUT_TEST_EXPECTATIONS_MAP_) { … … 186 183 187 184 case 'builder': 188 history.validateParameter( g_history.dashboardSpecificState, key, value,185 history.validateParameter(historyInstance.dashboardSpecificState, key, value, 189 186 function() { 190 187 return value in currentBuilders(); … … 194 191 195 192 case 'sortColumn': 196 history.validateParameter( g_history.dashboardSpecificState, key, value,193 history.validateParameter(historyInstance.dashboardSpecificState, key, value, 197 194 function() { 198 195 // Get all possible headers since the actual used set of headers 199 // depends on the values in g_history.dashboardSpecificState, which are currently being set.196 // depends on the values in historyInstance.dashboardSpecificState, which are currently being set. 200 197 var headers = tableHeaders(true); 201 198 for (var i = 0; i < headers.length; i++) { … … 208 205 209 206 case 'sortOrder': 210 history.validateParameter( g_history.dashboardSpecificState, key, value,207 history.validateParameter(historyInstance.dashboardSpecificState, key, value, 211 208 function() { 212 209 return value == FORWARD || value == BACKWARD; … … 217 214 case 'updateIndex': 218 215 case 'revision': 219 history.validateParameter( g_history.dashboardSpecificState, key, Number(value),216 history.validateParameter(historyInstance.dashboardSpecificState, key, Number(value), 220 217 function() { 221 218 return value.match(/^\d+$/); … … 235 232 case 'showWontFixSkip': 236 233 case 'expectationsUpdate': 237 g_history.dashboardSpecificState[key] = value == 'true';234 historyInstance.dashboardSpecificState[key] = value == 'true'; 238 235 return true; 239 236 … … 243 240 } 244 241 245 g_defaultDashboardSpecificStateValues = { 242 // @param {Object} params New or modified query parameters as key: value. 243 function handleQueryParameterChange(historyInstance, params) 244 { 245 for (key in params) { 246 if (key == 'tests') { 247 // Entering cross-builder view, only keep valid keys for that view. 248 for (var currentKey in historyInstance.dashboardSpecificState) { 249 if (isInvalidKeyForCrossBuilderView(currentKey)) { 250 delete historyInstance.dashboardSpecificState[currentKey]; 251 } 252 } 253 } else if (isInvalidKeyForCrossBuilderView(key)) { 254 delete historyInstance.dashboardSpecificState.tests; 255 delete historyInstance.dashboardSpecificState.result; 256 } 257 } 258 259 return true; 260 } 261 262 var defaultDashboardSpecificStateValues = { 246 263 sortOrder: BACKWARD, 247 264 sortColumn: 'flakiness', … … 266 283 }; 267 284 268 DB_SPECIFIC_INVALIDATING_PARAMETERS = {285 var DB_SPECIFIC_INVALIDATING_PARAMETERS = { 269 286 'tests' : 'builder', 270 287 'testType': 'builder', 271 288 'group': 'builder' 272 289 }; 290 291 292 var flakinessConfig = { 293 defaultStateValues: defaultDashboardSpecificStateValues, 294 generatePage: generatePage, 295 handleValidHashParameter: handleValidHashParameter, 296 handleQueryParameterChange: handleQueryParameterChange, 297 invalidatingHashParameters: DB_SPECIFIC_INVALIDATING_PARAMETERS 298 }; 299 300 // FIXME(jparent): Eventually remove all usage of global history object. 301 var g_history = new history.History(flakinessConfig); 302 g_history.parseCrossDashboardParameters(); 273 303 274 304 ////////////////////////////////////////////////////////////////////////////// … … 2493 2523 } 2494 2524 2495 // Sets the page state to regenerate the page.2496 // @param {Object} params New or modified query parameters as key: value.2497 function handleQueryParameterChange(params)2498 {2499 for (key in params) {2500 if (key == 'tests') {2501 // Entering cross-builder view, only keep valid keys for that view.2502 for (var currentKey in g_history.dashboardSpecificState) {2503 if (isInvalidKeyForCrossBuilderView(currentKey)) {2504 delete g_history.dashboardSpecificState[currentKey];2505 }2506 }2507 } else if (isInvalidKeyForCrossBuilderView(key)) {2508 delete g_history.dashboardSpecificState.tests;2509 delete g_history.dashboardSpecificState.result;2510 }2511 }2512 2513 return true;2514 }2515 2516 2525 function hideLegend() 2517 2526 { … … 2607 2616 2608 2617 window.addEventListener('load', function() { 2609 resourceLoader = new loader.Loader( intializeHistory);2618 resourceLoader = new loader.Loader(); 2610 2619 resourceLoader.load(); 2611 2620 }, false); -
trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js
r146926 r147457 36 36 g_allExpectations = null; 37 37 g_allTestsTrie = null; 38 var historyInstance = new history.History( );38 var historyInstance = new history.History(flakinessConfig); 39 39 // FIXME(jparent): Remove this once global isn't used. 40 40 g_history = historyInstance; … … 146 146 147 147 test('platformAndBuildType', 78, function() { 148 var historyInstance = new history.History( );148 var historyInstance = new history.History(flakinessConfig); 149 149 // FIXME(jparent): Change to use the flakiness_db's history object 150 150 // once it exists, rather than tracking global. … … 313 313 314 314 test('substringList', 2, function() { 315 var historyInstance = new history.History( );315 var historyInstance = new history.History(flakinessConfig); 316 316 // FIXME(jparent): Remove this once global isn't used. 317 317 g_history = historyInstance; … … 326 326 327 327 test('htmlForTestsWithExpectationsButNoFailures', 4, function() { 328 var historyInstance = new history.History( );328 var historyInstance = new history.History(defaultDashboardSpecificStateValues, generatePage, handleValidHashParameter); 329 329 // FIXME(jparent): Remove this once global isn't used. 330 330 g_history = historyInstance; … … 362 362 363 363 test('htmlForTestTypeSwitcherGroup', 6, function() { 364 var historyInstance = new history.History( );364 var historyInstance = new history.History(flakinessConfig); 365 365 // FIXME(jparent): Remove this once global isn't used. 366 366 g_history = historyInstance; … … 702 702 703 703 test('shouldHideTest', 10, function() { 704 var historyInstance = new history.History( );704 var historyInstance = new history.History(flakinessConfig); 705 705 historyInstance.parseParameters(); 706 706 // FIXME(jparent): Change to use the flakiness_dashboard's history object -
trunk/Tools/TestResultServer/static-dashboards/history.js
r146797 r147457 107 107 } 108 108 109 history.History = function() 110 { 111 this.crossDashboardState = {}; 112 this.dashboardSpecificState = {}; 109 history.History = function(configuration) 110 { 111 this.crossDashboardState = {}; 112 this.dashboardSpecificState = {}; 113 114 if (configuration) { 115 this._defaultDashboardSpecificStateValues = configuration.defaultStateValues; 116 this._handleValidHashParameter = configuration.handleValidHashParameter; 117 this._handleQueryParameterChange = configuration.handleQueryParameterChange || function(historyInstance, params) { return true; }; 118 this._dashboardSpecificInvalidatingParameters = configuration.invalidatingHashParameters; 119 this._generatePage = configuration.generatePage; 120 } 113 121 } 114 122 115 123 var RELOAD_REQUIRING_PARAMETERS = ['showAllRuns', 'group', 'testType']; 116 124 125 var CROSS_DB_INVALIDATING_PARAMETERS = { 126 'testType': 'group' 127 }; 128 117 129 history.History.prototype = { 130 initialize: function() 131 { 132 window.onhashchange = this._handleLocationChange.bind(this); 133 this._handleLocationChange(); 134 }, 118 135 isLayoutTestResults: function() 119 136 { … … 132 149 133 150 history._fillMissingValues(this.crossDashboardState, history.DEFAULT_CROSS_DASHBOARD_STATE_VALUES); 151 }, 152 _parseDashboardSpecificParameters: function() 153 { 154 this.dashboardSpecificState = {}; 155 var parameters = history.queryHashAsMap(); 156 for (parameterName in this._defaultDashboardSpecificStateValues) 157 this.parseParameter(parameters, parameterName); 134 158 }, 135 159 // TODO(jparent): Make private once callers move here. … … 151 175 } 152 176 153 parseDashboardSpecificParameters();177 this._parseDashboardSpecificParameters(); 154 178 var dashboardSpecificDiffState = history._diffStates(oldDashboardSpecificState, this.dashboardSpecificState); 155 179 156 history._fillMissingValues(this.dashboardSpecificState, g_defaultDashboardSpecificStateValues);180 history._fillMissingValues(this.dashboardSpecificState, this._defaultDashboardSpecificStateValues); 157 181 158 182 // FIXME: dashboard_base shouldn't know anything about specific dashboard specific keys. … … 164 188 var shouldGeneratePage = true; 165 189 if (Object.keys(dashboardSpecificDiffState).length) 166 shouldGeneratePage = handleQueryParameterChange(dashboardSpecificDiffState);190 shouldGeneratePage = this._handleQueryParameterChange(this, dashboardSpecificDiffState); 167 191 return shouldGeneratePage; 168 192 }, … … 206 230 207 231 default: 208 return handleValidHashParameter(key, value);232 return this._handleValidHashParameter(this, key, value); 209 233 } 210 234 }, … … 244 268 if (key in CROSS_DB_INVALIDATING_PARAMETERS) 245 269 delete this.crossDashboardState[CROSS_DB_INVALIDATING_PARAMETERS[key]]; 246 if ( DB_SPECIFIC_INVALIDATING_PARAMETERS && key in DB_SPECIFIC_INVALIDATING_PARAMETERS)247 delete this.dashboardSpecificState[ DB_SPECIFIC_INVALIDATING_PARAMETERS[key]];270 if (this._dashboardSpecificInvalidatingParameters && key in this._dashboardSpecificInvalidatingParameters) 271 delete this.dashboardSpecificState[this._dashboardSpecificInvalidatingParameters[key]]; 248 272 } 249 273 }, … … 253 277 for (var key in stateObject) { 254 278 var value = stateObject[key]; 255 if (value != defaultValue(key))279 if (value != this._defaultValue(key)) 256 280 state.push(key + '=' + encodeURIComponent(value)); 257 281 } … … 269 293 combinedState[key] = this.crossDashboardState[key]; 270 294 return combinedState; 271 } 295 }, 296 _defaultValue: function(key) 297 { 298 if (key in this._defaultDashboardSpecificStateValues) 299 return this._defaultDashboardSpecificStateValues[key]; 300 return history.DEFAULT_CROSS_DASHBOARD_STATE_VALUES[key]; 301 }, 302 _handleLocationChange: function() 303 { 304 if (this.parseParameters()) 305 this._generatePage(this); 306 } 307 272 308 } 273 309 -
trunk/Tools/TestResultServer/static-dashboards/loader.js
r146797 r147457 58 58 } 59 59 60 loader.Loader = function( opt_onLoadingComplete)60 loader.Loader = function() 61 61 { 62 62 this._loadingSteps = [ … … 69 69 this._staleBuilders = []; 70 70 this._errors = new ui.Errors(); 71 this._onLoadingComplete = opt_onLoadingComplete || function() {};72 71 // TODO(jparent): Pass in the appropriate history obj per db. 73 72 this._history = g_history; … … 108 107 if (!loadingStep) { 109 108 this._addErrors(); 110 this._ onLoadingComplete();109 this._history.initialize(); 111 110 return; 112 111 } -
trunk/Tools/TestResultServer/static-dashboards/loader_unittests.js
r146797 r147457 32 32 resetGlobals(); 33 33 var loadedSteps = []; 34 var loadingCompleteCallback = handleLocationChange; 35 handleLocationChange = function() { 34 g_history._handleLocationChange = function() { 36 35 deepEqual(loadedSteps, ['step 1', 'step 2']); 37 36 } 38 var resourceLoader = new loader.Loader( handleLocationChange);37 var resourceLoader = new loader.Loader(); 39 38 function loadingStep1() { 40 39 loadedSteps.push('step 1'); … … 49 48 resourceLoader._loadingSteps = [loadingStep1, loadingStep2]; 50 49 resourceLoader.load(); 51 } finally { 52 handleLocationChange = loadingCompleteCallback; 53 } 50 } 54 51 }); 55 52 -
trunk/Tools/TestResultServer/static-dashboards/timeline_explorer.js
r146797 r147457 33 33 var g_currentBuilderTestResults; 34 34 35 ////////////////////////////////////////////////////////////////////////////// 36 // Methods and objects from dashboard_base.js to override. 37 ////////////////////////////////////////////////////////////////////////////// 38 function generatePage() 35 var defaultDashboardSpecificStateValues = { 36 builder: null, 37 buildTimestamp: -1, 38 ignoreFlakyTests: true 39 }; 40 41 var DB_SPECIFIC_INVALIDATING_PARAMETERS = { 42 'testType': 'builder', 43 'group': 'builder' 44 }; 45 46 function generatePage(historyInstance) 39 47 { 40 48 g_buildIndicesByTimestamp = {}; 41 var results = g_resultsByBuilder[ g_history.dashboardSpecificState.builder || currentBuilderGroup().defaultBuilder()];49 var results = g_resultsByBuilder[historyInstance.dashboardSpecificState.builder || currentBuilderGroup().defaultBuilder()]; 42 50 43 51 for (var i = 0; i < results[FIXABLE_COUNTS_KEY].length; i++) { … … 46 54 } 47 55 48 if ( g_history.dashboardSpecificState.buildTimestamp != -1 && g_history.dashboardSpecificState.buildTimestamp in g_buildIndicesByTimestamp) {49 var newBuildIndex = g_buildIndicesByTimestamp[ g_history.dashboardSpecificState.buildTimestamp];56 if (historyInstance.dashboardSpecificState.buildTimestamp != -1 && historyInstance.dashboardSpecificState.buildTimestamp in g_buildIndicesByTimestamp) { 57 var newBuildIndex = g_buildIndicesByTimestamp[historyInstance.dashboardSpecificState.buildTimestamp]; 50 58 51 59 if (newBuildIndex == g_currentBuildIndex) { … … 62 70 63 71 $('test-type-switcher').innerHTML = ui.html.testTypeSwitcher( false, 64 ui.html.checkbox('ignoreFlakyTests', 'Ignore flaky tests', g_history.dashboardSpecificState.ignoreFlakyTests, 'g_currentBuildIndex = -1')72 ui.html.checkbox('ignoreFlakyTests', 'Ignore flaky tests', historyInstance.dashboardSpecificState.ignoreFlakyTests, 'g_currentBuildIndex = -1') 65 73 ); 66 74 67 75 updateTimelineForBuilder(); 68 76 } 77 78 function handleValidHashParameter(historyInstance, key, value) 79 { 80 switch(key) { 81 case 'builder': 82 history.validateParameter(historyInstance.dashboardSpecificState, key, value, 83 function() { return value in currentBuilders(); }); 84 return true; 85 case 'buildTimestamp': 86 historyInstance.dashboardSpecificState.buildTimestamp = parseInt(value, 10); 87 return true; 88 case 'ignoreFlakyTests': 89 historyInstance.dashboardSpecificState.ignoreFlakyTests = value == 'true'; 90 return true; 91 default: 92 return false; 93 } 94 } 95 96 var timelineConfig = { 97 defaultStateValues: defaultDashboardSpecificStateValues, 98 generatePage: generatePage, 99 handleValidHashParameter: handleValidHashParameter, 100 invalidatingHashParameters: DB_SPECIFIC_INVALIDATING_PARAMETERS 101 }; 102 103 // FIXME(jparent): Eventually remove all usage of global history object. 104 var g_history = new history.History(timelineConfig); 105 g_history.parseCrossDashboardParameters(); 69 106 70 107 function initCurrentBuilderTestResults() … … 74 111 console.log( 'Time to get test results by build: ' + (Date.now() - startTime)); 75 112 } 76 77 function handleValidHashParameter(key, value)78 {79 switch(key) {80 case 'builder':81 history.validateParameter(g_history.dashboardSpecificState, key, value,82 function() { return value in currentBuilders(); });83 return true;84 case 'buildTimestamp':85 g_history.dashboardSpecificState.buildTimestamp = parseInt(value, 10);86 return true;87 case 'ignoreFlakyTests':88 g_history.dashboardSpecificState.ignoreFlakyTests = value == 'true';89 return true;90 default:91 return false;92 }93 }94 95 g_defaultDashboardSpecificStateValues = {96 builder: null,97 buildTimestamp: -1,98 ignoreFlakyTests: true99 };100 101 DB_SPECIFIC_INVALIDATING_PARAMETERS = {102 'testType': 'builder',103 'group': 'builder'104 };105 113 106 114 function shouldShowWebKitRevisionsOnly() … … 489 497 490 498 window.addEventListener('load', function() { 491 var resourceLoader = new loader.Loader( intializeHistory);499 var resourceLoader = new loader.Loader(); 492 500 resourceLoader.load(); 493 501 }, false); -
trunk/Tools/TestResultServer/static-dashboards/treemap.js
r146797 r147457 27 27 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 29 var defaultDashboardSpecificStateValues = { 30 builder: null, 31 treemapfocus: '', 32 }; 33 34 var DB_SPECIFIC_INVALIDATING_PARAMETERS = { 35 'testType': 'builder', 36 'group': 'builder' 37 }; 38 39 function generatePage(historyInstance) 40 { 41 $('header-container').innerHTML = ui.html.testTypeSwitcher(); 42 43 g_isGeneratingPage = true; 44 45 var rawTree = g_resultsByBuilder[historyInstance.dashboardSpecificState.builder || currentBuilderGroup().defaultBuilder()]; 46 g_webTree = convertToWebTreemapFormat('LayoutTests', rawTree); 47 appendTreemap($('map'), g_webTree); 48 49 if (historyInstance.dashboardSpecificState.treemapfocus) 50 focusPath(g_webTree, historyInstance.dashboardSpecificState.treemapfocus) 51 52 g_isGeneratingPage = false; 53 } 54 55 function handleValidHashParameter(historyInstance, key, value) 56 { 57 switch(key) { 58 case 'builder': 59 history.validateParameter(historyInstance.dashboardSpecificState, key, value, 60 function() { return value in currentBuilders(); }); 61 return true; 62 63 case 'treemapfocus': 64 history.validateParameter(historyInstance.dashboardSpecificState, key, value, 65 function() { 66 // FIXME: There's probably a simpler regexp here. Just trying to match ascii + forward-slash. 67 // e.g. LayoutTests/foo/bar.html 68 return (value.match(/^(\w+\/\w*)*$/)); 69 }); 70 return true; 71 72 default: 73 return false; 74 } 75 } 76 77 function handleQueryParameterChange(historyInstance, params) 78 { 79 for (var param in params) { 80 if (param != 'treemapfocus') { 81 $('map').innerHTML = 'Loading...'; 82 return true; 83 } 84 } 85 return false; 86 } 87 88 var treemapConfig = { 89 defaultStateValues: defaultDashboardSpecificStateValues, 90 generatePage: generatePage, 91 handleValidHashParameter: handleValidHashParameter, 92 handleQueryParameterChange: handleQueryParameterChange, 93 invalidatingHashParameters: DB_SPECIFIC_INVALIDATING_PARAMETERS 94 }; 95 96 // FIXME(jparent): Eventually remove all usage of global history object. 97 var g_history = new history.History(treemapConfig); 98 g_history.parseCrossDashboardParameters(); 99 29 100 var TEST_URL_BASE_PATH = "http://svn.webkit.org/repository/webkit/trunk/"; 30 101 … … 137 208 var g_webTree; 138 209 139 function generatePage()140 {141 $('header-container').innerHTML = ui.html.testTypeSwitcher();142 143 g_isGeneratingPage = true;144 145 var rawTree = g_resultsByBuilder[g_history.dashboardSpecificState.builder || currentBuilderGroup().defaultBuilder()];146 g_webTree = convertToWebTreemapFormat('LayoutTests', rawTree);147 appendTreemap($('map'), g_webTree);148 149 if (g_history.dashboardSpecificState.treemapfocus)150 focusPath(g_webTree, g_history.dashboardSpecificState.treemapfocus)151 152 g_isGeneratingPage = false;153 }154 155 210 function focusPath(tree, path) 156 211 { … … 177 232 } 178 233 179 }180 181 function handleValidHashParameter(key, value)182 {183 switch(key) {184 case 'builder':185 history.validateParameter(g_history.dashboardSpecificState, key, value,186 function() { return value in currentBuilders(); });187 return true;188 189 case 'treemapfocus':190 history.validateParameter(g_history.dashboardSpecificState, key, value,191 function() {192 // FIXME: There's probably a simpler regexp here. Just trying to match ascii + forward-slash.193 // e.g. LayoutTests/foo/bar.html194 return (value.match(/^(\w+\/\w*)*$/));195 });196 return true;197 198 default:199 return false;200 }201 }202 203 g_defaultDashboardSpecificStateValues = {204 builder: null,205 treemapfocus: '',206 };207 208 DB_SPECIFIC_INVALIDATING_PARAMETERS = {209 'testType': 'builder',210 'group': 'builder'211 };212 213 function handleQueryParameterChange(params)214 {215 for (var param in params) {216 if (param != 'treemapfocus') {217 $('map').innerHTML = 'Loading...';218 return true;219 }220 }221 return false;222 234 } 223 235 … … 271 283 272 284 window.addEventListener('load', function() { 273 var resourceLoader = new loader.Loader( intializeHistory);285 var resourceLoader = new loader.Loader(); 274 286 resourceLoader.load(); 275 287 }, false);
Note: See TracChangeset
for help on using the changeset viewer.