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

Side by Side Diff: Tools/GardeningServer/ui/test/ct-failure-card-tests.html

Issue 476903004: [sheriff-o-matic]: Basic trooper display for sheriff-o-matic. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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
OLDNEW
1 <!-- 1 <!--
2 Copyright 2014 The Chromium Authors. All rights reserved. 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 3 Use of this source code is governed by a BSD-style license that can be
4 found in the LICENSE file. 4 found in the LICENSE file.
5 --> 5 -->
6 6
7 <link rel="import" href="../ct-failure-card.html"> 7 <link rel="import" href="../ct-failure-card.html">
8 8
9 <link rel="import" href="../../model/ct-commit-list-mock.html"> 9 <link rel="import" href="../../model/ct-commit-list-mock.html">
10 <link rel="import" href="../../model/ct-commit-log-mock.html"> 10 <link rel="import" href="../../model/ct-commit-log-mock.html">
(...skipping 15 matching lines...) Expand all
26 group = new CTFailureGroup([ 26 group = new CTFailureGroup([
27 new CTFailure('autobot', 'unknown', {someBuilder: {key: 'a'}}, {'blink': 158547}, 27 new CTFailure('autobot', 'unknown', {someBuilder: {key: 'a'}}, {'blink': 158547},
28 {'blink':158544})], cl); 28 {'blink':158544})], cl);
29 card.group = group; 29 card.group = group;
30 card.commitLog = new CTCommitLogMock(); 30 card.commitLog = new CTCommitLogMock();
31 setTimeout(done); 31 setTimeout(done);
32 }); 32 });
33 33
34 describe('failure card UI', function() { 34 describe('failure card UI', function() {
35 35
36 it('should select the correct card type', function(done) {
37 assert(card.shadowRoot.querySelector('ct-sheriff-card',
38 'missing sheriff card') != null);
ojan 2014/09/02 02:35:11 This explanatory string is in the wrong place.
shans 2014/09/04 01:59:43 Done.
39 card.group = new CTTrooperFailureGroup({percent_over_median_slo: '6%',
40 percent_over_max_slo: '7%'}, 'cq_latency', '');
41 setTimeout(function() {
42 assert(card.shadowRoot.querySelector('ct-cq-latency-card') != null,
43 'missing cq-latency card');
44 card.group.type = 'tree_status';
45 setTimeout(function() {
46 assert(card.shadowRoot.querySelector('ct-tree-status-card') !=
47 null, 'missing tree-status card');
48 card.group.type = 'cycle_time';
49 setTimeout(function() {
50 assert(card.shadowRoot.querySelector('ct-cycle-time-card') !=
51 null, 'missing cycle-time card');
52 // Suppress leaked global warning from third-party library.
53 delete __googleVisualizationAbstractRendererElementsCount__;
54 done();
55 });
56 });
57 });
58 });
59
36 it('should have commit summaries', function(done) { 60 it('should have commit summaries', function(done) {
37 // Expand the first repository so that the <ct-commit>'s are generated. 61 // Expand the first repository so that the <ct-commit>'s are generated.
38 card.group.commitList.repositories[0].expanded = true; 62 card.group.commitList.repositories[0].expanded = true;
39 63
40 setTimeout(function() { 64 setTimeout(function() {
41 var list = card.shadowRoot.querySelector('ct-commit-list'); 65 var list = card.shadowRoot.querySelector('::shadow ct-commit-list');
42 var commits = list.shadowRoot.querySelectorAll('ct-commit'); 66 var commits = list.shadowRoot.querySelectorAll('ct-commit');
43 assert(commits[1].data); 67 assert(commits[1].data);
44 assert(commits[1].data.summary); 68 assert(commits[1].data.summary);
45 done(); 69 done();
46 }); 70 });
47 }); 71 });
48 72
49 it('removing a commit summary', function(done) { 73 it('removing a commit summary', function(done) {
50 card.commitLog.commits['blink']['158545'].summary = undefined; 74 card.commitLog.commits['blink']['158545'].summary = undefined;
51 card.group.commitList.repositories[0].expanded = true; 75 card.group.commitList.repositories[0].expanded = true;
52 76
53 setTimeout(function() { 77 setTimeout(function() {
54 var list = card.shadowRoot.querySelector('ct-commit-list'); 78 var list = card.shadowRoot.querySelector('::shadow ct-commit-list');
55 var commits = list.shadowRoot.querySelectorAll('ct-commit'); 79 var commits = list.shadowRoot.querySelectorAll('ct-commit');
56 assert.notOk(commits[0].data.summary); 80 assert.notOk(commits[0].data.summary);
57 done(); 81 done();
58 }); 82 });
59 }); 83 });
60 84
61 it('examine should dispatch event', function(done) { 85 it('examine should dispatch event', function(done) {
62 card.addEventListener('ct-examine-failures', function(event) { 86 card.addEventListener('ct-examine-failures', function(event) {
63 assert.deepEqual(event.detail.failures, card.group.failures); 87 assert.deepEqual(event.detail.failures, card.group.failures);
64 done(); 88 done();
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 done(); 154 done();
131 }); 155 });
132 }); 156 });
133 }); 157 });
134 }); 158 });
135 159
136 }); 160 });
137 161
138 })() 162 })()
139 </script> 163 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698