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

Unified 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 test to util_test.html 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/data/webui/util_test.html » ('j') | chrome/test/data/webui/util_test.html » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/md_history/history_list_test.js
diff --git a/chrome/test/data/webui/md_history/history_list_test.js b/chrome/test/data/webui/md_history/history_list_test.js
index f6c913babf426384bae2a4d68f7edf8b6bc45fb5..e83a9dd27d1dc13b72b2dcc5f3243eb4d1397fae 100644
--- a/chrome/test/data/webui/md_history/history_list_test.js
+++ b/chrome/test/data/webui/md_history/history_list_test.js
@@ -267,10 +267,29 @@ cr.define('md_history.history_list_test', function() {
});
});
+ test('clicking file:// url sends message to chrome', function(done) {
+ var fileURL = 'file:///home/myfile';
+ app.historyResult(createHistoryInfo(), [
+ createHistoryEntry('2016-03-15', fileURL),
+ ]);
+ flush().then(function() {
+ var items =
+ Polymer.dom(element.root).querySelectorAll('history-item');
+
+ registerMessageCallback('navigateToUrl', this, function(info) {
Dan Beam 2016/08/02 06:02:43 registerMessageCallback() is a bummer. didn't kno
calamity 2016/08/08 05:06:43 Any alternatives?
Dan Beam 2016/08/08 21:27:59 don't call chrome.send() directly from your code.
+ assertEquals(fileURL, info[0]);
+ done();
+ });
+
+ MockInteractions.tap(items[0].$.title);
+ });
+ });
+
teardown(function() {
element.historyData_ = [];
registerMessageCallback('removeVisits', this, undefined);
registerMessageCallback('queryHistory', this, function() {});
+ registerMessageCallback('navigateToUrl', this, function() {});
Dan Beam 2016/08/02 06:02:43 why is this necessary?
calamity 2016/08/08 05:06:43 undefined would work here too. We need to tear dow
app.queryState_.queryingDisabled = true;
app.set('queryState_.searchTerm', '');
return flush();
« no previous file with comments | « no previous file | chrome/test/data/webui/util_test.html » ('j') | chrome/test/data/webui/util_test.html » ('J')

Powered by Google App Engine
This is Rietveld 408576698