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

Side by Side Diff: Tools/GardeningServer/ui/test/ct-embedded-flakiness-dashboard-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-embedded-flakiness-dashboard.html"> 7 <link rel="import" href="../ct-embedded-flakiness-dashboard.html">
8 8
9 <script> 9 <script>
10 (function() { 10 (function () {
11 11
12 module("ct-embedded-flakiness-dashboard"); 12 var assert = chai.assert;
13 13
14 asyncTest("url", 1, function() { 14 describe('ct-embedded-flakiness-dashboard', function() {
15 var oldUrlForEmbeddedFlakinessDashboard = ui.urlForEmbeddedFlakinessDashboard; 15 var embeddedFlakinessDashboard;
16 var reset = function() {
17 ui.urlForEmbeddedFlakinessDashboard = oldUrlForEmbeddedFlakinessDashboard;
18 }
19 16
20 try { 17 describe('embedded flakiness dashboard UI', function() {
21 ui.urlForEmbeddedFlakinessDashboard = function(test, step, tree) { return "a bout:blank#" + test + step + tree; } 18 var oldUrlForEmbeddedFlakinessDashboard = ui.urlForEmbeddedFlakinessDashboar d;
22 var embeddedFlakinessDashboard = document.createElement('ct-embedded-flakine ss-dashboard'); 19 var testName;
23 var testName = "foo/bar.html"; 20 var step;
24 var step = "foo_tests"; 21 var tree;
25 var tree = "blink";
26 embeddedFlakinessDashboard.test = {
27 testName: testName,
28 step: step,
29 };
30 embeddedFlakinessDashboard.tree = tree;
31 22
32 requestAnimationFrame(function() { 23 beforeEach(function(done) {
24 ui.urlForEmbeddedFlakinessDashboard = function(test, step, tree) { return "about:blank#" + test + step + tree; }
25 embeddedFlakinessDashboard = document.createElement('ct-embedded-flakiness -dashboard');
26 testName = "foo/bar.html";
27 step = "foo_tests";
28 tree = "blink";
29 embeddedFlakinessDashboard.test = {
30 testName: testName,
31 step: step,
32 };
33 embeddedFlakinessDashboard.tree = tree;
34
35 setTimeout(done);
36 });
37
38 afterEach(function() {
39 ui.urlForEmbeddedFlakinessDashboard = oldUrlForEmbeddedFlakinessDashboard;
40 });
41
42 it('should point the iframe to the dashboard', function() {
33 var iframe = embeddedFlakinessDashboard.shadowRoot.querySelector('#iframe' ); 43 var iframe = embeddedFlakinessDashboard.shadowRoot.querySelector('#iframe' );
34 equal(iframe.src, ui.urlForEmbeddedFlakinessDashboard(testName, step, tree )); 44 assert.equal(iframe.src, ui.urlForEmbeddedFlakinessDashboard(testName, ste p, tree));
35 reset();
36 start();
37 }); 45 });
38 } catch (e) { 46 });
39 reset();
40 }
41 });
42 47
43 asyncTest("heightChanged", 1, function() { 48 describe('heightChanged', function() {
44 var embeddedFlakinessDashboard = document.createElement('ct-embedded-flakiness -dashboard'); 49 beforeEach(function(done) {
50 embeddedFlakinessDashboard = document.createElement('ct-embedded-flakiness -dashboard');
45 51
46 function finishTest() { 52 setTimeout(done);
47 window.removeEventListener('message', finishTest); 53 });
48 var iframe = embeddedFlakinessDashboard.shadowRoot.querySelector('#iframe');
49 equal(iframe.style.height, "100px");
50 start();
51 }
52 window.addEventListener('message', finishTest);
53 54
54 requestAnimationFrame(function() { 55 it('should resize the iframe', function(done) {
55 window.postMessage({command: 'heightChanged', height: "100"}, '*'); 56 var finishTest = function() {
57 window.removeEventListener('message', finishTest);
58 var iframe = embeddedFlakinessDashboard.shadowRoot.querySelector('#ifram e');
59 assert.equal(iframe.style.height, '100px');
60 done();
61 };
62
63 window.addEventListener('message', finishTest);
64 window.postMessage({command: 'heightChanged', height: "100"}, '*');
65 });
56 }); 66 });
57 }); 67 });
58 68
59 })() 69 })()
60 </script> 70 </script>
OLDNEW
« no previous file with comments | « Tools/GardeningServer/ui/test/ct-commit-tests.html ('k') | Tools/GardeningServer/ui/test/ct-failure-analyzer-tests.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698