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

Side by Side Diff: chrome/test/data/webui/md_history/history_item_test.js

Issue 2112803002: MD History: Trim long item titles to reduce effect on performance (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test Created 4 years, 5 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
« no previous file with comments | « chrome/browser/resources/md_history/history_item.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_history/history_item.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698