| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <stdio.h> | 5 #include <stdio.h> |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/keyboard_codes.h" | 8 #include "base/keyboard_codes.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 269 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| 270 new MessageLoop::QuitTask(), | 270 new MessageLoop::QuitTask(), |
| 271 2000); | 271 2000); |
| 272 ui_test_utils::RunMessageLoop(); | 272 ui_test_utils::RunMessageLoop(); |
| 273 } | 273 } |
| 274 #endif | 274 #endif |
| 275 }; | 275 }; |
| 276 | 276 |
| 277 // Test if ctrl-* accelerators are workable in omnibox. | 277 // Test if ctrl-* accelerators are workable in omnibox. |
| 278 // See http://crbug.com/19193: omnibox blocks ctrl-* commands | 278 // See http://crbug.com/19193: omnibox blocks ctrl-* commands |
| 279 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, BrowserAccelerators) { | 279 // This test is disabled. See bug 23213. |
| 280 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, DISABLED_BrowserAccelerators) { |
| 280 browser()->FocusLocationBar(); | 281 browser()->FocusLocationBar(); |
| 281 AutocompleteEditView* edit_view = NULL; | 282 AutocompleteEditView* edit_view = NULL; |
| 282 ASSERT_NO_FATAL_FAILURE(GetAutocompleteEditView(&edit_view)); | 283 ASSERT_NO_FATAL_FAILURE(GetAutocompleteEditView(&edit_view)); |
| 283 | 284 |
| 284 int tab_count = browser()->tab_count(); | 285 int tab_count = browser()->tab_count(); |
| 285 | 286 |
| 286 // Create a new Tab. | 287 // Create a new Tab. |
| 287 browser()->NewTab(); | 288 browser()->NewTab(); |
| 288 ASSERT_NO_FATAL_FAILURE(WaitForTabOpenOrClose(tab_count + 1)); | 289 ASSERT_NO_FATAL_FAILURE(WaitForTabOpenOrClose(tab_count + 1)); |
| 289 | 290 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 ASSERT_NO_FATAL_FAILURE(SendKeySequence(kDesiredTLDKeys)); | 399 ASSERT_NO_FATAL_FAILURE(SendKeySequence(kDesiredTLDKeys)); |
| 399 ASSERT_NO_FATAL_FAILURE(WaitForAutocompleteControllerDone()); | 400 ASSERT_NO_FATAL_FAILURE(WaitForAutocompleteControllerDone()); |
| 400 ASSERT_TRUE(popup_model->IsOpen()); | 401 ASSERT_TRUE(popup_model->IsOpen()); |
| 401 // ctrl-Enter triggers desired_tld feature, thus www.bar.com shall be opened. | 402 // ctrl-Enter triggers desired_tld feature, thus www.bar.com shall be opened. |
| 402 ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_RETURN, true, false, false)); | 403 ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_RETURN, true, false, false)); |
| 403 | 404 |
| 404 GURL url = browser()->GetSelectedTabContents()->GetURL(); | 405 GURL url = browser()->GetSelectedTabContents()->GetURL(); |
| 405 EXPECT_STREQ(kDesiredTLDHostname, url.host().c_str()); | 406 EXPECT_STREQ(kDesiredTLDHostname, url.host().c_str()); |
| 406 } | 407 } |
| 407 | 408 |
| 408 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, AltEnter) { | 409 // This test is disabled. See bug 23213. |
| 410 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, DISABLED_AltEnter) { |
| 409 ASSERT_NO_FATAL_FAILURE(SetupHostResolver()); | 411 ASSERT_NO_FATAL_FAILURE(SetupHostResolver()); |
| 410 browser()->FocusLocationBar(); | 412 browser()->FocusLocationBar(); |
| 411 | 413 |
| 412 AutocompleteEditView* edit_view = NULL; | 414 AutocompleteEditView* edit_view = NULL; |
| 413 ASSERT_NO_FATAL_FAILURE(GetAutocompleteEditView(&edit_view)); | 415 ASSERT_NO_FATAL_FAILURE(GetAutocompleteEditView(&edit_view)); |
| 414 | 416 |
| 415 edit_view->SetUserText(ASCIIToWide(chrome::kChromeUIHistoryURL)); | 417 edit_view->SetUserText(ASCIIToWide(chrome::kChromeUIHistoryURL)); |
| 416 int tab_count = browser()->tab_count(); | 418 int tab_count = browser()->tab_count(); |
| 417 // alt-Enter opens a new tab. | 419 // alt-Enter opens a new tab. |
| 418 ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_RETURN, false, false, true)); | 420 ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_RETURN, false, false, true)); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 break; | 538 break; |
| 537 } | 539 } |
| 538 | 540 |
| 539 EXPECT_NE(old_text, edit_view->GetText()); | 541 EXPECT_NE(old_text, edit_view->GetText()); |
| 540 | 542 |
| 541 // Escape shall revert back to the default match item. | 543 // Escape shall revert back to the default match item. |
| 542 ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_ESCAPE, false, false, false)); | 544 ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_ESCAPE, false, false, false)); |
| 543 EXPECT_EQ(old_text, edit_view->GetText()); | 545 EXPECT_EQ(old_text, edit_view->GetText()); |
| 544 EXPECT_EQ(old_selected_line, popup_model->selected_line()); | 546 EXPECT_EQ(old_selected_line, popup_model->selected_line()); |
| 545 } | 547 } |
| OLD | NEW |