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

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

Issue 411763003: Set up mocha, chai and karma for sheriff-o-matic unit testing. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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
(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-builder-grid.html">
8
9 <script>
10 (function () {
11
12 var expect = chai.expect;
13
14 var kExampleFailures = [{
15 "testName": "plugins/gesture-events-scrolled.html",
16 "resultNodesByBuilder": {
17 "WebKit Win7 (dbg)": {
18 "actual": "CRASH",
19 },
20 "WebKit Mac10.6 (dbg)": {
21 "actual": "CRASH",
22 },
23 "WebKit Mac10.7": {
24 "actual": "TEXT",
25 }
26 },
27 "oldestFailingRevision": 177164,
28 "newestPassingRevision": 177165
29 }, {
30 "testName": "plugins/transformed-events.html",
31 "resultNodesByBuilder": {
32 "WebKit Win7 (dbg)": {
33 "actual": "TEXT",
34 },
35 "WebKit Mac10.7": {
36 "actual": "CRASH",
37 },
38 },
39 "oldestFailingRevision": 177164,
40 "newestPassingRevision": 177165
41 }];
42
43 var kExampleBuilderLatestRevisions = {
44 'WebKit Mac10.7': {
45 blink: 177164,
46 },
47 'WebKit Mac10.6 (dbg)': {
48 blink: 177166,
49 },
50 'WebKit Win7 (dbg)': {
51 blink: 177166,
52 },
53 };
54
55 suite('ct-builder-grid', function() {
56 var grid;
57
58 suiteSetup(function(done) {
esprehn 2014/07/25 23:59:39 beforeEach() I think?
michaelpg 2014/07/28 20:35:04 suiteSetup = beforeEach in tdd mode.
59 grid = document.createElement('ct-builder-grid');
60 grid.failures = kExampleFailures;
61 requestAnimationFrame(function() { done(); });
62 });
63
64 suite('basic', function() {
65 test('basic', function() {
esprehn 2014/07/25 23:59:39 describe() and it(), I don't know what suite() is,
michaelpg 2014/07/28 20:35:04 suite = describe, test = it. 3 levels seems to be
66 var rows = grid.shadowRoot.querySelectorAll('tbody tr');
67 expect(rows).lengthOf(2);
esprehn 2014/07/25 23:59:39 I usually use assert.equal(rows.length, 2)
michaelpg 2014/07/28 20:35:04 Done.
68
69 var row1 = grid.shadowRoot.querySelector('tbody td.CRASH').parentNode;
70 expect(row1.children).lengthOf(2);
71 expect(row1.children[1].querySelectorAll('ct-builder')).lengthOf(3);
72 expect(row1.children[1].querySelectorAll('ct-builder')[0].builder).equal(' WebKit Mac10.6 (dbg)');
73 expect(row1.children[1].querySelectorAll('ct-builder')[1].builder).equal(' WebKit Mac10.7');
74 expect(row1.children[1].querySelectorAll('ct-builder')[2].builder).equal(' WebKit Win7 (dbg)');
75
76 var row2 = grid.shadowRoot.querySelector('tbody td.TEXT').parentNode;
77 expect(row2.children).lengthOf(2);
78 expect(row2.children[1].querySelectorAll('ct-builder')).lengthOf(2);
79 expect(row2.children[1].querySelectorAll('ct-builder')[0].builder).equal(' WebKit Mac10.7');
80 expect(row2.children[1].querySelectorAll('ct-builder')[1].builder).equal(' WebKit Win7 (dbg)');
81 });
82 });
83 });
84
85 })()
86 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698