OLD | NEW |
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 25 matching lines...) Expand all Loading... |
36 void(const content::WebContents* contents)); | 36 void(const content::WebContents* contents)); |
37 MOCK_METHOD2(InstantPageAboutToNavigateMainFrame, | 37 MOCK_METHOD2(InstantPageAboutToNavigateMainFrame, |
38 void(const content::WebContents* contents, | 38 void(const content::WebContents* contents, |
39 const GURL& url)); | 39 const GURL& url)); |
40 MOCK_METHOD5(NavigateToURL, | 40 MOCK_METHOD5(NavigateToURL, |
41 void(const content::WebContents* contents, | 41 void(const content::WebContents* contents, |
42 const GURL& url, | 42 const GURL& url, |
43 content::PageTransition transition, | 43 content::PageTransition transition, |
44 WindowOpenDisposition disposition, | 44 WindowOpenDisposition disposition, |
45 bool is_search_type)); | 45 bool is_search_type)); |
46 MOCK_METHOD1(InstantPageLoadFailed, void(content::WebContents* contents)); | |
47 }; | 46 }; |
48 | 47 |
49 } // namespace | 48 } // namespace |
50 | 49 |
51 class InstantPageTest : public ChromeRenderViewHostTestHarness { | 50 class InstantPageTest : public ChromeRenderViewHostTestHarness { |
52 public: | 51 public: |
53 virtual void SetUp() OVERRIDE; | 52 virtual void SetUp() OVERRIDE; |
54 | 53 |
55 bool MessageWasSent(uint32 id) { | 54 bool MessageWasSent(uint32 id) { |
56 return process()->sink().GetFirstMessageMatching(id) != NULL; | 55 return process()->sink().GetFirstMessageMatching(id) != NULL; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 EXPECT_TRUE(MessageWasSent(ChromeViewMsg_SearchBoxMarginChange::ID)); | 164 EXPECT_TRUE(MessageWasSent(ChromeViewMsg_SearchBoxMarginChange::ID)); |
166 | 165 |
167 // Incognito pages should not get any others. | 166 // Incognito pages should not get any others. |
168 page->sender()->FocusChanged( | 167 page->sender()->FocusChanged( |
169 OMNIBOX_FOCUS_NONE, OMNIBOX_FOCUS_CHANGE_EXPLICIT); | 168 OMNIBOX_FOCUS_NONE, OMNIBOX_FOCUS_CHANGE_EXPLICIT); |
170 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxFocusChanged::ID)); | 169 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxFocusChanged::ID)); |
171 | 170 |
172 page->sender()->SetInputInProgress(false); | 171 page->sender()->SetInputInProgress(false); |
173 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxSetInputInProgress::ID)); | 172 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxSetInputInProgress::ID)); |
174 } | 173 } |
OLD | NEW |