| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/browser_navigator_browsertest.h" | 5 #include "chrome/browser/ui/browser_navigator_browsertest.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
| 9 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 9 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
| (...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1159 // Navigate to url. | 1159 // Navigate to url. |
| 1160 chrome::NavigateParams p(MakeNavigateParams()); | 1160 chrome::NavigateParams p(MakeNavigateParams()); |
| 1161 p.disposition = CURRENT_TAB; | 1161 p.disposition = CURRENT_TAB; |
| 1162 p.url = url; | 1162 p.url = url; |
| 1163 chrome::Navigate(&p); | 1163 chrome::Navigate(&p); |
| 1164 | 1164 |
| 1165 // Focus the omnibox. | 1165 // Focus the omnibox. |
| 1166 chrome::FocusLocationBar(browser()); | 1166 chrome::FocusLocationBar(browser()); |
| 1167 | 1167 |
| 1168 OmniboxEditController* controller = | 1168 OmniboxEditController* controller = |
| 1169 browser()->window()->GetLocationBar()->GetLocationEntry()->model()-> | 1169 browser()->window()->GetLocationBar()->GetLocationEntry()->GetModel()-> |
| 1170 controller(); | 1170 controller(); |
| 1171 | 1171 |
| 1172 // Simulate an alt-enter. | 1172 // Simulate an alt-enter. |
| 1173 controller->OnAutocompleteAccept(url2, NEW_FOREGROUND_TAB, | 1173 controller->OnAutocompleteAccept(url2, NEW_FOREGROUND_TAB, |
| 1174 content::PAGE_TRANSITION_TYPED, GURL()); | 1174 content::PAGE_TRANSITION_TYPED, GURL()); |
| 1175 | 1175 |
| 1176 // Make sure the second tab is selected. | 1176 // Make sure the second tab is selected. |
| 1177 EXPECT_EQ(1, browser()->active_index()); | 1177 EXPECT_EQ(1, browser()->active_index()); |
| 1178 | 1178 |
| 1179 // The tab contents should have the focus in the second tab. | 1179 // The tab contents should have the focus in the second tab. |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1279 EXPECT_EQ(browser(), p2.browser); | 1279 EXPECT_EQ(browser(), p2.browser); |
| 1280 | 1280 |
| 1281 // We should now have two windows, the browser() provided by the framework and | 1281 // We should now have two windows, the browser() provided by the framework and |
| 1282 // the panel window we opened earlier. The tabbed browser window has 2 tabs. | 1282 // the panel window we opened earlier. The tabbed browser window has 2 tabs. |
| 1283 EXPECT_EQ(2u, BrowserList::size()); | 1283 EXPECT_EQ(2u, BrowserList::size()); |
| 1284 EXPECT_EQ(2, browser()->tab_count()); | 1284 EXPECT_EQ(2, browser()->tab_count()); |
| 1285 EXPECT_EQ(1, panel_browser->tab_count()); | 1285 EXPECT_EQ(1, panel_browser->tab_count()); |
| 1286 } | 1286 } |
| 1287 | 1287 |
| 1288 } // namespace | 1288 } // namespace |
| OLD | NEW |