| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 const GURL& url, | 42 const GURL& url, |
| 43 ui::PageTransition transition, | 43 ui::PageTransition transition, |
| 44 WindowOpenDisposition disposition, | 44 WindowOpenDisposition disposition, |
| 45 bool is_search_type)); | 45 bool is_search_type)); |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 } // namespace | 48 } // namespace |
| 49 | 49 |
| 50 class InstantPageTest : public ChromeRenderViewHostTestHarness { | 50 class InstantPageTest : public ChromeRenderViewHostTestHarness { |
| 51 public: | 51 public: |
| 52 virtual void SetUp() OVERRIDE; | 52 virtual void SetUp() override; |
| 53 | 53 |
| 54 bool MessageWasSent(uint32 id) { | 54 bool MessageWasSent(uint32 id) { |
| 55 return process()->sink().GetFirstMessageMatching(id) != NULL; | 55 return process()->sink().GetFirstMessageMatching(id) != NULL; |
| 56 } | 56 } |
| 57 | 57 |
| 58 scoped_ptr<InstantPage> page; | 58 scoped_ptr<InstantPage> page; |
| 59 FakePageDelegate delegate; | 59 FakePageDelegate delegate; |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 void InstantPageTest::SetUp() { | 62 void InstantPageTest::SetUp() { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 .Times(1); | 145 .Times(1); |
| 146 | 146 |
| 147 // Assume the page supports instant. Invoke the message reply handler to make | 147 // Assume the page supports instant. Invoke the message reply handler to make |
| 148 // sure the InstantPage is notified about the instant support state. | 148 // sure the InstantPage is notified about the instant support state. |
| 149 const content::NavigationEntry* entry = | 149 const content::NavigationEntry* entry = |
| 150 web_contents()->GetController().GetLastCommittedEntry(); | 150 web_contents()->GetController().GetLastCommittedEntry(); |
| 151 EXPECT_TRUE(entry); | 151 EXPECT_TRUE(entry); |
| 152 SearchTabHelper::FromWebContents(web_contents())->InstantSupportChanged(true); | 152 SearchTabHelper::FromWebContents(web_contents())->InstantSupportChanged(true); |
| 153 EXPECT_TRUE(page->supports_instant()); | 153 EXPECT_TRUE(page->supports_instant()); |
| 154 } | 154 } |
| OLD | NEW |