| Index: chrome/browser/ui/search/instant_tab_unittest.cc
|
| diff --git a/chrome/browser/ui/search/instant_page_unittest.cc b/chrome/browser/ui/search/instant_tab_unittest.cc
|
| similarity index 83%
|
| rename from chrome/browser/ui/search/instant_page_unittest.cc
|
| rename to chrome/browser/ui/search/instant_tab_unittest.cc
|
| index c028d778bdfbccfa9ff7fa8a867257a637b27ee7..9161b0d3611a11318750d5ccf5cdcd7f32eabb3a 100644
|
| --- a/chrome/browser/ui/search/instant_page_unittest.cc
|
| +++ b/chrome/browser/ui/search/instant_tab_unittest.cc
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "chrome/browser/ui/search/instant_page.h"
|
| +#include "chrome/browser/ui/search/instant_tab.h"
|
|
|
| #include <stdint.h>
|
|
|
| @@ -27,7 +27,7 @@ class Profile;
|
|
|
| namespace {
|
|
|
| -class FakePageDelegate : public InstantPage::Delegate {
|
| +class FakePageDelegate : public InstantTab::Delegate {
|
| public:
|
| virtual ~FakePageDelegate() {
|
| }
|
| @@ -35,9 +35,9 @@ class FakePageDelegate : public InstantPage::Delegate {
|
| MOCK_METHOD2(InstantSupportDetermined,
|
| void(const content::WebContents* contents,
|
| bool supports_instant));
|
| - MOCK_METHOD1(InstantPageRenderProcessGone,
|
| + MOCK_METHOD1(InstantTabRenderProcessGone,
|
| void(const content::WebContents* contents));
|
| - MOCK_METHOD2(InstantPageAboutToNavigateMainFrame,
|
| + MOCK_METHOD2(InstantTabAboutToNavigateMainFrame,
|
| void(const content::WebContents* contents,
|
| const GURL& url));
|
| MOCK_METHOD5(NavigateToURL,
|
| @@ -50,7 +50,7 @@ class FakePageDelegate : public InstantPage::Delegate {
|
|
|
| } // namespace
|
|
|
| -class InstantPageTest : public ChromeRenderViewHostTestHarness {
|
| +class InstantTabTest : public ChromeRenderViewHostTestHarness {
|
| public:
|
| void SetUp() override;
|
|
|
| @@ -58,17 +58,17 @@ class InstantPageTest : public ChromeRenderViewHostTestHarness {
|
| return process()->sink().GetFirstMessageMatching(id) != NULL;
|
| }
|
|
|
| - std::unique_ptr<InstantPage> page;
|
| + std::unique_ptr<InstantTab> page;
|
| FakePageDelegate delegate;
|
| };
|
|
|
| -void InstantPageTest::SetUp() {
|
| +void InstantTabTest::SetUp() {
|
| ChromeRenderViewHostTestHarness::SetUp();
|
| SearchTabHelper::CreateForWebContents(web_contents());
|
| }
|
|
|
| -TEST_F(InstantPageTest, IsLocal) {
|
| - page.reset(new InstantPage(&delegate));
|
| +TEST_F(InstantTabTest, IsLocal) {
|
| + page.reset(new InstantTab(&delegate));
|
| EXPECT_FALSE(page->supports_instant());
|
| EXPECT_FALSE(page->IsLocal());
|
| page->SetContents(web_contents());
|
| @@ -78,8 +78,8 @@ TEST_F(InstantPageTest, IsLocal) {
|
| EXPECT_FALSE(page->IsLocal());
|
| }
|
|
|
| -TEST_F(InstantPageTest, DetermineIfPageSupportsInstant_Local) {
|
| - page.reset(new InstantPage(&delegate));
|
| +TEST_F(InstantTabTest, DetermineIfPageSupportsInstant_Local) {
|
| + page.reset(new InstantTab(&delegate));
|
| EXPECT_FALSE(page->supports_instant());
|
| page->SetContents(web_contents());
|
| NavigateAndCommit(GURL(chrome::kChromeSearchLocalNtpUrl));
|
| @@ -91,8 +91,8 @@ TEST_F(InstantPageTest, DetermineIfPageSupportsInstant_Local) {
|
| EXPECT_TRUE(page->supports_instant());
|
| }
|
|
|
| -TEST_F(InstantPageTest, DetermineIfPageSupportsInstant_NonLocal) {
|
| - page.reset(new InstantPage(&delegate));
|
| +TEST_F(InstantTabTest, DetermineIfPageSupportsInstant_NonLocal) {
|
| + page.reset(new InstantTab(&delegate));
|
| EXPECT_FALSE(page->supports_instant());
|
| page->SetContents(web_contents());
|
| NavigateAndCommit(GURL("chrome-search://foo/bar"));
|
| @@ -106,8 +106,8 @@ TEST_F(InstantPageTest, DetermineIfPageSupportsInstant_NonLocal) {
|
| EXPECT_EQ(web_contents()->GetRoutingID(), message->routing_id());
|
| }
|
|
|
| -TEST_F(InstantPageTest, PageURLDoesntBelongToInstantRenderer) {
|
| - page.reset(new InstantPage(&delegate));
|
| +TEST_F(InstantTabTest, PageURLDoesntBelongToInstantRenderer) {
|
| + page.reset(new InstantTab(&delegate));
|
| EXPECT_FALSE(page->supports_instant());
|
| NavigateAndCommit(GURL(chrome::kChromeSearchLocalNtpUrl));
|
| page->SetContents(web_contents());
|
| @@ -130,9 +130,9 @@ TEST_F(InstantPageTest, PageURLDoesntBelongToInstantRenderer) {
|
| }
|
|
|
| // Test to verify that ChromeViewMsg_DetermineIfPageSupportsInstant message
|
| -// reply handler updates the instant support state in InstantPage.
|
| -TEST_F(InstantPageTest, PageSupportsInstant) {
|
| - page.reset(new InstantPage(&delegate));
|
| +// reply handler updates the instant support state in InstantTab.
|
| +TEST_F(InstantTabTest, PageSupportsInstant) {
|
| + page.reset(new InstantTab(&delegate));
|
| EXPECT_FALSE(page->supports_instant());
|
| page->SetContents(web_contents());
|
| NavigateAndCommit(GURL("chrome-search://foo/bar"));
|
| @@ -148,7 +148,7 @@ TEST_F(InstantPageTest, PageSupportsInstant) {
|
| .Times(1);
|
|
|
| // Assume the page supports instant. Invoke the message reply handler to make
|
| - // sure the InstantPage is notified about the instant support state.
|
| + // sure the InstantTab is notified about the instant support state.
|
| const content::NavigationEntry* entry =
|
| web_contents()->GetController().GetLastCommittedEntry();
|
| EXPECT_TRUE(entry);
|
|
|