[webkit-changes] [147457] trunk/Tools

2013-04-02 Thread jparent
nction generatePage()
+function generatePage(historyInstance)
 {
 var html = ui.html.testTypeSwitcher(true) + '';
 for (var builder in currentBuilders())
@@ -45,11 +42,11 @@
 document.body.innerHTML = html;
 }
 
-function handleValidHashParameter(key, value)
+function handleValidHashParameter(historyInstance, key, value)
 {
 switch(key) {
 case 'rawValues':
-g_history.dashboardSpecificState[key] = value == 'true';
+historyInstance.dashboardSpecificState[key] = value == 'true';
 return true;
 
 default:
@@ -57,10 +54,21 @@
 }
 }
 
-g_defaultDashboardSpecificStateValues = {
+var defaultDashboardSpecificStateValues = {
 rawValues: false
 };
 
+
+var aggregateResultsConfig = {
+defaultStateValues: defaultDashboardSpecificStateValues,
+generatePage: generatePage,
+handleValidHashParameter: handleValidHashParameter,
+};
+
+// FIXME(jparent): Eventually remove all usage of global history object.
+var g_history = new history.History(aggregateResultsConfig);
+g_history.parseCrossDashboardParameters();
+
 function htmlForBuilder(builder)
 {
 var results = g_resultsByBuilder[builder];
@@ -267,6 +275,6 @@
 }
 
 window.addEventListener('load', function() {
-var resourceLoader = new loader.Loader(intializeHistory);
+var resourceLoader = new loader.Loader();
 resourceLoader.load();
 }, false);


Modified: trunk/Tools/TestResultServer/static-dashboards/dashboard_base.js (147456 => 147457)

--- trunk/Tools/TestResultServer/static-dashboards/dashboard_base.js	2013-04-02 17:58:16 UTC (rev 147456)
+++ trunk/Tools/TestResultServer/static-dashboards/dashboard_base.js	2013-04-02 17:59:14 UTC (rev 147457)
@@ -29,37 +29,8 @@
 // @fileoverview Base JS file for pages that want to parse the results JSON
 // from the testing bots. This deals with generic utility functions, visible
 // history, popups and appending the script elements for the JSON files.
-//
-// The calling page is expected to implement the following "abstract"
-// functions/objects:
 
-// Generates the contents of the dashboard. The page should override this with
-// a function that generates the page assuming all resources have loaded.
-function generatePage() {}
 
-// Takes a key and a value and sets the g_history.dashboardSpecificState[key] = value iff key is
-// a valid hash parameter and the value is a valid value for that key.
-//
-// @return {boolean} Whether the key what inserted into the g_history.dashboardSpecificState.
-function handleValidHashParameter(key, value)
-{
-return false;
-}
-
-// Default hash parameters for the page. The page should override this to create
-// default states.
-var g_defaultDashboardSpecificStateValues = {};
-
-
-// The page should override this to modify page state due to
-// changing query parameters.
-// @param {Object} params New or modified query params as key: value.
-// @return {boolean} Whether changing this parameter should cause generatePage to be called.
-function handleQueryParameterChange(params)
-{
-return true;
-}
-
 //
 // CONSTANTS
 //
@@ -84,11 +55,6 @@
 'O': 'MISSING'
 };
 
-// Map of parameter to other parameter it invalidates.
-var CROSS_DB_INVALIDATING_PARAMETERS = {
-'testType': 'group'
-};
-var DB_SPECIFIC_INVALIDATING_PARAMETERS;
 
 // Keys in the JSON files.
 var WONTFIX_COUNTS_KEY = 'wontfixCounts';
@@ -167,25 +133,6 @@
 return document.getElementById(id);
 }
 
