OLD | NEW |
| (Empty) |
1 <!-- | |
2 Copyright 2014 The Chromium Authors. All rights reserved. | |
3 Use of this source code is governed by a BSD-style license that can be | |
4 found in the LICENSE file. | |
5 --> | |
6 | |
7 <link rel="import" href="../ct-results-by-builder.html"> | |
8 | |
9 <script> | |
10 (function () { | |
11 | |
12 var assert = chai.assert; | |
13 | |
14 var kExampleFailure = { | |
15 "testName": "inspector/console/console-viewport-selection.html", | |
16 "resultNodesByBuilder": { | |
17 "WebKit Mac10.6 (dbg)": { | |
18 "actual": "IMAGE", | |
19 }, | |
20 "WebKit Linux (dbg)": { | |
21 "actual": "TEXT", | |
22 }, | |
23 }, | |
24 "oldestFailingRevision": 177164, | |
25 "newestPassingRevision": 177165, | |
26 }; | |
27 | |
28 describe('ct-results-by-builder', function() { | |
29 var resultsByBuilder; | |
30 var oldFetchResultsURLs; | |
31 | |
32 beforeEach(function(done) { | |
33 // FIXME: Remove this override when ct-results-detail is fixed to not use | |
34 // results.fetchResultsURLs. | |
35 oldFetchResultsURLs = results.fetchResultsURLs; | |
36 results.fetchResultsURLs = function() { return Promise.resolve([]); }; | |
37 | |
38 resultsByBuilder = document.createElement('ct-results-by-builder'); | |
39 resultsByBuilder.failure = kExampleFailure; | |
40 | |
41 setTimeout(done); | |
42 }); | |
43 | |
44 afterEach(function() { | |
45 results.fetchResultsURLs = oldFetchResultsURLs; | |
46 }); | |
47 | |
48 describe('results UI', function() { | |
49 it('should show details in each tab', function(done) { | |
50 var tabs = resultsByBuilder.shadowRoot.querySelectorAll('paper-tab'); | |
51 assert.lengthOf(tabs, 2); | |
52 assert.equal(tabs[0].textContent, 'WebKit Linux (dbg)'); | |
53 assert.equal(tabs[1].textContent, 'WebKit Mac10.6 (dbg)'); | |
54 | |
55 var detail = resultsByBuilder.shadowRoot.querySelectorAll('ct-results-deta
il'); | |
56 assert.lengthOf(detail, 1); | |
57 assert.equal(detail[0].failure.testName, 'inspector/console/console-viewpo
rt-selection.html'); | |
58 assert.equal(detail[0].builder, 'WebKit Linux (dbg)'); | |
59 | |
60 resultsByBuilder.shadowRoot.querySelector('paper-tabs').selected = 1; | |
61 | |
62 setTimeout(function() { | |
63 var detail = resultsByBuilder.shadowRoot.querySelectorAll('ct-results-de
tail'); | |
64 assert.lengthOf(detail, 1); | |
65 assert.equal(detail[0].failure.testName, 'inspector/console/console-view
port-selection.html'); | |
66 assert.equal(detail[0].builder, 'WebKit Mac10.6 (dbg)'); | |
67 done(); | |
68 }); | |
69 }); | |
70 }); | |
71 }); | |
72 | |
73 })() | |
74 </script> | |
OLD | NEW |