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

Unified Diff: chrome/test/data/webui/util_test.html

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/webui/md_history/history_list_test.js ('k') | ui/webui/resources/js/util.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/util_test.html
diff --git a/chrome/test/data/webui/util_test.html b/chrome/test/data/webui/util_test.html
index 0c8c4eabf43456b81243084ea5de692a6e0c649b..8125db605262833800851da08512fc60a8b2bb2d 100644
--- a/chrome/test/data/webui/util_test.html
+++ b/chrome/test/data/webui/util_test.html
@@ -1,6 +1,9 @@
<!DOCTYPE html>
<html>
<body>
+<a id="file" href="file:///path/to/file">File</a>
+<a id="chrome" href="about:chrome">Chrome</a>
+<a href="about:blank"><b id="blank">Click me</b></a>
<script>
function testQuoteString() {
@@ -20,6 +23,22 @@ function testQuoteString() {
assertEquals(null, match);
}
+function testClickHandler() {
+ var clickArgs = null;
+ var oldSend = chrome.send;
+ chrome.send = function(message, args) {
+ assertEquals('navigateToUrl', message);
+ clickArgs = args;
+ };
+ $('file').click();
+ assertEquals('file:///path/to/file', clickArgs[0]);
+ $('chrome').click();
+ assertEquals('about:chrome', clickArgs[0]);
+ $('blank').click();
+ assertEquals('about:blank', clickArgs[0]);
+ chrome.send = oldSend;
+}
+
</script>
</body>
</html>
« no previous file with comments | « chrome/test/data/webui/md_history/history_list_test.js ('k') | ui/webui/resources/js/util.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698