-function parseDashboardSpecificParameters()
-{
-g_history.dashboardSpecificState = {};
-var parameters = history.queryHashAsMap();
-for (parameterName in g_defaultDashboardSpecificStateValues)
-g_history.parseParameter(parameters, parameterName);
-}
-
-function defaultValue(key)
-{
-if (key in g_defaultDashboardSpecificStateValues)
-return g_defaultDashboardSpecificStateValues[key];
-return history.DEFAULT_CROSS_DASHBOARD_STATE_VALUES[key];
-}
-
-// TODO(jparent): Each db should create their own history obj, not global.
-var g_history = new history.History();
-g_history.parseCrossDashboardParameters();
-
 function currentBuilderGroupCategory()
 {
 switch (g_history.crossDashboardState.testType) {
@@ -236,18 +183,6 @@
 return string.endsWith(window.location.pathname, 'flakiness_dashboard.html');
 }
 
-function handleLocationChange()
-{
-if (g_history.parseParameters())
-generatePage();
-}
-
-// TODO(jparent): Move this to upcoming History object.
-function intializeHistory() {
-window._onhashchange_ = handleLocationChange;
-handleLocationChange();
-}
-
 // Create a new function with some of its arguements
 // pre-filled.
 // Taken from goog.partial in the Closure library.


Modified: trunk/Tools

[webkit-changes] [146926] trunk/Tools

2013-03-26 Thread jparent
Title: [146926] trunk/Tools








Revision 146926
Author jpar...@chromium.org
Date 2013-03-26 13:40:26 -0700 (Tue, 26 Mar 2013)


Log Message
Flakiness dashboard: simplify logic around which tests to show.
https://bugs.webkit.org/show_bug.cgi?id=113250

Reviewed by Ojan Vafai.

The different filters for showing results are only used for layout
tests, otherwise, we show everything.

Change the defaults to false (what layout tests used), and only
look at the values when viewing layout tests.

* TestResultServer/static-dashboards/flakiness_dashboard.js:
(htmlForTestsWithExpectationsButNoFailures):
(shouldHideTest):

Modified Paths

trunk/Tools/ChangeLog
trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js
trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js




Diff

Modified: trunk/Tools/ChangeLog (146925 => 146926)

--- trunk/Tools/ChangeLog	2013-03-26 20:33:55 UTC (rev 146925)
+++ trunk/Tools/ChangeLog	2013-03-26 20:40:26 UTC (rev 146926)
@@ -1,3 +1,20 @@
+2013-03-26  Julie Parent  
+
+Flakiness dashboard: simplify logic around which tests to show.
+https://bugs.webkit.org/show_bug.cgi?id=113250
+
+Reviewed by Ojan Vafai.
+
+The different filters for showing results are only used for layout
+tests, otherwise, we show everything.
+
+Change the defaults to false (what layout tests used), and only
+look at the values when viewing layout tests.
+
+* TestResultServer/static-dashboards/flakiness_dashboard.js:
+(htmlForTestsWithExpectationsButNoFailures):
+(shouldHideTest):
+
 2013-03-26  Isaac Levy  
 
 Update bots on test-results.appspot


Modified: trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js (146925 => 146926)

--- trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js	2013-03-26 20:33:55 UTC (rev 146925)
+++ trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js	2013-03-26 20:40:26 UTC (rev 146926)
@@ -250,12 +250,12 @@
 showLargeExpectations: false,
 legacyExpectationsSemantics: true,
 showChrome: true,
-showCorrectExpectations: !g_history.isLayoutTestResults(),
-showWrongExpectations: !g_history.isLayoutTestResults(),
-showWontFixSkip: !g_history.isLayoutTestResults(),
-showSlow: !g_history.isLayoutTestResults(),
-showSkipped: !g_history.isLayoutTestResults(),
-showUnexpectedPasses: !g_history.isLayoutTestResults(),
+showCorrectExpectations: false,
+showWrongExpectations: false,
+showWontFixSkip: false,
+showSlow: false,
+showSkipped: false,
+showUnexpectedPasses: false,
 expectationsUpdate: false,
 updateIndex: 0,
 resultsHeight: 300,
@@ -1314,9 +1314,8 @@
 var showUnexpectedPassesLink =  linkHTMLToToggleState('showUnexpectedPasses', 'tests that have not failed in last ' + g_resultsByBuilder[builder].buildNumbers.length + ' runs');
 var showSkippedLink = linkHTMLToToggleState('showSkipped', 'skipped tests in TestExpectations');
 
-
 var html = '';
-if (tests.length || skippedPaths.length) {
+if (g_history.isLayoutTestResults() && (tests.length || skippedPaths.length)) {
 var buildInfo = platformAndBuildType(builder);
 html += 'Expectations for ' + buildInfo.platform + '-' + buildInfo.buildType + ' ';
 if (!g_history.dashboardSpecificState.showUnexpectedPasses && tests.length)
@@ -1343,6 +1342,10 @@
 // Returns whether we should exclude test results from the test table.
 function shouldHideTest(testResult)
 {
+// For non-layout tests, we always show everything.
+if (!g_history.isLayoutTestResults())
+return false;
+
 if (testResult.isWontFixSkip)
 return !g_history.dashboardSpecificState.showWontFixSkip;
 


Modified: trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js (146925 => 146926)

--- trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js	2013-03-26 20:33:55 UTC (rev 146925)
+++ trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js	2013-03-26 20:40:26 UTC (rev 146926)
@@ -698,4 +698,45 @@
 
 historyInstance.invalidateQueryParameters({'testType': 'ui_tests'});
 notEqual(historyInstance.crossDashboardState.group, originalGroup, "group should have been invalidated");   
+});
+
+test('shouldHideTest', 10, function() {
+var historyInstance = new history.History();
+historyInstance.parseParameters();
+// FIXME(jparent): Change to use the flakiness_dashboard's history object
+// once it exists, rather than tracking global.
+g_history = historyInstance;
+var test = createResultsObjectForTest('foo/test.html', 'dummyBuilder');
+
+equal(shouldHideTest(test), tr

[webkit-changes] [146254] trunk/Tools

2013-03-19 Thread jparent
el="nofollow" id="trunkToolsTestResultServerstaticdashboardsflakiness_dashboard_unittestsjs"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js (146253 => 146254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js	2013-03-19 20:45:36 UTC (rev 146253)
+++ trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js	2013-03-19 20:51:44 UTC (rev 146254)
</span><span class="lines">@@ -545,11 +545,6 @@
</span><span class="cx"> deepEqual(builderList.filter(isChromiumWebkitDepsTestRunner), expectedBuilders);
</span><span class="cx"> });
</span><span class="cx"> 
</span><del>-test('queryHashAsMap', 2, function() {
-equal(window.location.hash, '#useTestData=true');
-deepEqual(queryHashAsMap(), {useTestData: 'true'});
-});
-
</del><span class="cx"> test('parseCrossDashboardParameters', 2, function() {
</span><span class="cx"> equal(window.location.hash, '#useTestData=true');
</span><span class="cx"> parseCrossDashboardParameters();
</span><span class="lines">@@ -562,25 +557,6 @@
</span><span class="cx"> deepEqual(g_crossDashboardState, expectedParameters);
</span><span class="cx"> });
</span><span class="cx"> 
</span><del>-test('diffStates', 5, function() {
-var newState = {a: 1, b: 2};
-deepEqual(diffStates(null, newState), newState);
-
-var oldState = {a: 1};
-deepEqual(diffStates(oldState, newState), {b: 2});
-
-// FIXME: This is kind of weird. I think the existing users of this code work correctly, but it's a confusing result.
-var oldState = {c: 1};
-deepEqual(diffStates(oldState, newState), {a:1, b: 2});
-
-var oldState = {a: 1, b: 2};
-deepEqual(diffStates(oldState, newState), {});
-
-var oldState = {a: 2, b: 3};
-deepEqual(diffStates(oldState, newState), {a: 1, b: 2});
-});
-
-
</del><span class="cx"> test('builderGroupIsToTWebKitAttribute', 2, function() {
</span><span class="cx"> var dummyMaster = new builders.BuilderMaster('Chromium', 'dummyurl', {'layout-tests': {'builders': ['WebKit Linux', 'WebKit Linux (dbg)', 'WebKit Mac10.7', 'WebKit Win']}});
</span><span class="cx"> var testBuilderGroups = {
</span></span></pre></div>
<a rel="nofollow" id="trunkToolsTestResultServerstaticdashboardshistoryjs"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestResultServer/static-dashboards/history.js (0 => 146254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestResultServer/static-dashboards/history.js	(rev 0)
+++ trunk/Tools/TestResultServer/static-dashboards/history.js	2013-03-19 20:51:44 UTC (rev 146254)
</span><span class="lines">@@ -0,0 +1,104 @@
</span><ins>+// Copyright (C) 2013 Google Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT

[webkit-changes] [146127] trunk/Tools

2013-03-18 Thread jparent
Title: [146127] trunk/Tools








Revision 146127
Author jpar...@chromium.org
Date 2013-03-18 14:43:19 -0700 (Mon, 18 Mar 2013)


Log Message
Cleanup: Move js for treemap and aggregate_results into own js files.
https://bugs.webkit.org/show_bug.cgi?id=112618

Reviewed by Dirk Pranke.

No functional changes, just moving the code into separate js file
rather than inlined in the html, so we can test it, make it more
modular, etc.  Other dashboard types are already done this way.

* TestResultServer/static-dashboards/aggregate_results.html:
* TestResultServer/static-dashboards/aggregate_results.js: Copied from Tools/TestResultServer/static-dashboards/aggregate_results.html.
(generatePage):
(handleValidHashParameter):
(htmlForBuilder):
(rawValuesHTML):
(chartHTML):
(filteredValues):
(chart):
(htmlForRevisionRows):
(wrapHTMLInTable):
(htmlForSummaryTable):
(valuesPerExpectation):
(htmlForTestType):
(htmlForTableRow):
(extendedEncode):
* TestResultServer/static-dashboards/treemap.html:
* TestResultServer/static-dashboards/treemap.js: Copied from Tools/TestResultServer/static-dashboards/treemap.html.
(humanReadableTime):
(convertToWebTreemapFormat):
(reverseSortByAverage):
(generatePage):
(focusPath):
(.switch.return):
(handleQueryParameterChange):
(extractName):
(fullName):
(handleFocus.):
(handleFocus):

Modified Paths

trunk/Tools/ChangeLog
trunk/Tools/TestResultServer/static-dashboards/aggregate_results.html
trunk/Tools/TestResultServer/static-dashboards/treemap.html


Added Paths

trunk/Tools/TestResultServer/static-dashboards/aggregate_results.js
trunk/Tools/TestResultServer/static-dashboards/treemap.js




Diff

Modified: trunk/Tools/ChangeLog (146126 => 146127)

--- trunk/Tools/ChangeLog	2013-03-18 21:35:51 UTC (rev 146126)
+++ trunk/Tools/ChangeLog	2013-03-18 21:43:19 UTC (rev 146127)
@@ -1,3 +1,44 @@
+2013-03-18  Julie Parent  
+
+Cleanup: Move js for treemap and aggregate_results into own js files.
+https://bugs.webkit.org/show_bug.cgi?id=112618
+
+Reviewed by Dirk Pranke.
+
+No functional changes, just moving the code into separate js file
+rather than inlined in the html, so we can test it, make it more
+modular, etc.  Other dashboard types are already done this way.
+
+* TestResultServer/static-dashboards/aggregate_results.html:
+* TestResultServer/static-dashboards/aggregate_results.js: Copied from Tools/TestResultServer/static-dashboards/aggregate_results.html.
+(generatePage):
+(handleValidHashParameter):
+(htmlForBuilder):
+(rawValuesHTML):
+(chartHTML):
+(filteredValues):
+(chart):
+(htmlForRevisionRows):
+(wrapHTMLInTable):
+(htmlForSummaryTable):
+(valuesPerExpectation):
+(htmlForTestType):
+(htmlForTableRow):
+(extendedEncode):
+* TestResultServer/static-dashboards/treemap.html:
+* TestResultServer/static-dashboards/treemap.js: Copied from Tools/TestResultServer/static-dashboards/treemap.html.
+(humanReadableTime):
+(convertToWebTreemapFormat):
+(reverseSortByAverage):
+(generatePage):
+(focusPath):
+(.switch.return):
+(handleQueryParameterChange):
+(extractName):
+(fullName):
+(handleFocus.):
+(handleFocus):
+
 2013-03-18  Zan Dobersek  
 
 [webkitpy] '/usr/bin/interdiff' output while running test-webkitpy


Modified: trunk/Tools/TestResultServer/static-dashboards/aggregate_results.html (146126 => 146127)

--- trunk/Tools/TestResultServer/static-dashboards/aggregate_results.html	2013-03-18 21:35:51 UTC (rev 146126)
+++ trunk/Tools/TestResultServer/static-dashboards/aggregate_results.html	2013-03-18 21:43:19 UTC (rev 146127)
@@ -55,252 +55,7 @@