| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 checkDataFromEventFiring(fakeNonBlockingIssueOne, | 159 checkDataFromEventFiring(fakeNonBlockingIssueOne, |
| 160 data, false); | 160 data, false); |
| 161 done(); | 161 done(); |
| 162 }); | 162 }); |
| 163 MockInteractions.tap(banner.$['opt-button']); | 163 MockInteractions.tap(banner.$['opt-button']); |
| 164 }); | 164 }); |
| 165 | 165 |
| 166 // Tests the issue text. While the UI will show only the blocking or | 166 // Tests the issue text. While the UI will show only the blocking or |
| 167 // non-blocking interface, the issue's info will be set if specified. | 167 // non-blocking interface, the issue's info will be set if specified. |
| 168 test('issue text', function() { | 168 test('issue text', function() { |
| 169 // |issue| is null. Title text should be empty. | 169 // |issue| is initially undefined. |
| 170 assertEquals(null, banner.issue); | 170 assertEquals(undefined, banner.issue); |
| 171 checkIssueText(banner.issue); | |
| 172 | 171 |
| 173 // Set |issue| to be a blocking issue. Title text should be updated. | 172 // Set |issue| to be a blocking issue. Title text should be updated. |
| 174 banner.issue = fakeBlockingIssueOne; | 173 banner.issue = fakeBlockingIssueOne; |
| 175 checkIssueText(banner.issue); | 174 checkIssueText(banner.issue); |
| 176 | 175 |
| 177 // Set |issue| to be a non-blocking issue. Title text should be | 176 // Set |issue| to be a non-blocking issue. Title text should be |
| 178 // updated. | 177 // updated. |
| 179 banner.issue = fakeNonBlockingIssueOne; | 178 banner.issue = fakeNonBlockingIssueOne; |
| 180 checkIssueText(banner.issue); | 179 checkIssueText(banner.issue); |
| 181 }); | 180 }); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 199 banner.issue = fakeNonBlockingIssueTwo; | 198 banner.issue = fakeNonBlockingIssueTwo; |
| 200 checkButtonVisibility(fakeNonBlockingIssueTwo.secondaryActionType); | 199 checkButtonVisibility(fakeNonBlockingIssueTwo.secondaryActionType); |
| 201 }); | 200 }); |
| 202 }); | 201 }); |
| 203 } | 202 } |
| 204 | 203 |
| 205 return { | 204 return { |
| 206 registerTests: registerTests, | 205 registerTests: registerTests, |
| 207 }; | 206 }; |
| 208 }); | 207 }); |
| OLD | NEW |