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

Side by Side 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: '' 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/search/instant_page.h" 5 #include "chrome/browser/ui/search/instant_page.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "chrome/common/render_messages.h" 8 #include "chrome/common/render_messages.h"
9 #include "chrome/common/url_constants.h" 9 #include "chrome/common/url_constants.h"
10 #include "chrome/test/base/chrome_render_view_host_test_harness.h" 10 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
(...skipping 29 matching lines...) Expand all
40 int height, 40 int height,
41 InstantSizeUnits units)); 41 InstantSizeUnits units));
42 MOCK_METHOD2(FocusOmnibox, 42 MOCK_METHOD2(FocusOmnibox,
43 void(const content::WebContents* contents, 43 void(const content::WebContents* contents,
44 OmniboxFocusState state)); 44 OmniboxFocusState state));
45 MOCK_METHOD4(NavigateToURL, 45 MOCK_METHOD4(NavigateToURL,
46 void(const content::WebContents* contents, 46 void(const content::WebContents* contents,
47 const GURL& url, 47 const GURL& url,
48 content::PageTransition transition, 48 content::PageTransition transition,
49 WindowOpenDisposition disposition)); 49 WindowOpenDisposition disposition));
50 MOCK_METHOD1(DeleteMostVisitedItem, 50 MOCK_METHOD1(DeleteMostVisitedItem, void(const GURL& item_url));
Jered 2013/05/21 20:18:21 It's a little pedantic, but you could test that On
kmadhusu 2013/05/23 18:26:22 Done.
51 void(InstantRestrictedID most_visited_item_id));
52 MOCK_METHOD1(UndoMostVisitedDeletion, 51 MOCK_METHOD1(UndoMostVisitedDeletion,
53 void(InstantRestrictedID most_visited_item_id)); 52 void(const GURL& most_visited_item_url));
54 MOCK_METHOD0(UndoAllMostVisitedDeletions, void()); 53 MOCK_METHOD0(UndoAllMostVisitedDeletions, void());
55 MOCK_METHOD1(InstantPageLoadFailed, void(content::WebContents* contents)); 54 MOCK_METHOD1(InstantPageLoadFailed, void(content::WebContents* contents));
56 }; 55 };
57 56
58 class FakePage : public InstantPage { 57 class FakePage : public InstantPage {
59 public: 58 public:
60 FakePage(Delegate* delegate, const std::string& instant_url) 59 FakePage(Delegate* delegate, const std::string& instant_url)
61 : InstantPage(delegate, instant_url) { 60 : InstantPage(delegate, instant_url) {
62 } 61 }
63 virtual ~FakePage() { 62 virtual ~FakePage() {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 page->SetContents(web_contents()); 103 page->SetContents(web_contents());
105 NavigateAndCommit(GURL("http://example.com/")); 104 NavigateAndCommit(GURL("http://example.com/"));
106 EXPECT_FALSE(page->IsLocal()); 105 EXPECT_FALSE(page->IsLocal());
107 process()->sink().ClearMessages(); 106 process()->sink().ClearMessages();
108 page->DetermineIfPageSupportsInstant(); 107 page->DetermineIfPageSupportsInstant();
109 const IPC::Message* message = process()->sink().GetFirstMessageMatching( 108 const IPC::Message* message = process()->sink().GetFirstMessageMatching(
110 ChromeViewMsg_DetermineIfPageSupportsInstant::ID); 109 ChromeViewMsg_DetermineIfPageSupportsInstant::ID);
111 ASSERT_TRUE(message != NULL); 110 ASSERT_TRUE(message != NULL);
112 EXPECT_EQ(web_contents()->GetRoutingID(), message->routing_id()); 111 EXPECT_EQ(web_contents()->GetRoutingID(), message->routing_id());
113 } 112 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698