Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(227)

Side by Side Diff: Tools/GardeningServer/scripts/ui/results_unittests.js

Issue 405843002: Delete garden-o-matic. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: update run_unittests.html Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Tools/GardeningServer/scripts/ui/results.js ('k') | Tools/GardeningServer/styles/common.css » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26 (function () {
27
28 module('ui.results');
29
30 asyncTest('FlakinessData', 1, function() {
31 var dashboard = new ui.results.FlakinessData();
32 dashboard.addEventListener('load', function() {
33 // setTimeout to be after the FlakinessData's load handler.
34 setTimeout(function() {
35 window.postMessage({command: 'heightChanged', height: 15}, '*');
36 // setTimeout to be after the postMessage has been handled.
37 setTimeout(function() {
38 equals(dashboard.offsetHeight, 15);
39 dashboard.remove();
40 start();
41 }, 0);
42 }, 0);
43 });
44 document.body.appendChild(dashboard);
45 });
46
47 var kExampleResultsByTest = {
48 "scrollbars/custom-scrollbar-with-incomplete-style.html": {
49 "Mock Builder": {
50 "expected": "IMAGE",
51 "actual": "CRASH"
52 },
53 "Mock Linux": {
54 "expected": "TEXT",
55 "actual": "CRASH"
56 }
57 },
58 "userscripts/another-test.html": {
59 "Mock Builder": {
60 "expected": "PASS",
61 "actual": "TEXT"
62 }
63 }
64 };
65
66 var kExampleReftestResults = {
67 "reftest.html": {
68 "Mock Builder": {
69 "expected": "PASS",
70 "actual": "IMAGE",
71 "reftest_type": ["=="]
72 }
73 },
74 "mismatch-reftest.html": {
75 "Mock Builder": {
76 "expected": "PASS",
77 "actual": "IMAGE",
78 "reftest_type": ["!="]
79 }
80 }
81 };
82
83 var kExampleResultsWithTimeoutByTest = {
84 "fast/not-fast-test.html": {
85 "Mock Builder": {
86 "expected": "PASS",
87 "actual": "TIMEOUT"
88 }
89 }
90 };
91
92 var kExampleGreaterThanFourResultsByTest = {
93 "scrollbars/custom-scrollbar-with-incomplete-style.html": {
94 "Mock Linux": {
95 "expected": "TEXT",
96 "actual": "CRASH"
97 }
98 },
99 "scrollbars/1.html": {
100 "Mock Linux": {
101 "expected": "TEXT",
102 "actual": "CRASH"
103 }
104 },
105 "scrollbars/2.html": {
106 "Mock Linux": {
107 "expected": "TEXT",
108 "actual": "CRASH"
109 }
110 },
111 "scrollbars/3.html": {
112 "Mock Linux": {
113 "expected": "TEXT",
114 "actual": "CRASH"
115 }
116 },
117 "userscripts/another-test.html": {
118 "Mock Builder": {
119 "expected": "PASS",
120 "actual": "TEXT"
121 }
122 }
123 };
124
125 test('View', 18, function() {
126 var delegate = {
127 fetchResultsURLs: function(failureInfo) { return Promise.resolve(); }
128 };
129
130 var view = new ui.results.View(delegate);
131 view.setResultsByTest(kExampleResultsByTest);
132
133 view.firstResult();
134 var testSelector = view.querySelector('.test-selector');
135 var topPanel = testSelector.querySelector('.top-panel');
136 equals(topPanel.childNodes[0], topPanel.querySelector('.active'));;
137 equals($($('.builder-selector', view)[0]).tabs('option', 'selected'), 0);
138
139 view.nextResult();
140 equals(topPanel.childNodes[0], topPanel.querySelector('.active'));;
141 equals($($('.builder-selector', view)[0]).tabs('option', 'selected'), 1);
142 equals(view.currentTestName(), 'scrollbars/custom-scrollbar-with-incomplete- style.html');
143
144 view.nextResult();
145 equals(topPanel.childNodes[1], topPanel.querySelector('.active'));;
146 equals($($('.builder-selector', view)[0]).tabs('option', 'selected'), 0);
147 equals(view.currentTestName(), 'userscripts/another-test.html');
148
149 view.previousResult();
150 equals(topPanel.childNodes[0], topPanel.querySelector('.active'));;
151 equals($($('.builder-selector', view)[0]).tabs('option', 'selected'), 1);
152
153 view.nextTest();
154 equals(topPanel.childNodes[1], topPanel.querySelector('.active'));;
155 equals($($('.builder-selector', view)[0]).tabs('option', 'selected'), 0);
156 equals(view.currentTestName(), 'userscripts/another-test.html');
157
158 view.previousTest();
159 equals(topPanel.childNodes[0], topPanel.querySelector('.active'));;
160 equals($($('.builder-selector', view)[0]).tabs('option', 'selected'), 1);
161 equals(view.currentTestName(), 'scrollbars/custom-scrollbar-with-incomplete- style.html');
162
163 ok(!testSelector.querySelector('.resize-handle'));
164 equals(topPanel.style.minHeight, '');
165 });
166
167 test('View with more than four tests', 2, function() {
168 var delegate = {
169 fetchResultsURLs: function(failureInfo) { return Promise.resolve(); }
170 };
171
172 var view = new ui.results.View(delegate);
173 view.setResultsByTest(kExampleGreaterThanFourResultsByTest);
174
175 var testSelector = view.querySelector('.test-selector');
176 var topPanel = testSelector.querySelector('.top-panel');
177
178 ok(testSelector.querySelector('.resize-handle'));
179 equals(topPanel.style.minHeight, '100px');
180 });
181
182 test('View with reftests', 2, function() {
183 var delegate = {
184 fetchResultsURLs: function(failureInfo) { return Promise.resolve(); }
185 };
186
187 var view = new ui.results.View(delegate);
188 view.setResultsByTest(kExampleReftestResults);
189 view.firstResult();
190
191 equals(view.querySelectorAll('.non-action-button').length, 0);
192 equals(view.querySelectorAll('.action').length, 0);
193 });
194
195 asyncTest('View of timeouts', 1, function() {
196 var emptyPromise = Promise.resolve([]);
197 var delegate = {
198 fetchResultsURLs: function(failureInfo) { return emptyPromise; }
199 };
200
201 var view = new ui.results.View(delegate);
202 view.setResultsByTest(kExampleResultsWithTimeoutByTest);
203 view.firstResult();
204 emptyPromise.then(function() {
205 equals(view.querySelector('.results-grid').innerHTML, 'No results to dis play.');
206 start();
207 });
208 });
209
210 })();
OLDNEW
« no previous file with comments | « Tools/GardeningServer/scripts/ui/results.js ('k') | Tools/GardeningServer/styles/common.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698