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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/format_macros.h" | 6 #include "base/format_macros.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" | 10 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 // and select all. | 177 // and select all. |
178 LocationBar* location_bar = GetLocationBar(); | 178 LocationBar* location_bar = GetLocationBar(); |
179 OmniboxView* omnibox_view = location_bar->GetOmniboxView(); | 179 OmniboxView* omnibox_view = location_bar->GetOmniboxView(); |
180 EXPECT_EQ(base::UTF8ToUTF16(url::kAboutBlankURL), omnibox_view->GetText()); | 180 EXPECT_EQ(base::UTF8ToUTF16(url::kAboutBlankURL), omnibox_view->GetText()); |
181 omnibox_view->SetUserText(base::string16()); | 181 omnibox_view->SetUserText(base::string16()); |
182 content::WindowedNotificationObserver observer( | 182 content::WindowedNotificationObserver observer( |
183 content::NOTIFICATION_LOAD_STOP, | 183 content::NOTIFICATION_LOAD_STOP, |
184 content::NotificationService::AllSources()); | 184 content::NotificationService::AllSources()); |
185 chrome::AddSelectedTabWithURL(browser(), | 185 chrome::AddSelectedTabWithURL(browser(), |
186 GURL(url::kAboutBlankURL), | 186 GURL(url::kAboutBlankURL), |
187 content::PAGE_TRANSITION_AUTO_TOPLEVEL); | 187 ui::PAGE_TRANSITION_AUTO_TOPLEVEL); |
188 observer.Wait(); | 188 observer.Wait(); |
189 EXPECT_EQ(base::UTF8ToUTF16(url::kAboutBlankURL), omnibox_view->GetText()); | 189 EXPECT_EQ(base::UTF8ToUTF16(url::kAboutBlankURL), omnibox_view->GetText()); |
190 chrome::CloseTab(browser()); | 190 chrome::CloseTab(browser()); |
191 EXPECT_EQ(base::UTF8ToUTF16(url::kAboutBlankURL), omnibox_view->GetText()); | 191 EXPECT_EQ(base::UTF8ToUTF16(url::kAboutBlankURL), omnibox_view->GetText()); |
192 EXPECT_TRUE(omnibox_view->IsSelectAll()); | 192 EXPECT_TRUE(omnibox_view->IsSelectAll()); |
193 } | 193 } |
194 | 194 |
195 IN_PROC_BROWSER_TEST_F(AutocompleteBrowserTest, FocusSearch) { | 195 IN_PROC_BROWSER_TEST_F(AutocompleteBrowserTest, FocusSearch) { |
196 #if defined(OS_WIN) && defined(USE_ASH) | 196 #if defined(OS_WIN) && defined(USE_ASH) |
197 // Disable this test in Metro+Ash for now (http://crbug.com/262796). | 197 // Disable this test in Metro+Ash for now (http://crbug.com/262796). |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 location_bar->FocusSearch(); | 277 location_bar->FocusSearch(); |
278 EXPECT_FALSE(location_bar->GetDestinationURL().is_valid()); | 278 EXPECT_FALSE(location_bar->GetDestinationURL().is_valid()); |
279 EXPECT_EQ(base::ASCIIToUTF16(" ?foo"), omnibox_view->GetText()); | 279 EXPECT_EQ(base::ASCIIToUTF16(" ?foo"), omnibox_view->GetText()); |
280 | 280 |
281 size_t selection_start, selection_end; | 281 size_t selection_start, selection_end; |
282 omnibox_view->GetSelectionBounds(&selection_start, &selection_end); | 282 omnibox_view->GetSelectionBounds(&selection_start, &selection_end); |
283 EXPECT_EQ(4U, std::min(selection_start, selection_end)); | 283 EXPECT_EQ(4U, std::min(selection_start, selection_end)); |
284 EXPECT_EQ(7U, std::max(selection_start, selection_end)); | 284 EXPECT_EQ(7U, std::max(selection_start, selection_end)); |
285 } | 285 } |
286 } | 286 } |
OLD | NEW |