| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** @fileoverview Suite of tests for issue-banner. */ | 5 /** @fileoverview Suite of tests for issue-banner. */ |
| 6 cr.define('issue_banner', function() { | 6 cr.define('issue_banner', function() { |
| 7 function registerTests() { | 7 function registerTests() { |
| 8 suite('IssueBanner', function() { | 8 suite('IssueBanner', function() { |
| 9 /** | 9 /** |
| 10 * Issue Banner created before each test. | 10 * Issue Banner created before each test. |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 }); | 92 }); |
| 93 | 93 |
| 94 // Initialize an issue-banner before each test. | 94 // Initialize an issue-banner before each test. |
| 95 setup(function(done) { | 95 setup(function(done) { |
| 96 PolymerTest.clearBody(); | 96 PolymerTest.clearBody(); |
| 97 banner = document.createElement('issue-banner'); | 97 banner = document.createElement('issue-banner'); |
| 98 document.body.appendChild(banner); | 98 document.body.appendChild(banner); |
| 99 | 99 |
| 100 // Initialize issues. | 100 // Initialize issues. |
| 101 fakeBlockingIssueOne = new media_router.Issue( | 101 fakeBlockingIssueOne = new media_router.Issue( |
| 102 'issue id 1', 'Issue Title 1', 'Issue Message 1', 0, 1, | 102 1, 'Issue Title 1', 'Issue Message 1', 0, 1, |
| 103 'route id 1', true, 1234); | 103 'route id 1', true, 1234); |
| 104 fakeBlockingIssueTwo = new media_router.Issue( | 104 fakeBlockingIssueTwo = new media_router.Issue( |
| 105 'issue id 2', 'Issue Title 2', 'Issue Message 2', 0, undefined, | 105 2, 'Issue Title 2', 'Issue Message 2', 0, undefined, |
| 106 'route id 2', true, 1234); | 106 'route id 2', true, 1234); |
| 107 fakeNonBlockingIssueOne = new media_router.Issue( | 107 fakeNonBlockingIssueOne = new media_router.Issue( |
| 108 'issue id 3', 'Issue Title 3', 'Issue Message 3', 0, 1, | 108 3, 'Issue Title 3', 'Issue Message 3', 0, 1, |
| 109 'route id 3', false, 1234); | 109 'route id 3', false, 1234); |
| 110 fakeNonBlockingIssueTwo = new media_router.Issue( | 110 fakeNonBlockingIssueTwo = new media_router.Issue( |
| 111 'issue id 4', 'Issue Title 4', 'Issue Message 4', 0, undefined, | 111 4, 'Issue Title 4', 'Issue Message 4', 0, undefined, |
| 112 'route id 4', false, 1234); | 112 'route id 4', false, 1234); |
| 113 | 113 |
| 114 // Allow for the issue banner to be created and attached. | 114 // Allow for the issue banner to be created and attached. |
| 115 setTimeout(done); | 115 setTimeout(done); |
| 116 }); | 116 }); |
| 117 | 117 |
| 118 // Tests for 'issue-action-click' event firing when a blocking issue | 118 // Tests for 'issue-action-click' event firing when a blocking issue |
| 119 // default action is clicked. | 119 // default action is clicked. |
| 120 test('blocking issue default action click', function(done) { | 120 test('blocking issue default action click', function(done) { |
| 121 banner.issue = fakeBlockingIssueOne; | 121 banner.issue = fakeBlockingIssueOne; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 banner.issue = fakeNonBlockingIssueTwo; | 198 banner.issue = fakeNonBlockingIssueTwo; |
| 199 checkButtonVisibility(fakeNonBlockingIssueTwo.secondaryActionType); | 199 checkButtonVisibility(fakeNonBlockingIssueTwo.secondaryActionType); |
| 200 }); | 200 }); |
| 201 }); | 201 }); |
| 202 } | 202 } |
| 203 | 203 |
| 204 return { | 204 return { |
| 205 registerTests: registerTests, | 205 registerTests: registerTests, |
| 206 }; | 206 }; |
| 207 }); | 207 }); |
| OLD | NEW |