| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/content_settings/host_content_settings_map.h" | 5 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 6 #include "chrome/browser/history/history_service_factory.h" | 6 #include "chrome/browser/history/history_service_factory.h" |
| 7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/search/instant_service.h" | 8 #include "chrome/browser/search/instant_service.h" |
| 9 #include "chrome/browser/search/instant_service_factory.h" | 9 #include "chrome/browser/search/instant_service_factory.h" |
| 10 #include "chrome/browser/search_engines/template_url_service.h" | 10 #include "chrome/browser/search_engines/template_url_service.h" |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 // Inititally, the active tab is showing; the overlay is not. | 600 // Inititally, the active tab is showing; the overlay is not. |
| 601 EXPECT_TRUE(CheckVisibilityIs(active_tab, true)); | 601 EXPECT_TRUE(CheckVisibilityIs(active_tab, true)); |
| 602 EXPECT_TRUE(CheckVisibilityIs(overlay, false)); | 602 EXPECT_TRUE(CheckVisibilityIs(overlay, false)); |
| 603 | 603 |
| 604 // Type a query and wait for Instant to show. | 604 // Type a query and wait for Instant to show. |
| 605 SetOmniboxTextAndWaitForOverlayToShow("query"); | 605 SetOmniboxTextAndWaitForOverlayToShow("query"); |
| 606 EXPECT_TRUE(CheckVisibilityIs(active_tab, true)); | 606 EXPECT_TRUE(CheckVisibilityIs(active_tab, true)); |
| 607 EXPECT_TRUE(CheckVisibilityIs(overlay, true)); | 607 EXPECT_TRUE(CheckVisibilityIs(overlay, true)); |
| 608 | 608 |
| 609 // Deleting the omnibox text should hide the overlay. | 609 // Deleting the omnibox text should hide the overlay. |
| 610 SetOmniboxText(""); | 610 SetOmniboxText(std::string()); |
| 611 EXPECT_TRUE(CheckVisibilityIs(active_tab, true)); | 611 EXPECT_TRUE(CheckVisibilityIs(active_tab, true)); |
| 612 EXPECT_TRUE(CheckVisibilityIs(overlay, false)); | 612 EXPECT_TRUE(CheckVisibilityIs(overlay, false)); |
| 613 | 613 |
| 614 // Typing a query should show the overlay again. | 614 // Typing a query should show the overlay again. |
| 615 SetOmniboxTextAndWaitForOverlayToShow("query"); | 615 SetOmniboxTextAndWaitForOverlayToShow("query"); |
| 616 EXPECT_TRUE(CheckVisibilityIs(active_tab, true)); | 616 EXPECT_TRUE(CheckVisibilityIs(active_tab, true)); |
| 617 EXPECT_TRUE(CheckVisibilityIs(overlay, true)); | 617 EXPECT_TRUE(CheckVisibilityIs(overlay, true)); |
| 618 | 618 |
| 619 // Commit the overlay. | 619 // Commit the overlay. |
| 620 browser()->window()->GetLocationBar()->AcceptInput(); | 620 browser()->window()->GetLocationBar()->AcceptInput(); |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 994 content::WebContents* active_tab = | 994 content::WebContents* active_tab = |
| 995 browser()->tab_strip_model()->GetActiveWebContents(); | 995 browser()->tab_strip_model()->GetActiveWebContents(); |
| 996 EXPECT_TRUE(instant_service->IsInstantProcess( | 996 EXPECT_TRUE(instant_service->IsInstantProcess( |
| 997 active_tab->GetRenderProcessHost()->GetID())); | 997 active_tab->GetRenderProcessHost()->GetID())); |
| 998 | 998 |
| 999 // Navigating away should change the process. | 999 // Navigating away should change the process. |
| 1000 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); | 1000 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); |
| 1001 EXPECT_FALSE(instant_service->IsInstantProcess( | 1001 EXPECT_FALSE(instant_service->IsInstantProcess( |
| 1002 active_tab->GetRenderProcessHost()->GetID())); | 1002 active_tab->GetRenderProcessHost()->GetID())); |
| 1003 } | 1003 } |
| OLD | NEW |