| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 cr.define('md_history.history_item_test', function() { | 5 cr.define('md_history.history_item_test', function() { |
| 6 function registerTests() { | 6 function registerTests() { |
| 7 suite('history-item', function() { | 7 suite('history-item', function() { |
| 8 var element; | 8 var element; |
| 9 var TEST_HISTORY_RESULTS; | 9 var TEST_HISTORY_RESULTS; |
| 10 var SEARCH_HISTORY_RESULTS; | 10 var SEARCH_HISTORY_RESULTS; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // Checks that a new time gap separator has been inserted. | 69 // Checks that a new time gap separator has been inserted. |
| 70 assertTrue(items[2].hasTimeGap); | 70 assertTrue(items[2].hasTimeGap); |
| 71 | 71 |
| 72 element.removeDeletedHistory_([element.historyData_[3]]); | 72 element.removeDeletedHistory_([element.historyData_[3]]); |
| 73 | 73 |
| 74 // Checks time gap separator is removed. | 74 // Checks time gap separator is removed. |
| 75 assertFalse(items[2].hasTimeGap); | 75 assertFalse(items[2].hasTimeGap); |
| 76 }); | 76 }); |
| 77 }); | 77 }); |
| 78 | 78 |
| 79 test('long titles are trimmed', function() { |
| 80 var item = document.createElement('history-item'); |
| 81 var longtitle = '0123456789'.repeat(100); |
| 82 item.item = |
| 83 createHistoryEntry('2016-06-30', 'http://example.com/' + longtitle); |
| 84 |
| 85 var label = item.$$('history-searched-label'); |
| 86 assertEquals(TITLE_MAX_LENGTH, label.title.length); |
| 87 }); |
| 88 |
| 79 teardown(function() { | 89 teardown(function() { |
| 80 element.historyData_ = []; | 90 element.historyData_ = []; |
| 81 element.searchedTerm = ''; | 91 element.searchedTerm = ''; |
| 82 }); | 92 }); |
| 83 }); | 93 }); |
| 84 } | 94 } |
| 85 return { | 95 return { |
| 86 registerTests: registerTests | 96 registerTests: registerTests |
| 87 }; | 97 }; |
| 88 }); | 98 }); |
| OLD | NEW |