summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authorpedrosimonetti@chromium.org <pedrosimonetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-13 03:50:33 +0000
committerpedrosimonetti@chromium.org <pedrosimonetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-13 03:50:33 +0000
commitdb3e675812365f7c4f657f84b65ba94ad7684754 (patch)
tree26119d58be1d12223b30ccdcc118948c930c4504 /chrome/test
parentca11b86723affd154c6b662f1b50bcd64375d5d5 (diff)
downloadchromium_src-db3e675812365f7c4f657f84b65ba94ad7684754.zip
chromium_src-db3e675812365f7c4f657f84b65ba94ad7684754.tar.gz
chromium_src-db3e675812365f7c4f657f84b65ba94ad7684754.tar.bz2
Allowing file:/// in Instant Extended's Most Visited links.
BUG=306137 Review URL: https://codereview.chromium.org/36073011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234734 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/data/local_ntp_browsertest.html1
-rw-r--r--chrome/test/data/local_ntp_browsertest.js25
2 files changed, 26 insertions, 0 deletions
diff --git a/chrome/test/data/local_ntp_browsertest.html b/chrome/test/data/local_ntp_browsertest.html
index 4b73647..59d6865 100644
--- a/chrome/test/data/local_ntp_browsertest.html
+++ b/chrome/test/data/local_ntp_browsertest.html
@@ -7,6 +7,7 @@
<script>window.localNTPUnitTest = true;</script>
<script src="chrome-search://local-ntp/config.js"></script>
<script src="chrome-search://local-ntp/local-ntp.js"></script>
+ <script src="chrome-search://most-visited/util.js"></script>
<link rel="stylesheet" href="chrome-search://local-ntp/local-ntp.css"></link>
<script src="local_ntp_browsertest.js"></script>
<template id="local-ntp-body">
diff --git a/chrome/test/data/local_ntp_browsertest.js b/chrome/test/data/local_ntp_browsertest.js
index 57f5b7b..e9eaa74 100644
--- a/chrome/test/data/local_ntp_browsertest.js
+++ b/chrome/test/data/local_ntp_browsertest.js
@@ -87,3 +87,28 @@ function testDoesNotShowFakeboxIfNotGoogle() {
assert(!$('fakebox'));
assert(!$('logo'));
}
+
+
+/**
+ * Tests that clicking on a Most Visited link calls navigateContentWindow.
+ */
+function testMostVisitedLinkCallsNavigateContentWindow() {
+ var ntpHandle = chrome.embeddedSearch.newTabPage;
+ var originalNavigateContentWindow = ntpHandle.navigateContentWindow;
+
+ var navigateContentWindowCalls = 0;
+ ntpHandle.navigateContentWindow = function() {
+ navigateContentWindowCalls++;
+ }
+
+ var params = {};
+ var href = 'file:///some/local/file';
+ var title = 'Title';
+ var text = 'text';
+ var link = createMostVisitedLink(params, href, title, text);
+
+ link.click();
+
+ ntpHandle.navigateContentWindow = originalNavigateContentWindow;
+ assert(navigateContentWindowCalls > 0);
+}