OLD | NEW |
| (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.failures'); | |
29 | |
30 test('Builder', 6, function() { | |
31 var configuration; | |
32 configuration = new ui.failures.Builder("WebKit Linux", ["update", "webkit_t
ests"]); | |
33 deepEqual(Object.getOwnPropertyNames(configuration.__proto__).sort(), [ | |
34 '_addSpan', | |
35 'equals', | |
36 'init', | |
37 ]); | |
38 equal(configuration.outerHTML, '<a class="failing-builder" href="http://buil
d.chromium.org/p/chromium.webkit/waterfall?builder=WebKit+Linux"><span class="ve
rsion">lucid</span><span class="architecture">64-bit</span><span class="failures
"> update, webkit_tests</span></a>'); | |
39 configuration = new ui.failures.Builder("WebKit XP"); | |
40 equal(configuration.outerHTML, '<a class="failing-builder" href="http://buil
d.chromium.org/p/chromium.webkit/waterfall?builder=WebKit+XP"><span class="versi
on">xp</span></a>'); | |
41 configuration._addSpan('foo', 'bar'); | |
42 equal(configuration.outerHTML, '<a class="failing-builder" href="http://buil
d.chromium.org/p/chromium.webkit/waterfall?builder=WebKit+XP"><span class="versi
on">xp</span><span class="foo">bar</span></a>'); | |
43 ok(configuration.equals({version: 'xp'})); | |
44 ok(!configuration.equals({version: 'lucid', is64bit: true})); | |
45 }); | |
46 | |
47 test('FailureGrid', 10, function() { | |
48 var grid = new ui.failures.FailureGrid(); | |
49 deepEqual(Object.getOwnPropertyNames(grid.__proto__).sort(), [ | |
50 "_reset", | |
51 "_rowByResult", | |
52 "init", | |
53 "purge", | |
54 "update" | |
55 ]); | |
56 equal(grid.outerHTML, '<table class="failures">' + | |
57 '<thead><tr><td>type</td><td>release</td><td>debug</td></tr></thead>' + | |
58 '<tbody><tr class="BUILDING" style="display: none;"><td><span>BUILDING</
span></td><td></td><td></td></tr></tbody>' + | |
59 '</table>'); | |
60 var row = grid._rowByResult('TEXT'); | |
61 equal(grid.outerHTML, '<table class="failures">' + | |
62 '<thead><tr><td>type</td><td>release</td><td>debug</td></tr></thead>' + | |
63 '<tbody>' + | |
64 '<tr class="TEXT">' + | |
65 '<td><span>TEXT</span></td><td></td><td></td>' + | |
66 '</tr>' + | |
67 '<tr class="BUILDING" style="display: none;"><td><span>BUILDING</spa
n></td><td></td><td></td></tr>' + | |
68 '</tbody>' + | |
69 '</table>'); | |
70 equal(row.outerHTML, '<tr class="TEXT"><td><span>TEXT</span></td><td></td><t
d></td></tr>'); | |
71 grid.update({}); | |
72 equal(grid.outerHTML, '<table class="failures">' + | |
73 '<thead><tr><td>type</td><td>release</td><td>debug</td></tr></thead>' + | |
74 '<tbody>' + | |
75 '<tr class="TEXT">' + | |
76 '<td><span>TEXT</span></td><td></td><td></td>' + | |
77 '</tr>' + | |
78 '<tr class="BUILDING" style="display: none;"><td><span>BUILDING</spa
n></td><td></td><td></td></tr>' + | |
79 '</tbody>' + | |
80 '</table>'); | |
81 raises(function() { | |
82 grid.update({'Atari': {}}) | |
83 }); | |
84 grid.update({'WebKit Linux (dbg)': { actual: 'TEXT'}}); | |
85 equal(grid.outerHTML, '<table class="failures">' + | |
86 '<thead><tr><td>type</td><td>release</td><td>debug</td></tr></thead>' + | |
87 '<tbody>' + | |
88 '<tr class="TEXT">' + | |
89 '<td><span>TEXT</span></td>' + | |
90 '<td></td>' + | |
91 '<td><a class="failing-builder" href="http://build.chromium.org/
p/chromium.webkit/waterfall?builder=WebKit+Linux+(dbg)"><span class="version">lu
cid</span><span class="architecture">64-bit</span></a></td>' + | |
92 '</tr>' + | |
93 '<tr class="BUILDING" style="display: none;"><td><span>BUILDING</spa
n></td><td></td><td></td></tr>' + | |
94 '</tbody>' + | |
95 '</table>'); | |
96 grid.update({'WebKit Mac10.6': { actual: 'IMAGE+TEXT'}}); | |
97 equal(grid.outerHTML, '<table class="failures">' + | |
98 '<thead><tr><td>type</td><td>release</td><td>debug</td></tr></thead>' + | |
99 '<tbody>' + | |
100 '<tr class="IMAGE+TEXT">' + | |
101 '<td><span>IMAGE+TEXT</span></td>' + | |
102 '<td><a class="failing-builder" href="http://build.chromium.org/
p/chromium.webkit/waterfall?builder=WebKit+Mac10.6"><span class="version">snowle
opard</span></a></td>' + | |
103 '<td></td>' + | |
104 '</tr>' + | |
105 '<tr class="TEXT">' + | |
106 '<td><span>TEXT</span></td>' + | |
107 '<td></td>' + | |
108 '<td><a class="failing-builder" href="http://build.chromium.org/
p/chromium.webkit/waterfall?builder=WebKit+Linux+(dbg)"><span class="version">lu
cid</span><span class="architecture">64-bit</span></a></td>' + | |
109 '</tr>' + | |
110 '<tr class="BUILDING" style="display: none;"><td><span>BUILDING</spa
n></td><td></td><td></td></tr>' + | |
111 '</tbody>' + | |
112 '</table>'); | |
113 grid.update({'WebKit Mac10.6': { actual: 'IMAGE+TEXT'}}); | |
114 equal(grid.outerHTML, '<table class="failures">' + | |
115 '<thead><tr><td>type</td><td>release</td><td>debug</td></tr></thead>' + | |
116 '<tbody>' + | |
117 '<tr class="IMAGE+TEXT">' + | |
118 '<td><span>IMAGE+TEXT</span></td>' + | |
119 '<td><a class="failing-builder" href="http://build.chromium.org/
p/chromium.webkit/waterfall?builder=WebKit+Mac10.6"><span class="version">snowle
opard</span></a></td>' + | |
120 '<td></td>' + | |
121 '</tr>' + | |
122 '<tr class="TEXT">' + | |
123 '<td><span>TEXT</span></td>' + | |
124 '<td></td>' + | |
125 '<td><a class="failing-builder" href="http://build.chromium.org/
p/chromium.webkit/waterfall?builder=WebKit+Linux+(dbg)"><span class="version">lu
cid</span><span class="architecture">64-bit</span></a></td>' + | |
126 '</tr>' + | |
127 '<tr class="BUILDING" style="display: none;"><td><span>BUILDING</spa
n></td><td></td><td></td></tr>' + | |
128 '</tbody>' + | |
129 '</table>'); | |
130 grid.purge(); | |
131 grid.update({'WebKit Linux (dbg)': { actual: 'TEXT'}}); | |
132 equal(grid.outerHTML, '<table class="failures">' + | |
133 '<thead><tr><td>type</td><td>release</td><td>debug</td></tr></thead>' + | |
134 '<tbody>' + | |
135 '<tr class="TEXT">' + | |
136 '<td><span>TEXT</span></td>' + | |
137 '<td></td>' + | |
138 '<td><a class="failing-builder" href="http://build.chromium.org/
p/chromium.webkit/waterfall?builder=WebKit+Linux+(dbg)"><span class="version">lu
cid</span><span class="architecture">64-bit</span></a></td>' + | |
139 '</tr>' + | |
140 '<tr class="BUILDING" style="display: none;"><td><span>BUILDING</spa
n></td><td></td><td></td></tr>' + | |
141 '</tbody>' + | |
142 '</table>'); | |
143 }); | |
144 | |
145 }()); | |
OLD | NEW |