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) { |