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

Side by Side Diff: chrome/browser/ui/search/instant_page_unittest.cc

Issue 20501002: Adds paste function to searchbox api and handles paste event on fakebox (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 7 years, 4 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
« no previous file with comments | « chrome/browser/ui/search/instant_page.cc ('k') | chrome/browser/ui/search/instant_tab.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "chrome/browser/ui/search/search_tab_helper.h" 9 #include "chrome/browser/ui/search/search_tab_helper.h"
10 #include "chrome/common/chrome_switches.h" 10 #include "chrome/common/chrome_switches.h"
(...skipping 28 matching lines...) Expand all
39 const GURL& url)); 39 const GURL& url));
40 MOCK_METHOD2(FocusOmnibox, 40 MOCK_METHOD2(FocusOmnibox,
41 void(const content::WebContents* contents, 41 void(const content::WebContents* contents,
42 OmniboxFocusState state)); 42 OmniboxFocusState state));
43 MOCK_METHOD5(NavigateToURL, 43 MOCK_METHOD5(NavigateToURL,
44 void(const content::WebContents* contents, 44 void(const content::WebContents* contents,
45 const GURL& url, 45 const GURL& url,
46 content::PageTransition transition, 46 content::PageTransition transition,
47 WindowOpenDisposition disposition, 47 WindowOpenDisposition disposition,
48 bool is_search_type)); 48 bool is_search_type));
49 MOCK_METHOD2(PasteIntoOmnibox,
50 void(const content::WebContents* contents,
51 const string16& text));
49 MOCK_METHOD1(DeleteMostVisitedItem, void(const GURL& url)); 52 MOCK_METHOD1(DeleteMostVisitedItem, void(const GURL& url));
50 MOCK_METHOD1(UndoMostVisitedDeletion, void(const GURL& url)); 53 MOCK_METHOD1(UndoMostVisitedDeletion, void(const GURL& url));
51 MOCK_METHOD0(UndoAllMostVisitedDeletions, void()); 54 MOCK_METHOD0(UndoAllMostVisitedDeletions, void());
52 MOCK_METHOD1(InstantPageLoadFailed, void(content::WebContents* contents)); 55 MOCK_METHOD1(InstantPageLoadFailed, void(content::WebContents* contents));
53 }; 56 };
54 57
55 class FakePage : public InstantPage { 58 class FakePage : public InstantPage {
56 public: 59 public:
57 FakePage(Delegate* delegate, const std::string& instant_url, 60 FakePage(Delegate* delegate, const std::string& instant_url,
58 Profile* profile, bool is_incognito); 61 Profile* profile, bool is_incognito);
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 OMNIBOX_FOCUS_NONE, OMNIBOX_FOCUS_CHANGE_EXPLICIT); 349 OMNIBOX_FOCUS_NONE, OMNIBOX_FOCUS_CHANGE_EXPLICIT);
347 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxFocusChanged::ID)); 350 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxFocusChanged::ID));
348 351
349 page->sender()->SetInputInProgress(false); 352 page->sender()->SetInputInProgress(false);
350 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxSetInputInProgress::ID)); 353 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxSetInputInProgress::ID));
351 354
352 page->sender()->SendMostVisitedItems(std::vector<InstantMostVisitedItem>()); 355 page->sender()->SendMostVisitedItems(std::vector<InstantMostVisitedItem>());
353 EXPECT_FALSE(MessageWasSent( 356 EXPECT_FALSE(MessageWasSent(
354 ChromeViewMsg_SearchBoxMostVisitedItemsChanged::ID)); 357 ChromeViewMsg_SearchBoxMostVisitedItemsChanged::ID));
355 } 358 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/search/instant_page.cc ('k') | chrome/browser/ui/search/instant_tab.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698