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

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

Issue 2318643003: MD History: truncate title to 300 chars in C++ instead of JS (Closed)
Patch Set: more !android Created 4 years, 3 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/ui/webui/uber/uber_ui_browsertest.cc ('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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 MockInteractions.tap(items[1].$$('#bookmark-star')); 90 MockInteractions.tap(items[1].$$('#bookmark-star'));
91 91
92 // Check that focus is shifted to overflow menu icon. 92 // Check that focus is shifted to overflow menu icon.
93 assertEquals(items[1].root.activeElement, items[1].$['menu-button']); 93 assertEquals(items[1].root.activeElement, items[1].$['menu-button']);
94 // Check that all items matching this url are unstarred. 94 // Check that all items matching this url are unstarred.
95 assertEquals(element.historyData_[1].starred, false); 95 assertEquals(element.historyData_[1].starred, false);
96 assertEquals(element.historyData_[5].starred, false); 96 assertEquals(element.historyData_[5].starred, false);
97 }); 97 });
98 }); 98 });
99 99
100 test('long titles are trimmed', function() {
101 var item = document.createElement('history-item');
102 var longtitle = '0123456789'.repeat(100);
103 item.item =
104 createHistoryEntry('2016-06-30', 'http://example.com/' + longtitle);
105
106 var label = item.$$('history-searched-label');
107 assertEquals(TITLE_MAX_LENGTH, label.title.length);
108 });
109
110 teardown(function() { 100 teardown(function() {
111 element.historyData_ = []; 101 element.historyData_ = [];
112 element.searchedTerm = ''; 102 element.searchedTerm = '';
113 }); 103 });
114 }); 104 });
115 } 105 }
116 return { 106 return {
117 registerTests: registerTests 107 registerTests: registerTests
118 }; 108 };
119 }); 109 });
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/uber/uber_ui_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698