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

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

Issue 2186073003: [MD History] Close delete items dialog when a new query is initiated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@open_tabs_new_window
Patch Set: rebase Created 4 years, 4 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/list_container.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_list_test', function() { 5 cr.define('md_history.history_list_test', function() {
6 function registerTests() { 6 function registerTests() {
7 suite('history-list', function() { 7 suite('history-list', function() {
8 var app; 8 var app;
9 var element; 9 var element;
10 var toolbar; 10 var toolbar;
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 assertFalse(listContainer.$.dialog.open); 280 assertFalse(listContainer.$.dialog.open);
281 281
282 MockInteractions.pressAndReleaseKeyOn( 282 MockInteractions.pressAndReleaseKeyOn(
283 document.body, 8, '', 'Backspace'); 283 document.body, 8, '', 'Backspace');
284 assertTrue(listContainer.$.dialog.open); 284 assertTrue(listContainer.$.dialog.open);
285 285
286 MockInteractions.tap(listContainer.$$('.action-button')); 286 MockInteractions.tap(listContainer.$$('.action-button'));
287 }); 287 });
288 }); 288 });
289 289
290 test('delete dialog closed on url change', function() {
291 app.queryState_.queryingDisabled = false;
292 var listContainer = app.$.history;
293 app.historyResult(createHistoryInfo(), TEST_HISTORY_RESULTS);
294 app.historyResult(createHistoryInfo(), ADDITIONAL_RESULTS);
295 return flush().then(function() {
296 items = Polymer.dom(element.root).querySelectorAll('history-item');
297
298 MockInteractions.tap(items[2].$.checkbox);
299 MockInteractions.tap(app.$.toolbar.$$('#delete-button'));
300
301 // Confirmation dialog should appear.
302 assertTrue(listContainer.$.dialog.open);
303
304 app.set('queryState_.searchTerm', 'something else');
305 assertFalse(listContainer.$.dialog.open);
306 });
307 });
308
290 teardown(function() { 309 teardown(function() {
291 element.historyData_ = []; 310 element.historyData_ = [];
292 registerMessageCallback('removeVisits', this, undefined); 311 registerMessageCallback('removeVisits', this, undefined);
293 registerMessageCallback('queryHistory', this, undefined); 312 registerMessageCallback('queryHistory', this, function() {});
294 app.queryState_.queryingDisabled = true; 313 app.queryState_.queryingDisabled = true;
295 app.set('queryState_.searchTerm', ''); 314 app.set('queryState_.searchTerm', '');
296 return flush(); 315 return flush();
297 }); 316 });
298 }); 317 });
299 } 318 }
300 return { 319 return {
301 registerTests: registerTests 320 registerTests: registerTests
302 }; 321 };
303 }); 322 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_history/list_container.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698