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

Side by Side Diff: Tools/GardeningServer/ui/test/ct-embedded-flakiness-dashboard-tests.html

Issue 459463003: Convert moar Sheriff-o-Matic tests to Polymer. (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="../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 var assert = chai.assert; 12 var assert = chai.assert;
13 13
14 describe('ct-embedded-flakiness-dashboard', function() { 14 describe('ct-embedded-flakiness-dashboard', function() {
15 var embeddedFlakinessDashboard; 15 it('should point the iframe to the dashboard', function(done) {
16 var failure = new CTFailure('foo_tests', 'foo/bar.html');
17 var tree = "blink";
18 var embeddedFlakinessDashboard = document.createElement('ct-embedded-flakine ss-dashboard');
19 embeddedFlakinessDashboard.test = failure;
20 embeddedFlakinessDashboard.tree = tree;
16 21
17 describe('embedded flakiness dashboard UI', function() { 22 setTimeout(function() {
18 var oldUrlForEmbeddedFlakinessDashboard = ui.urlForEmbeddedFlakinessDashboar d;
19 var testName;
20 var step;
21 var tree;
22
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() {
43 var iframe = embeddedFlakinessDashboard.shadowRoot.querySelector('#iframe' ); 23 var iframe = embeddedFlakinessDashboard.shadowRoot.querySelector('#iframe' );
44 assert.equal(iframe.src, ui.urlForEmbeddedFlakinessDashboard(testName, ste p, tree)); 24 assert.equal(iframe.src, failure.embeddedFlakinessDashboardURL(tree));
25 done();
45 }); 26 });
46 }); 27 });
47 28
48 describe('heightChanged', function() { 29 it('should respond to heightChanged', function(done) {
49 beforeEach(function(done) { 30 var embeddedFlakinessDashboard = document.createElement('ct-embedded-flakine ss-dashboard');
50 embeddedFlakinessDashboard = document.createElement('ct-embedded-flakiness -dashboard');
51 31
52 setTimeout(done); 32 var finishTest = function() {
53 }); 33 window.removeEventListener('message', finishTest);
34 var iframe = embeddedFlakinessDashboard.shadowRoot.querySelector('#iframe' );
35 assert.equal(iframe.style.height, '100px');
36 done();
37 };
54 38
55 it('should resize the iframe', function(done) { 39 window.addEventListener('message', finishTest);
56 var finishTest = function() { 40 window.postMessage({command: 'heightChanged', height: "100"}, '*');
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 });
66 }); 41 });
67 }); 42 });
68 43
69 })() 44 })()
70 </script> 45 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698