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

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

Issue 2097003002: MD History: Remove bookmark when clicking bookmark star (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move to browserService and add a 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/ui/webui/md_history_ui.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 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('remove bookmarks', function() {
80 element.addNewResults(TEST_HISTORY_RESULTS);
81 return flush().then(function() {
82 element.historyData_[1].starred = true;
83 element.historyData_[5].starred = true;
84
85 items = Polymer.dom(element.root).querySelectorAll('history-item');
86 MockInteractions.tap(items[1].$$('#bookmark-star'));
87
88 assertEquals(element.historyData_[1].starred, false);
89 assertEquals(element.historyData_[5].starred, false);
90 return flush();
tsergeant 2016/07/01 04:27:10 Nit: You shouldn't need this line here. return fl
lshang 2016/07/01 06:12:07 Done.
91 });
92 });
93
79 test('long titles are trimmed', function() { 94 test('long titles are trimmed', function() {
80 var item = document.createElement('history-item'); 95 var item = document.createElement('history-item');
81 var longtitle = '0123456789'.repeat(100); 96 var longtitle = '0123456789'.repeat(100);
82 item.item = 97 item.item =
83 createHistoryEntry('2016-06-30', 'http://example.com/' + longtitle); 98 createHistoryEntry('2016-06-30', 'http://example.com/' + longtitle);
84 99
85 var label = item.$$('history-searched-label'); 100 var label = item.$$('history-searched-label');
86 assertEquals(TITLE_MAX_LENGTH, label.title.length); 101 assertEquals(TITLE_MAX_LENGTH, label.title.length);
87 }); 102 });
88 103
89 teardown(function() { 104 teardown(function() {
90 element.historyData_ = []; 105 element.historyData_ = [];
91 element.searchedTerm = ''; 106 element.searchedTerm = '';
92 }); 107 });
93 }); 108 });
94 } 109 }
95 return { 110 return {
96 registerTests: registerTests 111 registerTests: registerTests
97 }; 112 };
98 }); 113 });
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/md_history_ui.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698