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

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

Issue 485253004: [Sheriff-o-matic] Remove race condition on the commit list. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: names Created 6 years, 4 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
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-log-mock.html">
9 <link rel="import" href="../../model/ct-failure-group.html"> 10 <link rel="import" href="../../model/ct-failure-group.html">
10 11
11 <script> 12 <script>
12 (function () { 13 (function () {
13 14
14 var assert = chai.assert; 15 var assert = chai.assert;
15 16
16 describe('ct-failure-group', function() { 17 describe('ct-failure-card', function() {
17 var group; 18 var group;
18 var card; 19 var card;
19 20
20 beforeEach(function(done) { 21 beforeEach(function(done) {
21 card = document.createElement('ct-failure-card'); 22 card = document.createElement('ct-failure-card');
22 group = new CTFailureGroup('key', []); 23 group = new CTFailureGroup('key', [
24 new CTFailure('autobot', 'unknown', {}, {'blink':158547},
25 {'blink':158544})]);
23 card.group = group; 26 card.group = group;
27 card.commitLog = new CTCommitLogMock();
24 setTimeout(done); 28 setTimeout(done);
25 }); 29 });
26 30
27 describe('failure group UI', function() { 31 describe('failure card UI', function() {
32
33 it('should have commit summaries', function(done) {
34 // Expand the first repository so that the <ct-commit>'s are generated.
35 card._commitList.repositories[0].expanded = true;
36
37 setTimeout(function() {
38 var list = card.shadowRoot.querySelector('ct-commit-list');
39 var commits = list.shadowRoot.querySelectorAll('ct-commit');
40 assert(commits[0].data);
41 assert(commits[0].data.summary);
42 done();
43 });
44 });
45
46 it('removing a commit summary', function(done) {
47 card.commitLog.commits['blink']['158545'].summary = undefined;
48 card._commitList.repositories[0].expanded = true;
49
50 setTimeout(function() {
51 var list = card.shadowRoot.querySelector('ct-commit-list');
52 var commits = list.shadowRoot.querySelectorAll('ct-commit');
53 assert.notOk(commits[0].data.summary);
54 done();
55 });
56 });
57
28 it('examine should dispatch event', function(done) { 58 it('examine should dispatch event', function(done) {
29 card.addEventListener('ct-examine-failures', function(event) { 59 card.addEventListener('ct-examine-failures', function(event) {
30 assert.deepEqual(event.detail.failures, []); 60 assert.deepEqual(event.detail.failures, card.group.failures);
31 done(); 61 done();
32 }); 62 });
33 63
34 card.shadowRoot.getElementById('examine').dispatchEvent(new CustomEvent('t ap')); 64 card.shadowRoot.getElementById('examine').dispatchEvent(new CustomEvent('t ap'));
35 }); 65 });
36 66
37 it('adding a bug number should show link', function(done) { 67 it('adding a bug number should show link', function(done) {
38 group.setBug(123); 68 group.setBug(123);
39 69
40 setTimeout(function() { 70 setTimeout(function() {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 done(); 127 done();
98 }); 128 });
99 }); 129 });
100 }); 130 });
101 }); 131 });
102 132
103 }); 133 });
104 134
105 })() 135 })()
106 </script> 136 </script>
OLDNEW
« no previous file with comments | « Tools/GardeningServer/ui/test/ct-commit-list-tests.html ('k') | Tools/GardeningServer/ui/test/ct-revision-details-tests.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698