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

Unified Diff: chrome/browser/search/instant_service_unittest.cc

Issue 1908363002: Nuke chrome.embeddedeseach.newTabPage.navigateContentWindow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 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/browser/search/instant_service.cc ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search/instant_service_unittest.cc
diff --git a/chrome/browser/search/instant_service_unittest.cc b/chrome/browser/search/instant_service_unittest.cc
index 82fbd3714a5338f6f88291a7a619abce5f772041..e24ab1a92ef3045230f50d0abaeb81d05eedb07f 100644
--- a/chrome/browser/search/instant_service_unittest.cc
+++ b/chrome/browser/search/instant_service_unittest.cc
@@ -184,45 +184,3 @@ TEST_F(InstantServiceTest, GetSuggestionFromClientSide) {
ASSERT_EQ(1, (int)items.size());
ASSERT_FALSE(items[0].is_server_side_suggestion);
}
-
-TEST_F(InstantServiceTest, IsValidURLForNavigation) {
- // chrome:// URLs should never appear in the most visited items list, but even
- // if it does, deny navigation anyway.
- InstantMostVisitedItem settings_item;
- settings_item.url = GURL("chrome://settings");
- most_visited_items().push_back(settings_item);
- EXPECT_FALSE(instant_service_->IsValidURLForNavigation(settings_item.url));
-
- // If a chrome-extension:// URL appears in the most visited items list, allow
- // navigation to it.
- InstantMostVisitedItem extension_item;
- extension_item.url = GURL("chrome-extension://awesome");
- most_visited_items().push_back(extension_item);
- EXPECT_TRUE(instant_service_->IsValidURLForNavigation(extension_item.url));
-
- // The renderer filters out javascript:// URLs so we should never receive a
- // request to navigate to one. But if we do, deny it.
- InstantMostVisitedItem js_item;
- js_item.url = GURL("javascript:'moo'");
- most_visited_items().push_back(js_item);
- EXPECT_FALSE(instant_service_->IsValidURLForNavigation(js_item.url));
-
- // Normal case: a request for a web safe URL in the most visited items should
- // be allowed.
- InstantMostVisitedItem example_item;
- example_item.url = GURL("https://example.com");
- most_visited_items().push_back(example_item);
- EXPECT_TRUE(instant_service_->IsValidURLForNavigation(example_item.url));
-
- // Normal case: a request for a web safe URL in the most visited items should
- // be allowed as well.
- InstantMostVisitedItem chromium_item;
- chromium_item.url = GURL("https://chromium.org");
- suggestions_items().push_back(chromium_item);
- EXPECT_TRUE(instant_service_->IsValidURLForNavigation(chromium_item.url));
-
- // http://chromium.org is web safe, but not in |suggestions_items_| or
- // |most_visited_items_|, so it should be denied.
- EXPECT_FALSE(
- instant_service_->IsValidURLForNavigation(GURL("http://chromium.org")));
-}
« no previous file with comments | « chrome/browser/search/instant_service.cc ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698