Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5400)

Unified Diff: chrome/browser/instant/instant_browsertest.cc

Issue 11824050: InstantExtended: Committed NTP (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/instant/instant_browsertest.cc
diff --git a/chrome/browser/instant/instant_browsertest.cc b/chrome/browser/instant/instant_browsertest.cc
index 543e3dafb53abf332f21ac61c751c201a6d2a1f9..ae39f19d753a330adc33da8f04f539f4f3dc7b5d 100644
--- a/chrome/browser/instant/instant_browsertest.cc
+++ b/chrome/browser/instant/instant_browsertest.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/history/history_service_factory.h"
-#include "chrome/browser/instant/instant_loader.h"
+#include "chrome/browser/instant/instant_overlay.h"
#include "chrome/browser/instant/instant_service.h"
#include "chrome/browser/instant/instant_service_factory.h"
#include "chrome/browser/instant/instant_test_utils.h"
@@ -65,7 +65,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, OmniboxFocusLoadsInstant) {
EXPECT_FALSE(omnibox()->model()->has_focus());
// Delete any existing preview.
- instant()->loader_.reset();
+ instant()->overlay_.reset();
EXPECT_FALSE(instant()->GetPreviewContents());
// Refocus the omnibox. The InstantController should've preloaded Instant.
@@ -78,7 +78,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, OmniboxFocusLoadsInstant) {
EXPECT_TRUE(preview_tab);
// Check that the page supports Instant, but it isn't showing.
- EXPECT_TRUE(instant()->loader_->supports_instant());
+ EXPECT_TRUE(instant()->overlay_->supports_instant());
EXPECT_FALSE(instant()->IsPreviewingSearchResults());
EXPECT_TRUE(instant()->model()->mode().is_default());
@@ -115,7 +115,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SetWithTemplateURL) {
EXPECT_FALSE(omnibox()->model()->has_focus());
// Delete any existing preview.
- instant()->loader_.reset();
+ instant()->overlay_.reset();
EXPECT_FALSE(instant()->GetPreviewContents());
// Refocus the omnibox. The InstantController should've preloaded Instant.
@@ -128,7 +128,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SetWithTemplateURL) {
EXPECT_TRUE(preview_tab);
// Check that the page supports Instant, but it isn't showing.
- EXPECT_TRUE(instant()->loader_->supports_instant());
+ EXPECT_TRUE(instant()->overlay_->supports_instant());
EXPECT_FALSE(instant()->IsPreviewingSearchResults());
EXPECT_TRUE(instant()->model()->mode().is_default());
}
@@ -212,7 +212,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, OnSubmitEvent) {
EXPECT_FALSE(instant()->IsPreviewingSearchResults());
EXPECT_TRUE(instant()->model()->mode().is_default());
- // The old loader is deleted and a new one is created.
+ // The old overlay is deleted and a new one is created.
EXPECT_TRUE(instant()->GetPreviewContents());
EXPECT_NE(instant()->GetPreviewContents(), preview_tab);
@@ -272,7 +272,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, OnCancelEvent) {
EXPECT_FALSE(instant()->IsPreviewingSearchResults());
EXPECT_TRUE(instant()->model()->mode().is_default());
- // The old loader is deleted and a new one is created.
+ // The old overlay is deleted and a new one is created.
EXPECT_TRUE(instant()->GetPreviewContents());
EXPECT_NE(instant()->GetPreviewContents(), preview_tab);
@@ -776,37 +776,37 @@ IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE_NewWindowDismissesInstant) {
EXPECT_TRUE(instant()->model()->mode().is_default());
}
-// Test that the Instant loader is recreated when all these conditions are met:
-// - The stale loader timer has fired.
+// Test that the Instant overlay is recreated when all these conditions are met:
+// - The stale overlay timer has fired.
// - The preview is not showing.
// - The omnibox doesn't have focus.
-IN_PROC_BROWSER_TEST_F(InstantTest, InstantLoaderRefresh) {
+IN_PROC_BROWSER_TEST_F(InstantTest, InstantOverlayRefresh) {
ASSERT_NO_FATAL_FAILURE(SetupInstant());
FocusOmniboxAndWaitForInstantSupport();
// The preview is refreshed only after all three conditions above are met.
SetOmniboxTextAndWaitForInstantToShow("query");
- instant()->stale_loader_timer_.Stop();
- instant()->OnStaleLoader();
- EXPECT_TRUE(instant()->loader_->supports_instant());
- instant()->HideLoader();
- EXPECT_TRUE(instant()->loader_->supports_instant());
+ instant()->overlay_->is_stale_ = true;
+ instant()->HandleStaleOverlay();
+ EXPECT_TRUE(instant()->overlay_->supports_instant());
+ instant()->HideOverlay();
+ EXPECT_TRUE(instant()->overlay_->supports_instant());
instant()->OmniboxFocusChanged(OMNIBOX_FOCUS_NONE,
OMNIBOX_FOCUS_CHANGE_EXPLICIT, NULL);
- EXPECT_FALSE(instant()->loader_->supports_instant());
+ EXPECT_FALSE(instant()->overlay_->supports_instant());
// Try with a different ordering.
SetOmniboxTextAndWaitForInstantToShow("query");
- instant()->stale_loader_timer_.Stop();
- instant()->OnStaleLoader();
- EXPECT_TRUE(instant()->loader_->supports_instant());
+ instant()->overlay_->is_stale_ = true;
+ instant()->HandleStaleOverlay();
+ EXPECT_TRUE(instant()->overlay_->supports_instant());
instant()->OmniboxFocusChanged(OMNIBOX_FOCUS_NONE,
OMNIBOX_FOCUS_CHANGE_EXPLICIT, NULL);
- // TODO(sreeram): Currently, OmniboxLostFocus() calls HideLoader(). When it
+ // TODO(sreeram): Currently, OmniboxLostFocus() calls HideOverlay(). When it
// stops hiding the preview eventually, uncomment these two lines:
- // EXPECT_TRUE(instant()->loader_->supports_instant());
- // instant()->HideLoader();
- EXPECT_FALSE(instant()->loader_->supports_instant());
+ // EXPECT_TRUE(instant()->overlay_->supports_instant());
+ // instant()->HideOverlay();
+ EXPECT_FALSE(instant()->overlay_->supports_instant());
}
// Test that suggestions are case insensitive. http://crbug.com/150728
@@ -916,7 +916,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE_CommitInNewTab) {
EXPECT_FALSE(instant()->IsPreviewingSearchResults());
EXPECT_TRUE(instant()->model()->mode().is_default());
- // The old loader is deleted and a new one is created.
+ // The old overlay is deleted and a new one is created.
EXPECT_TRUE(instant()->GetPreviewContents());
EXPECT_NE(instant()->GetPreviewContents(), preview_tab);
@@ -970,7 +970,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SuggestionsAreReusable) {
EXPECT_EQ(ASCIIToUTF16(""), omnibox()->GetInstantSuggestion());
}
-// Test that instant loader is recreated if it gets destroyed.
+// Test that instant overlay is recreated if it gets destroyed.
IN_PROC_BROWSER_TEST_F(InstantTest, InstantRenderViewGone) {
ASSERT_NO_FATAL_FAILURE(SetupInstant());
FocusOmniboxAndWaitForInstantSupport();

Powered by Google App Engine
This is Rietveld 408576698