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

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

Issue 2184123003: Use event path to detect if anchor has been clicked in WebUIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@close_dialog_on_query
Patch Set: add <b> test 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 | « no previous file | chrome/test/data/webui/util_test.html » ('j') | 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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 MockInteractions.tap(app.$.toolbar.$$('#delete-button')); 299 MockInteractions.tap(app.$.toolbar.$$('#delete-button'));
300 300
301 // Confirmation dialog should appear. 301 // Confirmation dialog should appear.
302 assertTrue(listContainer.$.dialog.open); 302 assertTrue(listContainer.$.dialog.open);
303 303
304 app.set('queryState_.searchTerm', 'something else'); 304 app.set('queryState_.searchTerm', 'something else');
305 assertFalse(listContainer.$.dialog.open); 305 assertFalse(listContainer.$.dialog.open);
306 }); 306 });
307 }); 307 });
308 308
309 test('clicking file:// url sends message to chrome', function(done) {
310 var fileURL = 'file:///home/myfile';
311 app.historyResult(createHistoryInfo(), [
312 createHistoryEntry('2016-03-15', fileURL),
313 ]);
314 flush().then(function() {
315 var items =
316 Polymer.dom(element.root).querySelectorAll('history-item');
317
318 registerMessageCallback('navigateToUrl', this, function(info) {
319 assertEquals(fileURL, info[0]);
320 done();
321 });
322
323 MockInteractions.tap(items[0].$.title);
324 });
325 });
326
309 teardown(function() { 327 teardown(function() {
310 element.historyData_ = []; 328 element.historyData_ = [];
311 registerMessageCallback('removeVisits', this, undefined); 329 registerMessageCallback('removeVisits', this, undefined);
312 registerMessageCallback('queryHistory', this, function() {}); 330 registerMessageCallback('queryHistory', this, function() {});
331 registerMessageCallback('navigateToUrl', this, undefined);
313 app.queryState_.queryingDisabled = true; 332 app.queryState_.queryingDisabled = true;
314 app.set('queryState_.searchTerm', ''); 333 app.set('queryState_.searchTerm', '');
315 return flush(); 334 return flush();
316 }); 335 });
317 }); 336 });
318 } 337 }
319 return { 338 return {
320 registerTests: registerTests 339 registerTests: registerTests
321 }; 340 };
322 }); 341 });
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/webui/util_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698