1 // Copyright (C) 2011 Google Inc. All rights reserved.
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following disclaimer
11 // in the documentation and/or other materials provided with the
13 // * Neither the name of Google Inc. nor the names of its
14 // contributors may be used to endorse or promote products derived from
15 // this software without specific prior written permission.
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 module('flakiness_dashboard');
31 // FIXME(jparent): Rename this once it isn't globals.
32 function resetGlobals()
34 allExpectations = null;
35 g_resultsByBuilder = {};
36 g_allTestsTrie = null;
37 var historyInstance = new history.History(flakinessConfig);
38 // FIXME(jparent): Remove this once global isn't used.
39 g_history = historyInstance;
40 g_testToResultsMap = {};
42 for (var key in history.DEFAULT_CROSS_DASHBOARD_STATE_VALUES)
43 historyInstance.crossDashboardState[key] = history.DEFAULT_CROSS_DASHBOARD_STATE_VALUES[key];
46 "no_upload_test_types": [
50 name: 'ChromiumWebkit',
51 url_name: "chromium.webkit",
53 'layout-tests': {'builders': ['WebKit Linux', 'WebKit Linux (dbg)', 'WebKit Linux (deps)', 'WebKit Mac10.7', 'WebKit Win', 'WebKit Win (dbg)']},
54 'unit_tests': {'builders': ['Linux Tests']},
56 groups: ['@ToT Chromium', '@ToT Blink'],
59 url_name: "chromium.win",
61 'ash_unittests': {'builders': ['XP Tests (1)', 'Win7 Tests (1)']},
62 'unit_tests': {'builders': ['Linux Tests']},
64 groups: ['@ToT Chromium'],
68 return historyInstance;
71 var FAILURE_MAP = {"A": "AUDIO", "C": "CRASH", "F": "TEXT", "I": "IMAGE", "O": "MISSING",
72 "N": "NO DATA", "P": "PASS", "T": "TIMEOUT", "Y": "NOTRUN", "X": "SKIP", "Z": "IMAGE+TEXT"}
74 test('splitTestList', 1, function() {
75 var historyInstance = new history.History(flakinessConfig);
76 // FIXME(jparent): Remove this once global isn't used.
77 g_history = historyInstance;
78 historyInstance.dashboardSpecificState.tests = 'test.foo test.foo1\ntest.foo2\ntest.foo3,foo\\bar\\baz.html';
79 equal(splitTestList().toString(), 'test.foo,test.foo1,test.foo2,test.foo3,foo/bar/baz.html');
82 test('headerForTestTableHtml', 1, function() {
83 var container = document.createElement('div');
84 container.innerHTML = headerForTestTableHtml();
85 equal(container.querySelectorAll('input').length, 4);
88 test('htmlForTestTypeSwitcherGroup', 6, function() {
90 var historyInstance = new history.History(flakinessConfig);
91 // FIXME(jparent): Remove this once global isn't used.
92 g_history = historyInstance;
93 var container = document.createElement('div');
94 historyInstance.crossDashboardState.testType = 'ash_unittests';
95 container.innerHTML = ui.html.testTypeSwitcher(true);
96 var selects = container.querySelectorAll('select');
97 equal(selects.length, 2);
98 var group = selects[1];
99 equal(group.parentNode.textContent.indexOf('Group:'), 0);
100 equal(group.children.length, 1);
102 historyInstance.crossDashboardState.testType = 'layout-tests';
103 container.innerHTML = ui.html.testTypeSwitcher(true);
104 var selects = container.querySelectorAll('select');
105 equal(selects.length, 2);
106 var group = selects[1];
107 equal(group.parentNode.textContent.indexOf('Group:'), 0);
108 equal(group.children.length, 2);
111 test('htmlForIndividualTestOnAllBuilders', 1, function() {
113 builders.loadBuildersList('@ToT Blink', 'layout-tests');
114 equal(htmlForIndividualTestOnAllBuilders('foo/nonexistant.html'), '<div class="not-found">Test not found. Either it does not exist, is skipped or passes on all recorded runs.</div>');
117 test('htmlForIndividualTestOnAllBuildersWithResultsLinksNonexistant', 1, function() {
119 builders.loadBuildersList('@ToT Blink', 'layout-tests');
120 equal(htmlForIndividualTestOnAllBuildersWithResultsLinks('foo/nonexistant.html'),
121 '<div class="not-found">Test not found. Either it does not exist, is skipped or passes on all recorded runs.</div>' +
122 '<div class=expectations test=foo/nonexistant.html>' +
124 '<span class=link onclick="g_history.setQueryParameter(\'showExpectations\', true)">Show results</span> | ' +
125 '<span class=link onclick="g_history.setQueryParameter(\'showLargeExpectations\', true)">Show large thumbnails</span> | ' +
126 '<b>Only shows actual results/diffs from the most recent *failure* on each bot.</b>' +
131 test('htmlForIndividualTestOnAllBuildersWithResultsLinks', 1, function() {
133 builders.loadBuildersList('@ToT Blink', 'layout-tests');
135 var builderName = 'WebKit Linux';
136 g_resultsByBuilder[builderName] = {buildNumbers: [2, 1], blinkRevision: [1234, 1233], failure_map: FAILURE_MAP};
138 var test = 'dummytest.html';
139 var resultsObject = createResultsObjectForTest(test, builderName);
140 resultsObject.rawResults = [[1, 'F']];
141 resultsObject.rawTimes = [[1, 0]];
142 resultsObject.bugs = ["crbug.com/1234", "webkit.org/5678"];
143 g_testToResultsMap[test] = [resultsObject];
145 equal(htmlForIndividualTestOnAllBuildersWithResultsLinks(test),
146 '<table class=test-table><thead><tr>' +
147 '<th sortValue=test><div class=table-header-content><span></span><span class=header-text>test</span></div></th>' +
148 '<th sortValue=bugs><div class=table-header-content><span></span><span class=header-text>bugs</span></div></th>' +
149 '<th sortValue=expectations><div class=table-header-content><span></span><span class=header-text>expectations</span></div></th>' +
150 '<th sortValue=slowest><div class=table-header-content><span></span><span class=header-text>slowest run</span></div></th>' +
151 '<th sortValue=flakiness colspan=10000><div class=table-header-content><span></span><span class=header-text>flakiness (numbers are runtimes in seconds)</span></div></th>' +
154 '<td class="test-link builder-name">WebKit Linux' +
155 '<td class=options-container>' +
156 '<div><a href="http://crbug.com/1234">crbug.com/1234</a></div>' +
157 '<div><a href="http://webkit.org/5678">webkit.org/5678</a></div>' +
158 '<td class=options-container><td>' +
159 '<td title="TEXT. Click for more info." class="results TEXT" onclick=\'showPopupForBuild(event, "WebKit Linux",0,"dummytest.html")\'></td>' +
160 '<td title="NO DATA. Click for more info." class="results NODATA" onclick=\'showPopupForBuild(event, "WebKit Linux",1,"dummytest.html")\'>?</td>' +
163 '<div>The following builders either don\'t run this test (e.g. it\'s skipped) or all recorded runs passed:</div>' +
164 '<div class=skipped-builder-list>' +
165 '<div class=skipped-builder>WebKit Linux (dbg)</div><div class=skipped-builder>WebKit Mac10.7</div><div class=skipped-builder>WebKit Win</div><div class=skipped-builder>WebKit Win (dbg)</div>' +
167 '<div class=expectations test=dummytest.html>' +
168 '<div><span class=link onclick="g_history.setQueryParameter(\'showExpectations\', true)">Show results</span> | ' +
169 '<span class=link onclick="g_history.setQueryParameter(\'showLargeExpectations\', true)">Show large thumbnails</span> | ' +
170 '<b>Only shows actual results/diffs from the most recent *failure* on each bot.</b></div>' +
174 test('individualTestsForSubstringList', 2, function() {
175 var builderName = 'WebKit Linux';
176 g_resultsByBuilder[builderName] = {
177 buildNumbers: [2, 1],
178 blinkRevision: [1234, 1233],
179 failure_map: FAILURE_MAP,
181 'foo/one.html': { results: [1, 'F'], times: [1, 0] },
182 'virtual/foo/one.html': { results: [1, 'F'], times: [1, 0] },
186 g_history.dashboardSpecificState.showChrome = true;
187 var testToMatch = 'foo/one.html';
188 g_history.dashboardSpecificState.tests = testToMatch;
189 deepEqual(individualTestsForSubstringList(), [testToMatch, 'virtual/foo/one.html']);
191 g_history.dashboardSpecificState.showChrome = false;
192 deepEqual(individualTestsForSubstringList(), [testToMatch]);
195 test('htmlForIndividualTest', 2, function() {
196 var historyInstance = resetGlobals();
197 builders.loadBuildersList('@ToT Blink', 'layout-tests');
198 var test = 'foo/nonexistant.html';
200 historyInstance.dashboardSpecificState.showChrome = false;
202 equal(htmlForIndividualTest(test), htmlForIndividualTestOnAllBuilders(test) +
203 '<div class=expectations test=foo/nonexistant.html>' +
204 '<div><span class=link onclick=\"g_history.setQueryParameter(\'showExpectations\', true)\">Show results</span> | ' +
205 '<span class=link onclick=\"g_history.setQueryParameter(\'showLargeExpectations\', true)\">Show large thumbnails</span> | ' +
206 '<b>Only shows actual results/diffs from the most recent *failure* on each bot.</b></div>' +
209 historyInstance.dashboardSpecificState.showChrome = true;
211 equal(htmlForIndividualTest(test),
212 '<h2><a href="' + TEST_URL_BASE_PATH_FOR_BROWSING + 'foo/nonexistant.html" target="_blank">foo/nonexistant.html</a></h2>' +
213 htmlForIndividualTestOnAllBuildersWithResultsLinks(test));
216 test('linkifyBugs', 4, function() {
217 equal(linkifyBugs(["crbug.com/1234", "webkit.org/5678"]),
218 '<div><a href="http://crbug.com/1234">crbug.com/1234</a></div><div><a href="http://webkit.org/5678">webkit.org/5678</a></div>');
219 equal(linkifyBugs(["crbug.com/1234"]), '<div><a href="http://crbug.com/1234">crbug.com/1234</a></div>');
220 equal(linkifyBugs(["Bug(nick)"]), '<div>Bug(nick)</div>');
221 equal(linkifyBugs([]), '');
224 test('htmlForSingleTestRow', 1, function() {
225 var historyInstance = resetGlobals();
226 var builder = 'dummyBuilder';
227 var test = createResultsObjectForTest('foo/exists.html', builder);
228 historyInstance.dashboardSpecificState.showNonFlaky = true;
229 var blinkRevisions = [1234, 1233];
230 g_resultsByBuilder[builder] = {buildNumbers: [2, 1], blinkRevision: blinkRevisions, failure_map: FAILURE_MAP};
231 test.rawResults = [[1, 'F'], [2, 'I']];
232 test.rawTimes = [[1, 0], [2, 5]];
233 var expected = '<tr>' +
234 '<td class="test-link"><span class="link" onclick="g_history.setQueryParameter(\'tests\',\'foo/exists.html\');">foo/exists.html</span>' +
235 '<td class=options-container><a class="file-new-bug" href="https://code.google.com/p/chromium/issues/entry?template=Layout%20Test%20Failure&summary=Layout%20Test%20foo%2Fexists.html%20is%20failing&comment=The%20following%20layout%20test%20is%20failing%20on%20%5Binsert%20platform%5D%0A%0Afoo%2Fexists.html%0A%0AProbable%20cause%3A%0A%0A%5Binsert%20probable%20cause%5D">File new bug</a>' +
236 '<td class=options-container>' +
238 '<td title="TEXT. Click for more info." class="results TEXT" onclick=\'showPopupForBuild(event, "dummyBuilder",0,"foo/exists.html")\'></td>' +
239 '<td title="IMAGE. Click for more info." class="results IMAGE" onclick=\'showPopupForBuild(event, "dummyBuilder",1,"foo/exists.html")\'>5</td>';
241 equal(htmlForSingleTestRow(test, false, blinkRevisions), expected);
244 test('lookupVirtualTestSuite', 2, function() {
245 equal(lookupVirtualTestSuite('fast/canvas/foo.html'), '');
246 equal(lookupVirtualTestSuite('virtual/gpu/fast/canvas/foo.html'), 'virtual/gpu/fast/canvas');
249 test('baseTest', 2, function() {
250 equal(baseTest('fast/canvas/foo.html', ''), 'fast/canvas/foo.html');
251 equal(baseTest('virtual/gpu/fast/canvas/foo.html', 'virtual/gpu/fast/canvas'), 'fast/canvas/foo.html');
254 test('sortTests', 4, function() {
255 var test1 = createResultsObjectForTest('foo/test1.html', 'dummyBuilder');
256 var test2 = createResultsObjectForTest('foo/test2.html', 'dummyBuilder');
257 var test3 = createResultsObjectForTest('foo/test3.html', 'dummyBuilder');
258 test1.expectations = 'b';
259 test2.expectations = 'a';
260 test3.expectations = '';
262 var tests = [test1, test2, test3];
263 sortTests(tests, 'expectations', FORWARD);
264 deepEqual(tests, [test2, test1, test3]);
265 sortTests(tests, 'expectations', BACKWARD);
266 deepEqual(tests, [test3, test1, test2]);
272 var tests = [test1, test2, test3];
273 sortTests(tests, 'bugs', FORWARD);
274 deepEqual(tests, [test2, test1, test3]);
275 sortTests(tests, 'bugs', BACKWARD);
276 deepEqual(tests, [test3, test1, test2]);
279 test('popup', 2, function() {
280 ui.popup.show(document.body, 'dummy content');
281 ok(document.querySelector('#popup'));
283 ok(!document.querySelector('#popup'));
286 test('gpuResultsPath', 3, function() {
287 equal(gpuResultsPath('777777', 'Win7 Release (ATI)'), '777777_Win7_Release_ATI_');
288 equal(gpuResultsPath('123', 'GPU Linux (dbg)(NVIDIA)'), '123_GPU_Linux_dbg_NVIDIA_');
289 equal(gpuResultsPath('12345', 'GPU Mac'), '12345_GPU_Mac');
292 test('TestTrie', 3, function() {
294 "Dummy Chromium Windows Builder": true,
295 "Dummy GTK Linux Builder": true,
296 "Dummy Apple Mac Lion Builder": true
299 var resultsByBuilder = {
300 "Dummy Chromium Windows Builder": {
303 "foo/bar/1.html": true,
307 "Dummy GTK Linux Builder": {
311 "foo/bar/2.html": true,
312 "foo/bar/baz/1.html": true,
315 "Dummy Apple Mac Lion Builder": {
317 "foo/bar/3.html": true,
318 "foo/bar/baz/foo": true,
338 var trie = new TestTrie(builders, resultsByBuilder);
339 deepEqual(trie._trie, expectedTrie);
341 var leafsOfCompleteTrieTraversal = [];
342 var expectedLeafs = ["foo/bar/1.html", "foo/bar/baz/1.html", "foo/bar/baz/foo", "foo/bar/2.html", "foo/bar/3.html", "foo/1.html", "bar"];
343 trie.forEach(function(triePath) {
344 leafsOfCompleteTrieTraversal.push(triePath);
346 deepEqual(leafsOfCompleteTrieTraversal, expectedLeafs);
348 var leafsOfPartialTrieTraversal = [];
349 expectedLeafs = ["foo/bar/1.html", "foo/bar/baz/1.html", "foo/bar/baz/foo", "foo/bar/2.html", "foo/bar/3.html"];
350 trie.forEach(function(triePath) {
351 leafsOfPartialTrieTraversal.push(triePath);
353 deepEqual(leafsOfPartialTrieTraversal, expectedLeafs);
356 test('changeTestTypeInvalidatesGroup', 1, function() {
357 var historyInstance = resetGlobals();
358 var originalGroup = '@ToT Blink';
359 var originalTestType = 'layout-tests';
360 builders.loadBuildersList(originalGroup, originalTestType);
361 historyInstance.crossDashboardState.group = originalGroup;
362 historyInstance.crossDashboardState.testType = originalTestType;
364 historyInstance.invalidateQueryParameters({'testType': 'ui_tests'});
365 notEqual(historyInstance.crossDashboardState.group, originalGroup, "group should have been invalidated");
368 test('shouldShowTest', 9, function() {
369 var historyInstance = new history.History(flakinessConfig);
370 historyInstance.parseParameters();
371 // FIXME(jparent): Change to use the flakiness_dashboard's history object
372 // once it exists, rather than tracking global.
373 g_history = historyInstance;
374 var test = createResultsObjectForTest('foo/test.html', 'dummyBuilder');
376 equal(shouldShowTest(test), false, 'default layout test, hide it.');
377 historyInstance.dashboardSpecificState.showNonFlaky = true;
378 equal(shouldShowTest(test), true, 'show correct expectations.');
379 historyInstance.dashboardSpecificState.showNonFlaky = false;
381 test = createResultsObjectForTest('foo/test.html', 'dummyBuilder');
382 test.expectations = "WONTFIX";
383 equal(shouldShowTest(test), false, 'by default hide wontfix');
384 historyInstance.dashboardSpecificState.showWontFix = true;
385 equal(shouldShowTest(test), true, 'show wontfix');
386 historyInstance.dashboardSpecificState.showWontFix = false;
388 test = createResultsObjectForTest('foo/test.html', 'dummyBuilder');
389 test.expectations = "SKIP";
390 equal(shouldShowTest(test), false, 'we hide skip tests by default');
391 historyInstance.dashboardSpecificState.showSkip = true;
392 equal(shouldShowTest(test), true, 'show skip test');
393 historyInstance.dashboardSpecificState.showSkip = false;
395 test = createResultsObjectForTest('foo/test.html', 'dummyBuilder');
397 equal(shouldShowTest(test), false, 'hide flaky tests by default');
398 historyInstance.dashboardSpecificState.showFlaky = true;
399 equal(shouldShowTest(test), true, 'show flaky test');
400 historyInstance.dashboardSpecificState.showFlaky = false;
402 test = createResultsObjectForTest('foo/test.html', 'dummyBuilder');
403 historyInstance.crossDashboardState.testType = 'not layout tests';
404 equal(shouldShowTest(test), true, 'show all non layout tests');
407 test('collapsedRevisionListBlink', 1, function() {
409 builders.loadBuildersList('@ToT Blink', 'layout-tests');
410 var test = 'dummytest.html';
412 var builderName1 = 'WebKit Linux 1';
413 // Note: r1235 results were generated twice by two separate builds.
414 g_resultsByBuilder[builderName1] = {buildNumbers: [2, 1, 3, 4], blinkRevision: [1235, 1235, 1234, 1232], failure_map: FAILURE_MAP};
416 var builderName2 = 'WebKit Linux 2';
417 g_resultsByBuilder[builderName2] = {buildNumbers: [4, 5], blinkRevision: [1236, 1234], failure_map: FAILURE_MAP};
419 var resultsObject1 = createResultsObjectForTest(test, builderName1);
420 var resultsObject2 = createResultsObjectForTest(test, builderName2);
422 var result = collapsedRevisionList([resultsObject1, resultsObject2]).join(',');
423 var expected = [1236, 1235, 1235, 1234, 1232].join(',');
424 equal(result, expected, 'collapsedRevisionList result should be the unique blink builds, sorted in descending order');
427 test('collapsedRevisionListChromium', 1, function() {
429 g_history.crossDashboardState.group = '@ToT Chromium';
430 builders.loadBuildersList('@ToT Chromium', 'unit_tests');
431 var test = 'dummytest.html';
433 var builderName1 = 'WebKit Linux 1';
434 // Note: r1235 results were generated twice by two separate builds.
435 g_resultsByBuilder[builderName1] = {buildNumbers: [2, 1, 3, 4], chromeRevision: [1235, 1235, 1234, 1232], failure_map: FAILURE_MAP};
437 var builderName2 = 'WebKit Linux 2';
438 g_resultsByBuilder[builderName2] = {buildNumbers: [4, 5], chromeRevision: [1236, 1234], failure_map: FAILURE_MAP};
440 var resultsObject1 = createResultsObjectForTest(test, builderName1);
441 var resultsObject2 = createResultsObjectForTest(test, builderName2);
443 var result = collapsedRevisionList([resultsObject1, resultsObject2]).join(',');
444 var expected = [1236, 1235, 1235, 1234, 1232].join(',');
445 equal(result, expected, 'collapsedRevisionList result should be the unique chromium builds, sorted in descending order');
448 test('htmlForTestsWithMultipleRunsAtTheSameRevision', 1, function() {
450 builders.loadBuildersList('@ToT Blink', 'layout-tests');
451 var test = 'dummytest.html';
453 var builderName1 = 'WebKit Linux (dbg)';
454 // Note: r1235 results were generated thrice by three separate builds.
455 g_resultsByBuilder[builderName1] = {buildNumbers: [4, 3, 2, 1, 0], blinkRevision: [1235, 1235, 1235, 1234, 1233], failure_map: FAILURE_MAP};
457 var builderName2 = 'WebKit Win (dbg)';
458 g_resultsByBuilder[builderName2] = {buildNumbers: [6, 5], blinkRevision: [1236, 1234], failure_map: FAILURE_MAP};
460 var resultsObject1 = createResultsObjectForTest(test, builderName1);
461 resultsObject1.rawResults = [[0, 'F'], [1, 'I'], [2, 'I'], [3, 'P'], [4, 'F']];
462 resultsObject1.rawTimes = [[0, 0], [1, 0], [2, 0], [3, 0], [4, 0]];
463 resultsObject1.bugs = ["crbug.com/1234", "crbug.com/5678", "crbug.com/9101112"];
465 var resultsObject2 = createResultsObjectForTest(test, builderName2);
466 resultsObject2.rawResults = [[4, 'F'], [5, 'I']];
467 resultsObject2.rawTimes = [[4, 0], [5, 5]];
468 resultsObject2.bugs = ["crbug.com/one", "crbug.com/two"];
470 g_testToResultsMap[test] = [resultsObject1, resultsObject2];
471 equal(htmlForIndividualTestOnAllBuildersWithResultsLinks(test),
472 '<table class=test-table><thead><tr>' +
473 '<th sortValue=test><div class=table-header-content><span></span><span class=header-text>test</span></div></th>' +
474 '<th sortValue=bugs><div class=table-header-content><span></span><span class=header-text>bugs</span></div></th>' +
475 '<th sortValue=expectations><div class=table-header-content><span></span><span class=header-text>expectations</span></div></th>' +
476 '<th sortValue=slowest><div class=table-header-content><span></span><span class=header-text>slowest run</span></div></th>' +
477 '<th sortValue=flakiness colspan=10000><div class=table-header-content><span></span><span class=header-text>flakiness (numbers are runtimes in seconds)</span></div></th>' +
480 '<td class="test-link builder-name">WebKit Linux (dbg)' +
481 '<td class=options-container>' +
482 '<div><a href="http://crbug.com/1234">crbug.com/1234</a></div>' +
483 '<div><a href="http://crbug.com/5678">crbug.com/5678</a></div>' +
484 '<div><a href="http://crbug.com/9101112">crbug.com/9101112</a></div>' +
485 '<td class=options-container><td>' +
486 '<td title="Unknown result. Did not run tests." onclick=\'showPopupForInterpolatedResult(event, "1236")\' class="results interpolatedResult NODATA" >?</td>' +
487 '<td title="TEXT. Click for more info." class="results TEXT" onclick=\'showPopupForBuild(event, "WebKit Linux (dbg)",0,"dummytest.html")\'></td>' +
488 '<td title="IMAGE. Click for more info." class="results IMAGE" onclick=\'showPopupForBuild(event, "WebKit Linux (dbg)",1,"dummytest.html")\'></td>' +
489 '<td title="IMAGE. Click for more info." class="results IMAGE" onclick=\'showPopupForBuild(event, "WebKit Linux (dbg)",2,"dummytest.html")\'></td>' +
490 '<td title="PASS. Click for more info." class="results PASS" onclick=\'showPopupForBuild(event, "WebKit Linux (dbg)",3,"dummytest.html")\'></td>' +
491 '<td title="PASS. Click for more info." class="results PASS" onclick=\'showPopupForBuild(event, "WebKit Linux (dbg)",4,"dummytest.html")\'></td>' +
492 '<tr><td class="test-link builder-name">WebKit Win (dbg)' +
493 '<td class=options-container>' +
494 '<div><a href="http://crbug.com/one">crbug.com/one</a></div>' +
495 '<div><a href="http://crbug.com/two">crbug.com/two</a></div>' +
496 '<td class=options-container><td>' +
497 '<td title="TEXT. Click for more info." class="results TEXT" onclick=\'showPopupForBuild(event, "WebKit Win (dbg)",0,"dummytest.html")\'></td>' +
498 '<td title="Unknown result. Did not run tests." onclick=\'showPopupForInterpolatedResult(event, "1235")\' class="results interpolatedResult TEXT" >?</td>' +
499 '<td title="Unknown result. Did not run tests." onclick=\'showPopupForInterpolatedResult(event, "1235")\' class="results interpolatedResult TEXT" >?</td>' +
500 '<td title="Unknown result. Did not run tests." onclick=\'showPopupForInterpolatedResult(event, "1235")\' class="results interpolatedResult TEXT" >?</td>' +
501 '<td title="TEXT. Click for more info." class="results TEXT" onclick=\'showPopupForBuild(event, "WebKit Win (dbg)",1,"dummytest.html")\'></td>' +
502 '<td title="Unknown result. Did not run tests." onclick=\'showPopupForInterpolatedResult(event, "1233")\' class="results interpolatedResult NODATA" >?</td>' +
505 '<div>The following builders either don\'t run this test (e.g. it\'s skipped) or all recorded runs passed:</div>' +
506 '<div class=skipped-builder-list>' +
507 '<div class=skipped-builder>WebKit Linux</div><div class=skipped-builder>WebKit Mac10.7</div><div class=skipped-builder>WebKit Win</div>' +
509 '<div class=expectations test=dummytest.html>' +
510 '<div><span class=link onclick="g_history.setQueryParameter(\'showExpectations\', true)">Show results</span> | ' +
511 '<span class=link onclick="g_history.setQueryParameter(\'showLargeExpectations\', true)">Show large thumbnails</span> | ' +
512 '<b>Only shows actual results/diffs from the most recent *failure* on each bot.</b></div>' +
516 test('collapsedRevisionListChromiumWithGitHash', 1, function() {
518 builders.loadBuildersList('@ToT Blink', 'layout-tests');
519 var test = 'dummytest.html';
521 var builderName = 'WebKit Linux (dbg)';
522 g_resultsByBuilder[builderName] = {buildNumbers: [0], blinkRevision: ['b7228ffd469f5d3f4a10952fb8e9a34acb2f0d4b'], failure_map: FAILURE_MAP};
524 var resultsObject = createResultsObjectForTest(test, builderName);
525 resultsObject.rawResults = [[0, 'P']];
526 resultsObject.rawTimes = [[0, 0]];
527 resultsObject.bugs = ["crbug.com/1234"];
529 g_testToResultsMap[test] = [resultsObject];
530 equal(htmlForIndividualTestOnAllBuildersWithResultsLinks(test),
531 '<table class=test-table>' +
533 '<th sortValue=test><div class=table-header-content><span></span><span class=header-text>test</span></div></th>' +
534 '<th sortValue=bugs><div class=table-header-content><span></span><span class=header-text>bugs</span></div></th>' +
535 '<th sortValue=expectations><div class=table-header-content><span></span><span class=header-text>expectations</span></div></th>' +
536 '<th sortValue=slowest><div class=table-header-content><span></span><span class=header-text>slowest run</span></div></th>' +
537 '<th sortValue=flakiness colspan=10000><div class=table-header-content><span></span><span class=header-text>flakiness (numbers are runtimes in seconds)</span></div></th>' +
540 '<td class="test-link builder-name">WebKit Linux (dbg)<td class=options-container><div><a href="http://crbug.com/1234">crbug.com/1234</a></div>' +
541 '<td class=options-container><td><td title="Unknown result. Did not run tests." onclick=\'showPopupForInterpolatedResult(event, "b7228ffd469f5d3f4a10952fb8e9a34acb2f0d4b")\' class="results interpolatedResult NODATA" >?</td>' +
544 '<div>The following builders either don\'t run this test (e.g. it\'s skipped) or all recorded runs passed:</div>' +
545 '<div class=skipped-builder-list>' +
546 '<div class=skipped-builder>WebKit Linux</div>' +
547 '<div class=skipped-builder>WebKit Mac10.7</div>' +
548 '<div class=skipped-builder>WebKit Win</div>' +
549 '<div class=skipped-builder>WebKit Win (dbg)</div>' +
551 '<div class=expectations test=dummytest.html>' +
553 '<span class=link onclick="g_history.setQueryParameter(\'showExpectations\', true)">Show results</span> | ' +
554 '<span class=link onclick="g_history.setQueryParameter(\'showLargeExpectations\', true)">Show large thumbnails</span> | ' +
555 '<b>Only shows actual results/diffs from the most recent *failure* on each bot.</b>' +