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

Unified Diff: chrome/test/data/local_ntp_browsertest.js

Issue 178253008: Redoing Issue 36073011: Allowing file:/// in Instant Extended's Most Visited links. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unused consts. Created 6 years, 9 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
Index: chrome/test/data/local_ntp_browsertest.js
diff --git a/chrome/test/data/local_ntp_browsertest.js b/chrome/test/data/local_ntp_browsertest.js
index 57f5b7ba72a18ae2bfdfd256f0f63378ecafad6d..a7b6640cd5818a77e862d4e0cb4bd7cdd00ceb7a 100644
--- a/chrome/test/data/local_ntp_browsertest.js
+++ b/chrome/test/data/local_ntp_browsertest.js
@@ -87,3 +87,29 @@ 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 provider = 'foobar';
+ var link = createMostVisitedLink(params, href, title, text, provider);
+
+ link.click();
+
+ ntpHandle.navigateContentWindow = originalNavigateContentWindow;
+ assert(navigateContentWindowCalls > 0);
+}

Powered by Google App Engine
This is Rietveld 408576698