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

Side by Side Diff: Tools/GardeningServer/ui/test/ct-builder-grid-tests.html

Issue 462453002: Sheriff-O-Matic: Transition more unit tests to mocha. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase and fix 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-builder-grid.html"> 7 <link rel="import" href="../ct-builder-grid.html">
8 8
9 <link rel="import" href="../ct-builder.html">
10
9 <script> 11 <script>
10 (function () { 12 (function () {
11 13
12 var assert = chai.assert; 14 var assert = chai.assert;
13 15
14 var kExampleFailures = [{ 16 var kExampleFailures = [{
15 "testName": "plugins/gesture-events-scrolled.html", 17 "testName": "plugins/gesture-events-scrolled.html",
16 "resultNodesByBuilder": { 18 "resultNodesByBuilder": {
17 "WebKit Win7 (dbg)": { 19 "WebKit Win7 (dbg)": {
18 "actual": "CRASH", 20 "actual": "CRASH",
21 "masterUrl": "http://master-one",
22 "earliestFailingBuild": "1",
19 }, 23 },
20 "WebKit Mac10.6 (dbg)": { 24 "WebKit Mac10.6 (dbg)": {
21 "actual": "CRASH", 25 "actual": "CRASH",
26 "masterUrl": "http://master-one",
27 "earliestFailingBuild": "2",
22 }, 28 },
23 "WebKit Mac10.7": { 29 "WebKit Mac10.7": {
24 "actual": "TEXT", 30 "actual": "TEXT",
31 "masterUrl": "http://master-one",
32 "earliestFailingBuild": "3",
25 } 33 }
26 }, 34 },
27 "oldestFailingRevision": 177164, 35 "oldestFailingRevision": 177164,
28 "newestPassingRevision": 177165 36 "newestPassingRevision": 177165
29 }, { 37 }, {
30 "testName": "plugins/transformed-events.html", 38 "testName": "plugins/transformed-events.html",
31 "resultNodesByBuilder": { 39 "resultNodesByBuilder": {
32 "WebKit Win7 (dbg)": { 40 "WebKit Win7 (dbg)": {
33 "actual": "TEXT", 41 "actual": "TEXT",
42 "masterUrl": "http://master-one",
43 "earliestFailingBuild": "1",
34 }, 44 },
35 "WebKit Mac10.7": { 45 "WebKit Mac10.7": {
36 "actual": "CRASH", 46 "actual": "CRASH",
47 "masterUrl": "http://master-two",
48 "earliestFailingBuild": "4",
37 }, 49 },
38 }, 50 },
39 "oldestFailingRevision": 177164, 51 "oldestFailingRevision": 177164,
40 "newestPassingRevision": 177165 52 "newestPassingRevision": 177165
41 }]; 53 }];
42 54
43 var kExampleBuilderLatestRevisions = { 55 var kExampleBuilderLatestRevisions = {
44 'WebKit Mac10.7': { 56 'WebKit Mac10.7': {
45 blink: 177164, 57 blink: 177164,
46 }, 58 },
47 'WebKit Mac10.6 (dbg)': { 59 'WebKit Mac10.6 (dbg)': {
48 blink: 177166, 60 blink: 177166,
49 }, 61 },
50 'WebKit Win7 (dbg)': { 62 'WebKit Win7 (dbg)': {
51 blink: 177166, 63 blink: 177166,
52 }, 64 },
53 }; 65 };
54 66
55 describe('ct-builder-grid', function() { 67 describe('ct-builder-grid', function() {
56 var grid; 68 var grid;
57 69
58 beforeEach(function(done) { 70 beforeEach(function(done) {
59 grid = document.createElement('ct-builder-grid'); 71 grid = document.createElement('ct-builder-grid');
60 grid.failures = kExampleFailures; 72 grid.failures = kExampleFailures;
61 requestAnimationFrame(function() { done(); }); 73
74 setTimeout(done);
62 }); 75 });
63 76
64 describe('basic grid', function() { 77 describe('builder grid UI', function() {
65 it('should show builders by result type and debug/not debug', function() { 78 it('should show all failing builders', function() {
66 var rows = grid.shadowRoot.querySelectorAll('tbody tr'); 79 var builders = grid.shadowRoot.querySelectorAll('ct-builder');
67 assert.lengthOf(rows, 2); 80 assert.lengthOf(builders, 4);
68 81 assert.deepEqual(builders[0].builder, new CTBuilder(
69 var row1 = grid.shadowRoot.querySelector('tbody td.CRASH').parentNode; 82 'http://master-one', 'WebKit Mac10.6 (dbg)', '2'));
70 assert.lengthOf(row1.children, 2); 83 assert.deepEqual(builders[1].builder, new CTBuilder(
71 var builders = row1.children[1].querySelectorAll('ct-builder'); 84 'http://master-one', 'WebKit Mac10.7', '3'));
72 assert.lengthOf(builders, 3); 85 assert.deepEqual(builders[2].builder, new CTBuilder(
73 assert.equal(builders[0].builder, 'WebKit Mac10.6 (dbg)'); 86 'http://master-two', 'WebKit Mac10.7', '4'));
74 assert.equal(builders[1].builder, 'WebKit Mac10.7'); 87 assert.deepEqual(builders[3].builder, new CTBuilder(
75 assert.equal(builders[2].builder, 'WebKit Win7 (dbg)'); 88 'http://master-one', 'WebKit Win7 (dbg)', '1'));
76
77 var row2 = grid.shadowRoot.querySelector('tbody td.TEXT').parentNode;
78 assert.lengthOf(row2.children, 2);
79 builders = row2.children[1].querySelectorAll('ct-builder');
80 assert.lengthOf(builders, 2);
81 assert.equal(builders[0].builder, 'WebKit Mac10.7');
82 assert.equal(builders[1].builder, 'WebKit Win7 (dbg)');
83 }); 89 });
84 }); 90 });
85 }); 91 });
86 92
87 })() 93 })()
88 </script> 94 </script>
OLDNEW
« no previous file with comments | « Tools/GardeningServer/ui/ct-failure-analyzer-tests.html ('k') | Tools/GardeningServer/ui/test/ct-builder-tests.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698