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

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

Issue 464163002: Sheriff-o-Matic: Convert some more ui tests to mocha (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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="../model/ct-failure.html"> 7 <link rel="import" href="../ct-test-list.html">
8 <link rel="import" href="ct-test-list.html">
9 8
10 <link rel="import" href="../model/ct-failure.html"> 9 <link rel="import" href="../../model/ct-failure.html">
11 10
12 <script> 11 <script>
13 (function () { 12 (function () {
14 13
14 var assert = chai.assert;
15
15 var kExampleTests = [ 16 var kExampleTests = [
16 new CTFailure("foo_step", "plugins/gesture-events-scrolled.html", {}, 177164, 177165); 17 new CTFailure("foo_step", "plugins/gesture-events-scrolled.html", {}, 177164, 177165),
ojan 2014/08/13 00:30:28 :(
17 new CTFailure("foo_step", "plugins/transformed-events.html", {}, 177164, 17716 5); 18 new CTFailure("foo_step", "plugins/transformed-events.html", {}, 177164, 17716 5),
18 new CTFailure("foo_step", "plugins/gesture-events.html", {}, 177164, 177165); 19 new CTFailure("foo_step", "plugins/gesture-events.html", {}, 177164, 177165),
19 ]; 20 ];
20 21
21 var kExampleTestsChromium = [ 22 var kExampleTestsChromium = [
22 new CTFailure("browser_tests", "SomeTest.SubTest1", {}, 177164, 177165); 23 new CTFailure("browser_tests", "SomeTest.SubTest1", {}, 177164, 177165),
23 new CTFailure("browser_tests", "SomeTest.SubTest2", {}, 177164, 177165); 24 new CTFailure("browser_tests", "SomeTest.SubTest2", {}, 177164, 177165),
24 ]; 25 ];
25 26
26 var kExampleTestsBlink = [ 27 var kExampleTestsBlink = [
27 new CTFailure("webkit_tests", "fast/events/foo.html", {}, 177164, 177165); 28 new CTFailure("webkit_tests", "fast/events/foo.html", {}, 177164, 177165),
28 new CTFailure("webkit_tests", "fast/events/bar.html", {}, 177164, 177165); 29 new CTFailure("webkit_tests", "fast/events/bar.html", {}, 177164, 177165),
29 ]; 30 ];
30 31
31 module("ct-test-list"); 32 function createTestList(tests, tree) {
33 var list = document.createElement('ct-test-list');
34 list.tests = tests;
35 list.tree = 'blink';
36 return list;
37 }
32 38
33 asyncTest("basic", 4, function() { 39 describe('ct-test-list', function() {
34 var list = document.createElement('ct-test-list'); 40 var list;
35 41
36 list.tests = kExampleFailures; 42 describe('tests failed', function() {
37 list.tree = 'blink'; 43 before(function(done) {
44 list = createTestList(kExampleTests, 'blink');
45 setTimeout(done);
46 });
38 47
39 setTimeout(function() { 48 it('should show all tests', function() {
40 var tests = list.shadowRoot.querySelectorAll('a'); 49 var tests = list.shadowRoot.querySelectorAll('a');
41 equal(tests.length, 3); 50 assert.equal(tests.length, 3);
42 equal(tests[0].href, 'http://test-results.appspot.com/dashboards/flakiness_d ashboard.html#group=@ToT%20Blink&tests=plugins%2Fgesture-events-scrolled.html&te stType=foo_step'); 51 assert.equal(tests[0].href, 'http://test-results.appspot.com/dashboards/fl akiness_dashboard.html#group=@ToT%20Blink&tests=plugins%2Fgesture-events-scrolle d.html&testType=foo_step');
43 equal(tests[1].href, 'http://test-results.appspot.com/dashboards/flakiness_d ashboard.html#group=@ToT%20Blink&tests=plugins%2Ftransformed-events.html&testTyp e=foo_step'); 52 assert.equal(tests[1].href, 'http://test-results.appspot.com/dashboards/fl akiness_dashboard.html#group=@ToT%20Blink&tests=plugins%2Ftransformed-events.htm l&testType=foo_step');
44 equal(tests[2].href, 'http://test-results.appspot.com/dashboards/flakiness_d ashboard.html#group=@ToT%20Blink&tests=plugins%2Fgesture-events.html&testType=fo o_step'); 53 assert.equal(tests[2].href, 'http://test-results.appspot.com/dashboards/fl akiness_dashboard.html#group=@ToT%20Blink&tests=plugins%2Fgesture-events.html&te stType=foo_step');
54 });
55 });
45 56
46 start(); 57 describe('group of tests failed', function() {
58 afterEach(function() {
59 var tests = list.shadowRoot.querySelectorAll('a');
60 assert.lengthOf(tests, 0);
61 var icons = list.shadowRoot.querySelectorAll('paper-icon-button');
62 assert.lengthOf(icons, 1);
63 });
64
65 it('should group chromium tests', function(done) {
66 list = createTestList(kExampleTestsChromium, 'chromium');
67 setTimeout(done);
68 });
69
70 it('should group blink tests', function(done) {
71 list = createTestList(kExampleTestsBlink, 'blink');
72 setTimeout(done);
73 });
47 }); 74 });
48 }); 75 });
49 76
50 asyncTest("groupingChromium", 2, function() { 77 })();
51 var list = document.createElement('ct-test-list');
52
53 list.tests = kExampleTestsChromium;
54 list.tree = 'chromium';
55
56 setTimeout(function() {
57 var tests = list.shadowRoot.querySelectorAll('a');
58 equal(tests.length, 0);
59 var icons = list.shadowRoot.querySelectorAll('paper-icon-button');
60 equal(icons.length, 1);
61
62 start();
63 });
64 });
65
66 asyncTest("groupingBlink", 2, function() {
67 var list = document.createElement('ct-test-list');
68
69 list.tests = kExampleTestsBlink;
70 list.tree = 'blink';
71
72 setTimeout(function() {
73 var tests = list.shadowRoot.querySelectorAll('a');
74 equal(tests.length, 0);
75 var icons = list.shadowRoot.querySelectorAll('paper-icon-button');
76 equal(icons.length, 1);
77
78 start();
79 });
80 });
81
82 })()
83 </script> 78 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698