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)); |
46 }; | 47 }; |
47 | 48 |
48 } // namespace | 49 } // namespace |
49 | 50 |
50 class InstantPageTest : public ChromeRenderViewHostTestHarness { | 51 class InstantPageTest : public ChromeRenderViewHostTestHarness { |
51 public: | 52 public: |
52 virtual void SetUp() OVERRIDE; | 53 virtual void SetUp() OVERRIDE; |
53 | 54 |
54 bool MessageWasSent(uint32 id) { | 55 bool MessageWasSent(uint32 id) { |
55 return process()->sink().GetFirstMessageMatching(id) != NULL; | 56 return process()->sink().GetFirstMessageMatching(id) != NULL; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 EXPECT_TRUE(MessageWasSent(ChromeViewMsg_SearchBoxMarginChange::ID)); | 165 EXPECT_TRUE(MessageWasSent(ChromeViewMsg_SearchBoxMarginChange::ID)); |
165 | 166 |
166 // Incognito pages should not get any others. | 167 // Incognito pages should not get any others. |
167 page->sender()->FocusChanged( | 168 page->sender()->FocusChanged( |
168 OMNIBOX_FOCUS_NONE, OMNIBOX_FOCUS_CHANGE_EXPLICIT); | 169 OMNIBOX_FOCUS_NONE, OMNIBOX_FOCUS_CHANGE_EXPLICIT); |
169 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxFocusChanged::ID)); | 170 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxFocusChanged::ID)); |
170 | 171 |
171 page->sender()->SetInputInProgress(false); | 172 page->sender()->SetInputInProgress(false); |
172 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxSetInputInProgress::ID)); | 173 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxSetInputInProgress::ID)); |
173 } | 174 } |
OLD | NEW |