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

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

Issue 11413217: Instant API: tell page whether the browser is capturing key strokes. (Closed) Base URL: http://git.chromium.org/chromium/src.git@focus
Patch Set: Fix tests. Created 8 years 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
« no previous file with comments | « no previous file | chrome/browser/instant/instant_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/instant/instant_browsertest.cc
diff --git a/chrome/browser/instant/instant_browsertest.cc b/chrome/browser/instant/instant_browsertest.cc
index e97b25fdbdcbb363525766a4cdcae8adef72be87..797688c1ca0b17bc956c1a98e63106cc38ac0fa1 100644
--- a/chrome/browser/instant/instant_browsertest.cc
+++ b/chrome/browser/instant/instant_browsertest.cc
@@ -102,10 +102,13 @@ class InstantTest : public InProcessBrowserTest {
void FocusOmnibox() {
// If the omnibox already has focus, just notify Instant.
- if (omnibox()->model()->has_focus())
- instant()->OmniboxGotFocus();
- else
+ if (omnibox()->model()->has_focus()) {
+ instant()->OmniboxFocusChanged(OMNIBOX_FOCUS_VISIBLE,
+ OMNIBOX_FOCUS_CHANGE_EXPLICIT, NULL);
+ }
+ else {
browser()->window()->GetLocationBar()->FocusLocation(false);
+ }
}
void FocusOmniboxAndWaitForInstantSupport() {
@@ -678,7 +681,8 @@ IN_PROC_BROWSER_TEST_F(InstantTest, DoesNotCommitURLsTwo) {
// Pretend the omnibox got focus. It already had focus, so we are just trying
// to tickle a different code path.
- instant()->OmniboxGotFocus();
+ instant()->OmniboxFocusChanged(OMNIBOX_FOCUS_VISIBLE,
+ OMNIBOX_FOCUS_CHANGE_EXPLICIT, NULL);
// Commit the URL. As before, check that Instant wasn't committed.
browser()->window()->GetLocationBar()->AcceptInput();
@@ -897,7 +901,8 @@ IN_PROC_BROWSER_TEST_F(InstantTest, InstantLoaderRefresh) {
EXPECT_TRUE(instant()->loader_->supports_instant());
instant()->HideLoader();
EXPECT_TRUE(instant()->loader_->supports_instant());
- instant()->OmniboxLostFocus(NULL);
+ instant()->OmniboxFocusChanged(OMNIBOX_FOCUS_NONE,
+ OMNIBOX_FOCUS_CHANGE_EXPLICIT, NULL);
EXPECT_FALSE(instant()->loader_->supports_instant());
// Try with a different ordering.
@@ -905,7 +910,8 @@ IN_PROC_BROWSER_TEST_F(InstantTest, InstantLoaderRefresh) {
instant()->stale_loader_timer_.Stop();
instant()->OnStaleLoader();
EXPECT_TRUE(instant()->loader_->supports_instant());
- instant()->OmniboxLostFocus(NULL);
+ instant()->OmniboxFocusChanged(OMNIBOX_FOCUS_NONE,
+ OMNIBOX_FOCUS_CHANGE_EXPLICIT, NULL);
// TODO(sreeram): Currently, OmniboxLostFocus() calls HideLoader(). When it
// stops hiding the preview eventually, uncomment these two lines:
// EXPECT_TRUE(instant()->loader_->supports_instant());
« no previous file with comments | « no previous file | chrome/browser/instant/instant_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698