Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <sstream> | 5 #include <sstream> |
| 6 | 6 |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1125 // Instant controller sees it as. | 1125 // Instant controller sees it as. |
| 1126 omnibox()->model()->OnWillKillFocus(NULL); | 1126 omnibox()->model()->OnWillKillFocus(NULL); |
| 1127 omnibox()->model()->OnKillFocus(); | 1127 omnibox()->model()->OnKillFocus(); |
| 1128 | 1128 |
| 1129 // Confirm that the overlay has been committed. | 1129 // Confirm that the overlay has been committed. |
| 1130 content::WebContents* active_tab = | 1130 content::WebContents* active_tab = |
| 1131 browser()->tab_strip_model()->GetActiveWebContents(); | 1131 browser()->tab_strip_model()->GetActiveWebContents(); |
| 1132 EXPECT_EQ(overlay, active_tab); | 1132 EXPECT_EQ(overlay, active_tab); |
| 1133 } | 1133 } |
| 1134 | 1134 |
| 1135 #if defined(OS_MACOSX) | |
| 1136 // http://crbug.com/227076 | |
| 1137 #define MAYBE_CommitWhenShownInFullHeightWithoutFocus \ | |
| 1138 DISABLED_CommitWhenShownInFullHeightWithoutFocus | |
|
xhwang
2013/04/05 18:07:32
nit: should it be 4-space indent here and below?
scottmg
2013/04/05 18:08:42
ah, i was copying the one above. i can change it i
xhwang
2013/04/05 18:25:07
sg, consistency overrules other rules :)
| |
| 1139 #else | |
| 1140 #define MAYBE_CommitWhenShownInFullHeightWithoutFocus \ | |
| 1141 CommitWhenShownInFullHeightWithoutFocus | |
| 1142 #endif | |
| 1143 | |
| 1135 // Test that the overlay is committed when shown at 100% height without focus | 1144 // Test that the overlay is committed when shown at 100% height without focus |
| 1136 // in the omnibox. | 1145 // in the omnibox. |
| 1137 IN_PROC_BROWSER_TEST_F(InstantExtendedTest, | 1146 IN_PROC_BROWSER_TEST_F(InstantExtendedTest, |
| 1138 CommitWhenShownInFullHeightWithoutFocus) { | 1147 MAYBE_CommitWhenShownInFullHeightWithoutFocus) { |
| 1139 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); | 1148 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); |
| 1140 | 1149 |
| 1141 // Focus omnibox and confirm overlay isn't shown. | 1150 // Focus omnibox and confirm overlay isn't shown. |
| 1142 FocusOmniboxAndWaitForInstantExtendedSupport(); | 1151 FocusOmniboxAndWaitForInstantExtendedSupport(); |
| 1143 content::WebContents* overlay = instant()->GetOverlayContents(); | 1152 content::WebContents* overlay = instant()->GetOverlayContents(); |
| 1144 EXPECT_TRUE(overlay); | 1153 EXPECT_TRUE(overlay); |
| 1145 EXPECT_TRUE(instant()->model()->mode().is_default()); | 1154 EXPECT_TRUE(instant()->model()->mode().is_default()); |
| 1146 EXPECT_FALSE(instant()->IsOverlayingSearchResults()); | 1155 EXPECT_FALSE(instant()->IsOverlayingSearchResults()); |
| 1147 | 1156 |
| 1148 // Create an observer to wait for the commit. | 1157 // Create an observer to wait for the commit. |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1348 content::WebContents* overlay = instant()->GetOverlayContents(); | 1357 content::WebContents* overlay = instant()->GetOverlayContents(); |
| 1349 EXPECT_TRUE(UpdateSearchState(overlay)); | 1358 EXPECT_TRUE(UpdateSearchState(overlay)); |
| 1350 EXPECT_EQ(0, on_native_suggestions_calls_); | 1359 EXPECT_EQ(0, on_native_suggestions_calls_); |
| 1351 | 1360 |
| 1352 SetOmniboxTextAndWaitForOverlayToShow("railroad"); | 1361 SetOmniboxTextAndWaitForOverlayToShow("railroad"); |
| 1353 | 1362 |
| 1354 EXPECT_EQ(overlay, instant()->GetOverlayContents()); | 1363 EXPECT_EQ(overlay, instant()->GetOverlayContents()); |
| 1355 EXPECT_TRUE(UpdateSearchState(overlay)); | 1364 EXPECT_TRUE(UpdateSearchState(overlay)); |
| 1356 EXPECT_EQ(1, on_native_suggestions_calls_); | 1365 EXPECT_EQ(1, on_native_suggestions_calls_); |
| 1357 } | 1366 } |
| OLD | NEW |