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

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

Issue 5697003: Fixes bug in instant where we wouldn't initially tell the page the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git add old_api.html Created 10 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_controller.cc » ('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 21f2f2c3b8454fdf9219c2e85f9f0d33ff76cfda..246c17c15e342571cf535ef76baa1808f206199d 100644
--- a/chrome/browser/instant/instant_browsertest.cc
+++ b/chrome/browser/instant/instant_browsertest.cc
@@ -83,8 +83,8 @@ class InstantTest : public InProcessBrowserTest {
EXPECT_TRUE(browser()->instant()->IsShowingInstant());
EXPECT_FALSE(browser()->instant()->is_active());
- // When the page loads, the initial searchBox values are set and no events
- // have been called.
+ // When the page loads, the initial searchBox values are set and only a
+ // resize will have been sent.
EXPECT_NO_FATAL_FAILURE(CheckBoolValueFromJavascript(
true, "window.chrome.sv", preview_));
EXPECT_NO_FATAL_FAILURE(CheckIntValueFromJavascript(
@@ -94,7 +94,7 @@ class InstantTest : public InProcessBrowserTest {
EXPECT_NO_FATAL_FAILURE(CheckIntValueFromJavascript(
0, "window.onchangecalls", preview_));
EXPECT_NO_FATAL_FAILURE(CheckIntValueFromJavascript(
- 0, "window.onresizecalls", preview_));
+ 1, "window.onresizecalls", preview_));
EXPECT_NO_FATAL_FAILURE(CheckStringValueFromJavascript(
"a", "window.chrome.searchBox.value", preview_));
EXPECT_NO_FATAL_FAILURE(CheckBoolValueFromJavascript(
@@ -242,6 +242,20 @@ IN_PROC_BROWSER_TEST_F(InstantTest, NonSearchToSearchDoesntSupportInstant) {
EXPECT_FALSE(browser()->instant()->is_active());
}
+// Verifies the page was told a non-zero height.
+IN_PROC_BROWSER_TEST_F(InstantTest, ValidHeight) {
+ ASSERT_TRUE(test_server()->Start());
+ ASSERT_NO_FATAL_FAILURE(SetupInstantProvider("old_api.html"));
+ ASSERT_NO_FATAL_FAILURE(SetLocationBarText(L"a"));
+ // The preview should be active.
+ ASSERT_TRUE(browser()->instant()->is_active());
+ // And the height should be valid.
+ ASSERT_NO_FATAL_FAILURE(
+ CheckBoolValueFromJavascript(
+ true, "window.validHeight",
tonyg 2010/12/11 00:44:17 What do you think about replacing this with a test
+ browser()->instant()->GetPreviewContents()->tab_contents()));
+}
+
// Verify that the onsubmit event is dispatched upon pressing enter.
// TODO(sky): Disabled, http://crbug.com/62940.
IN_PROC_BROWSER_TEST_F(InstantTest, DISABLED_OnSubmitEvent) {
« no previous file with comments | « no previous file | chrome/browser/instant/instant_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698