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

Unified Diff: chrome/browser/ui/search/instant_page_unittest.cc

Issue 14660022: Move most visited item state info from InstantController to InstantService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 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/ui/search/instant_page.cc ('k') | chrome/common/instant_restricted_id_cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/search/instant_page_unittest.cc
diff --git a/chrome/browser/ui/search/instant_page_unittest.cc b/chrome/browser/ui/search/instant_page_unittest.cc
index 797d9d2d96e6e4fde63e32e430ea4227a0570467..592c510c7e012719367211e24dd1ad191098f82d 100644
--- a/chrome/browser/ui/search/instant_page_unittest.cc
+++ b/chrome/browser/ui/search/instant_page_unittest.cc
@@ -49,10 +49,8 @@ class FakePageDelegate : public InstantPage::Delegate {
content::PageTransition transition,
WindowOpenDisposition disposition,
bool is_search_type));
- MOCK_METHOD1(DeleteMostVisitedItem,
- void(InstantRestrictedID most_visited_item_id));
- MOCK_METHOD1(UndoMostVisitedDeletion,
- void(InstantRestrictedID most_visited_item_id));
+ MOCK_METHOD1(DeleteMostVisitedItem, void(const GURL& url));
+ MOCK_METHOD1(UndoMostVisitedDeletion, void(const GURL& url));
MOCK_METHOD0(UndoAllMostVisitedDeletions, void());
MOCK_METHOD1(InstantPageLoadFailed, void(content::WebContents* contents));
};
@@ -113,3 +111,32 @@ TEST_F(InstantPageTest, DetermineIfPageSupportsInstant_NonLocal) {
ASSERT_TRUE(message != NULL);
EXPECT_EQ(web_contents()->GetRoutingID(), message->routing_id());
}
+
+TEST_F(InstantPageTest, DispatchRequestToDeleteMostVisitedItem) {
+ page.reset(new FakePage(&delegate, ""));
+ page->SetContents(web_contents());
+ GURL item_url("www.foo.com");
+ EXPECT_CALL(delegate, DeleteMostVisitedItem(item_url)).Times(1);
+ EXPECT_TRUE(page->OnMessageReceived(
+ ChromeViewHostMsg_SearchBoxDeleteMostVisitedItem(rvh()->GetRoutingID(),
+ item_url)));
+}
+
+TEST_F(InstantPageTest, DispatchRequestToUndoMostVisitedDeletion) {
+ page.reset(new FakePage(&delegate, ""));
+ page->SetContents(web_contents());
+ GURL item_url("www.foo.com");
+ EXPECT_CALL(delegate, UndoMostVisitedDeletion(item_url)).Times(1);
+ EXPECT_TRUE(page->OnMessageReceived(
+ ChromeViewHostMsg_SearchBoxUndoMostVisitedDeletion(rvh()->GetRoutingID(),
+ item_url)));
+}
+
+TEST_F(InstantPageTest, DispatchRequestToUndoAllMostVisitedDeletions) {
+ page.reset(new FakePage(&delegate, ""));
+ page->SetContents(web_contents());
+ EXPECT_CALL(delegate, UndoAllMostVisitedDeletions()).Times(1);
+ EXPECT_TRUE(page->OnMessageReceived(
+ ChromeViewHostMsg_SearchBoxUndoAllMostVisitedDeletions(
+ rvh()->GetRoutingID())));
+}
« no previous file with comments | « chrome/browser/ui/search/instant_page.cc ('k') | chrome/common/instant_restricted_id_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698