| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/keyboard_codes.h" | 7 #include "app/keyboard_codes.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 break; | 271 break; |
| 272 default: | 272 default: |
| 273 FAIL() << "Unexpected notification type"; | 273 FAIL() << "Unexpected notification type"; |
| 274 } | 274 } |
| 275 MessageLoopForUI::current()->Quit(); | 275 MessageLoopForUI::current()->Quit(); |
| 276 } | 276 } |
| 277 }; | 277 }; |
| 278 | 278 |
| 279 // Test if ctrl-* accelerators are workable in omnibox. | 279 // Test if ctrl-* accelerators are workable in omnibox. |
| 280 // See http://crbug.com/19193: omnibox blocks ctrl-* commands | 280 // See http://crbug.com/19193: omnibox blocks ctrl-* commands |
| 281 // FAILS on windows, http://crbug.com/57965 | 281 // Sometimes times out on Windows: http://crbug.com/57965 |
| 282 #if defined(OS_WIN) | 282 #if defined(OS_WIN) |
| 283 #define MAYBE_BrowserAccelerators DISABLED_BrowserAccelerators | 283 #define MAYBE_BrowserAccelerators DISABLED_BrowserAccelerators |
| 284 #else | 284 #else |
| 285 #define MAYBE_BrowserAccelerators BrowserAccelerators | 285 #define MAYBE_BrowserAccelerators BrowserAccelerators |
| 286 #endif | 286 #endif |
| 287 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, MAYBE_BrowserAccelerators) { | 287 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, MAYBE_BrowserAccelerators) { |
| 288 browser()->FocusLocationBar(); | 288 browser()->FocusLocationBar(); |
| 289 AutocompleteEditView* edit_view = NULL; | 289 AutocompleteEditView* edit_view = NULL; |
| 290 ASSERT_NO_FATAL_FAILURE(GetAutocompleteEditView(&edit_view)); | 290 ASSERT_NO_FATAL_FAILURE(GetAutocompleteEditView(&edit_view)); |
| 291 | 291 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 EXPECT_EQ(L"Hello ", edit_view->GetText()); | 330 EXPECT_EQ(L"Hello ", edit_view->GetText()); |
| 331 | 331 |
| 332 #if !defined(OS_CHROMEOS) | 332 #if !defined(OS_CHROMEOS) |
| 333 // Try alt-f4 to close the browser. | 333 // Try alt-f4 to close the browser. |
| 334 ASSERT_TRUE(ui_test_utils::SendKeyPressAndWait( | 334 ASSERT_TRUE(ui_test_utils::SendKeyPressAndWait( |
| 335 browser(), app::VKEY_F4, false, false, true, false, | 335 browser(), app::VKEY_F4, false, false, true, false, |
| 336 NotificationType::BROWSER_CLOSED, Source<Browser>(browser()))); | 336 NotificationType::BROWSER_CLOSED, Source<Browser>(browser()))); |
| 337 #endif | 337 #endif |
| 338 } | 338 } |
| 339 | 339 |
| 340 // FAILS on windows, http://crbug.com/57965 | 340 // Sometimes times out on Windows: http://crbug.com/57965 |
| 341 #if defined(OS_WIN) | 341 #if defined(OS_WIN) |
| 342 #define MAYBE_PopupAccelerators DISABLED_PopupAccelerators | 342 #define MAYBE_PopupAccelerators DISABLED_PopupAccelerators |
| 343 #else | 343 #else |
| 344 #define MAYBE_PopupAccelerators PopupAccelerators | 344 #define MAYBE_PopupAccelerators PopupAccelerators |
| 345 #endif | 345 #endif |
| 346 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, MAYBE_PopupAccelerators) { | 346 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, MAYBE_PopupAccelerators) { |
| 347 // Create a popup. | 347 // Create a popup. |
| 348 Browser* popup = CreateBrowserForPopup(browser()->profile()); | 348 Browser* popup = CreateBrowserForPopup(browser()->profile()); |
| 349 AutocompleteEditView* edit_view = NULL; | 349 AutocompleteEditView* edit_view = NULL; |
| 350 ASSERT_NO_FATAL_FAILURE(GetAutocompleteEditViewForBrowser(popup, &edit_view)); | 350 ASSERT_NO_FATAL_FAILURE(GetAutocompleteEditViewForBrowser(popup, &edit_view)); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 EXPECT_EQ(L"Hello world", edit_view->GetText()); | 383 EXPECT_EQ(L"Hello world", edit_view->GetText()); |
| 384 | 384 |
| 385 #if !defined(OS_CHROMEOS) | 385 #if !defined(OS_CHROMEOS) |
| 386 // Try alt-f4 to close the popup. | 386 // Try alt-f4 to close the popup. |
| 387 ASSERT_TRUE(ui_test_utils::SendKeyPressAndWait( | 387 ASSERT_TRUE(ui_test_utils::SendKeyPressAndWait( |
| 388 popup, app::VKEY_F4, false, false, true, false, | 388 popup, app::VKEY_F4, false, false, true, false, |
| 389 NotificationType::BROWSER_CLOSED, Source<Browser>(popup))); | 389 NotificationType::BROWSER_CLOSED, Source<Browser>(popup))); |
| 390 #endif | 390 #endif |
| 391 } | 391 } |
| 392 | 392 |
| 393 // FAILS on windows, http://crbug.com/57965 | 393 // Sometimes times out on Windows: http://crbug.com/57965 |
| 394 #if defined(OS_WIN) | 394 #if defined(OS_WIN) |
| 395 #define MAYBE_BackspaceInKeywordMode DISABLED_BackspaceInKeywordMode | 395 #define MAYBE_BackspaceInKeywordMode DISABLED_BackspaceInKeywordMode |
| 396 #else | 396 #else |
| 397 #define MAYBE_BackspaceInKeywordMode BackspaceInKeywordMode | 397 #define MAYBE_BackspaceInKeywordMode BackspaceInKeywordMode |
| 398 #endif | 398 #endif |
| 399 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, MAYBE_BackspaceInKeywordMode) { | 399 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, MAYBE_BackspaceInKeywordMode) { |
| 400 ASSERT_NO_FATAL_FAILURE(SetupComponents()); | 400 ASSERT_NO_FATAL_FAILURE(SetupComponents()); |
| 401 browser()->FocusLocationBar(); | 401 browser()->FocusLocationBar(); |
| 402 | 402 |
| 403 AutocompleteEditView* edit_view = NULL; | 403 AutocompleteEditView* edit_view = NULL; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_HOME, false, false, false)); | 441 ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_HOME, false, false, false)); |
| 442 // Backspace at the beginning of the search text shall turn off | 442 // Backspace at the beginning of the search text shall turn off |
| 443 // the keyword mode. | 443 // the keyword mode. |
| 444 ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_BACK, false, false, false)); | 444 ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_BACK, false, false, false)); |
| 445 ASSERT_FALSE(edit_view->model()->is_keyword_hint()); | 445 ASSERT_FALSE(edit_view->model()->is_keyword_hint()); |
| 446 ASSERT_EQ(std::string(), WideToUTF8(edit_view->model()->keyword())); | 446 ASSERT_EQ(std::string(), WideToUTF8(edit_view->model()->keyword())); |
| 447 ASSERT_EQ(std::string(kSearchKeyword) + kSearchText, | 447 ASSERT_EQ(std::string(kSearchKeyword) + kSearchText, |
| 448 WideToUTF8(edit_view->GetText())); | 448 WideToUTF8(edit_view->GetText())); |
| 449 } | 449 } |
| 450 | 450 |
| 451 // FAILS on windows, http://crbug.com/57965 | 451 // Sometimes times out on Windows: http://crbug.com/57965 |
| 452 #if defined(OS_WIN) | 452 #if defined(OS_WIN) |
| 453 #define MAYBE_Escape DISABLED_Escape | 453 #define MAYBE_Escape DISABLED_Escape |
| 454 #else | 454 #else |
| 455 #define MAYBE_Escape Escape | 455 #define MAYBE_Escape Escape |
| 456 #endif | 456 #endif |
| 457 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, MAYBE_Escape) { | 457 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, MAYBE_Escape) { |
| 458 ASSERT_NO_FATAL_FAILURE(SetupComponents()); | 458 ASSERT_NO_FATAL_FAILURE(SetupComponents()); |
| 459 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIHistoryURL)); | 459 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIHistoryURL)); |
| 460 browser()->FocusLocationBar(); | 460 browser()->FocusLocationBar(); |
| 461 | 461 |
| 462 AutocompleteEditView* edit_view = NULL; | 462 AutocompleteEditView* edit_view = NULL; |
| 463 ASSERT_NO_FATAL_FAILURE(GetAutocompleteEditView(&edit_view)); | 463 ASSERT_NO_FATAL_FAILURE(GetAutocompleteEditView(&edit_view)); |
| 464 | 464 |
| 465 std::wstring old_text = edit_view->GetText(); | 465 std::wstring old_text = edit_view->GetText(); |
| 466 EXPECT_FALSE(old_text.empty()); | 466 EXPECT_FALSE(old_text.empty()); |
| 467 EXPECT_TRUE(edit_view->IsSelectAll()); | 467 EXPECT_TRUE(edit_view->IsSelectAll()); |
| 468 | 468 |
| 469 // Delete all text in omnibox. | 469 // Delete all text in omnibox. |
| 470 ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_BACK, false, false, false)); | 470 ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_BACK, false, false, false)); |
| 471 EXPECT_TRUE(edit_view->GetText().empty()); | 471 EXPECT_TRUE(edit_view->GetText().empty()); |
| 472 | 472 |
| 473 // Escape shall revert the text in omnibox. | 473 // Escape shall revert the text in omnibox. |
| 474 ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_ESCAPE, false, false, false)); | 474 ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_ESCAPE, false, false, false)); |
| 475 EXPECT_EQ(old_text, edit_view->GetText()); | 475 EXPECT_EQ(old_text, edit_view->GetText()); |
| 476 EXPECT_TRUE(edit_view->IsSelectAll()); | 476 EXPECT_TRUE(edit_view->IsSelectAll()); |
| 477 } | 477 } |
| 478 | 478 |
| 479 // FAILS on windows, http://crbug.com/57965 | 479 // Sometimes times out on Windows: http://crbug.com/57965 |
| 480 #if defined(OS_WIN) | 480 #if defined(OS_WIN) |
| 481 #define MAYBE_DesiredTLD DISABLED_DesiredTLD | 481 #define MAYBE_DesiredTLD DISABLED_DesiredTLD |
| 482 #else | 482 #else |
| 483 #define MAYBE_DesiredTLD DesiredTLD | 483 #define MAYBE_DesiredTLD DesiredTLD |
| 484 #endif | 484 #endif |
| 485 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, MAYBE_DesiredTLD) { | 485 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, MAYBE_DesiredTLD) { |
| 486 ASSERT_NO_FATAL_FAILURE(SetupComponents()); | 486 ASSERT_NO_FATAL_FAILURE(SetupComponents()); |
| 487 browser()->FocusLocationBar(); | 487 browser()->FocusLocationBar(); |
| 488 | 488 |
| 489 AutocompleteEditView* edit_view = NULL; | 489 AutocompleteEditView* edit_view = NULL; |
| 490 ASSERT_NO_FATAL_FAILURE(GetAutocompleteEditView(&edit_view)); | 490 ASSERT_NO_FATAL_FAILURE(GetAutocompleteEditView(&edit_view)); |
| 491 AutocompletePopupModel* popup_model = edit_view->model()->popup_model(); | 491 AutocompletePopupModel* popup_model = edit_view->model()->popup_model(); |
| 492 ASSERT_TRUE(popup_model); | 492 ASSERT_TRUE(popup_model); |
| 493 | 493 |
| 494 // Test ctrl-Enter. | 494 // Test ctrl-Enter. |
| 495 ASSERT_NO_FATAL_FAILURE(SendKeySequence(kDesiredTLDKeys)); | 495 ASSERT_NO_FATAL_FAILURE(SendKeySequence(kDesiredTLDKeys)); |
| 496 ASSERT_NO_FATAL_FAILURE(WaitForAutocompleteControllerDone()); | 496 ASSERT_NO_FATAL_FAILURE(WaitForAutocompleteControllerDone()); |
| 497 ASSERT_TRUE(popup_model->IsOpen()); | 497 ASSERT_TRUE(popup_model->IsOpen()); |
| 498 // ctrl-Enter triggers desired_tld feature, thus www.bar.com shall be opened. | 498 // ctrl-Enter triggers desired_tld feature, thus www.bar.com shall be opened. |
| 499 ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_RETURN, true, false, false)); | 499 ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_RETURN, true, false, false)); |
| 500 | 500 |
| 501 GURL url = browser()->GetSelectedTabContents()->GetURL(); | 501 GURL url = browser()->GetSelectedTabContents()->GetURL(); |
| 502 EXPECT_STREQ(kDesiredTLDHostname, url.host().c_str()); | 502 EXPECT_STREQ(kDesiredTLDHostname, url.host().c_str()); |
| 503 } | 503 } |
| 504 | 504 |
| 505 // FAILS on windows, http://crbug.com/57965 | 505 // Sometimes times out on Windows: http://crbug.com/57965 |
| 506 #if defined(OS_WIN) | 506 #if defined(OS_WIN) |
| 507 #define MAYBE_AltEnter DISABLED_AltEnter | 507 #define MAYBE_AltEnter DISABLED_AltEnter |
| 508 #else | 508 #else |
| 509 #define MAYBE_AltEnter AltEnter | 509 #define MAYBE_AltEnter AltEnter |
| 510 #endif | 510 #endif |
| 511 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, MAYBE_AltEnter) { | 511 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, MAYBE_AltEnter) { |
| 512 ASSERT_NO_FATAL_FAILURE(SetupComponents()); | 512 ASSERT_NO_FATAL_FAILURE(SetupComponents()); |
| 513 browser()->FocusLocationBar(); | 513 browser()->FocusLocationBar(); |
| 514 | 514 |
| 515 AutocompleteEditView* edit_view = NULL; | 515 AutocompleteEditView* edit_view = NULL; |
| 516 ASSERT_NO_FATAL_FAILURE(GetAutocompleteEditView(&edit_view)); | 516 ASSERT_NO_FATAL_FAILURE(GetAutocompleteEditView(&edit_view)); |
| 517 | 517 |
| 518 edit_view->SetUserText(ASCIIToWide(chrome::kChromeUIHistoryURL)); | 518 edit_view->SetUserText(ASCIIToWide(chrome::kChromeUIHistoryURL)); |
| 519 int tab_count = browser()->tab_count(); | 519 int tab_count = browser()->tab_count(); |
| 520 // alt-Enter opens a new tab. | 520 // alt-Enter opens a new tab. |
| 521 ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_RETURN, false, false, true)); | 521 ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_RETURN, false, false, true)); |
| 522 ASSERT_NO_FATAL_FAILURE(WaitForTabOpenOrClose(tab_count + 1)); | 522 ASSERT_NO_FATAL_FAILURE(WaitForTabOpenOrClose(tab_count + 1)); |
| 523 } | 523 } |
| 524 | 524 |
| 525 // FAILS on windows, http://crbug.com/57965 | 525 // Sometimes times out on Windows: http://crbug.com/57965 |
| 526 #if defined(OS_WIN) | 526 #if defined(OS_WIN) |
| 527 #define MAYBE_EnterToSearch DISABLED_EnterToSearch | 527 #define MAYBE_EnterToSearch DISABLED_EnterToSearch |
| 528 #else | 528 #else |
| 529 #define MAYBE_EnterToSearch EnterToSearch | 529 #define MAYBE_EnterToSearch EnterToSearch |
| 530 #endif | 530 #endif |
| 531 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, MAYBE_EnterToSearch) { | 531 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, MAYBE_EnterToSearch) { |
| 532 ASSERT_NO_FATAL_FAILURE(SetupHostResolver()); | 532 ASSERT_NO_FATAL_FAILURE(SetupHostResolver()); |
| 533 ASSERT_NO_FATAL_FAILURE(SetupSearchEngine()); | 533 ASSERT_NO_FATAL_FAILURE(SetupSearchEngine()); |
| 534 browser()->FocusLocationBar(); | 534 browser()->FocusLocationBar(); |
| 535 | 535 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 565 popup_model->result().default_match()->type); | 565 popup_model->result().default_match()->type); |
| 566 | 566 |
| 567 // Open the default match. | 567 // Open the default match. |
| 568 ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_RETURN, false, false, false)); | 568 ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_RETURN, false, false, false)); |
| 569 url = browser()->GetSelectedTabContents()->GetURL(); | 569 url = browser()->GetSelectedTabContents()->GetURL(); |
| 570 EXPECT_STREQ(kSearchSingleCharURL, url.spec().c_str()); | 570 EXPECT_STREQ(kSearchSingleCharURL, url.spec().c_str()); |
| 571 } | 571 } |
| 572 | 572 |
| 573 // See http://crbug.com/20934: Omnibox keyboard behavior wrong for | 573 // See http://crbug.com/20934: Omnibox keyboard behavior wrong for |
| 574 // "See recent pages in history" | 574 // "See recent pages in history" |
| 575 // FAILS on windows, http://crbug.com/57965 | 575 // Sometimes times out on Windows: http://crbug.com/57965 |
| 576 #if defined(OS_WIN) | 576 #if defined(OS_WIN) |
| 577 #define MAYBE_EnterToOpenHistoryPage DISABLED_EnterToOpenHistoryPage | 577 #define MAYBE_EnterToOpenHistoryPage DISABLED_EnterToOpenHistoryPage |
| 578 #else | 578 #else |
| 579 #define MAYBE_EnterToOpenHistoryPage EnterToOpenHistoryPage | 579 #define MAYBE_EnterToOpenHistoryPage EnterToOpenHistoryPage |
| 580 #endif | 580 #endif |
| 581 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, MAYBE_EnterToOpenHistoryPage) { | 581 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, MAYBE_EnterToOpenHistoryPage) { |
| 582 ASSERT_NO_FATAL_FAILURE(SetupComponents()); | 582 ASSERT_NO_FATAL_FAILURE(SetupComponents()); |
| 583 browser()->FocusLocationBar(); | 583 browser()->FocusLocationBar(); |
| 584 | 584 |
| 585 AutocompleteEditView* edit_view = NULL; | 585 AutocompleteEditView* edit_view = NULL; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 608 // Make sure the history page item is selected. | 608 // Make sure the history page item is selected. |
| 609 ASSERT_EQ(AutocompleteMatch::OPEN_HISTORY_PAGE, | 609 ASSERT_EQ(AutocompleteMatch::OPEN_HISTORY_PAGE, |
| 610 popup_model->result().match_at(popup_model->selected_line()).type); | 610 popup_model->result().match_at(popup_model->selected_line()).type); |
| 611 | 611 |
| 612 // Open the history page item. | 612 // Open the history page item. |
| 613 ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_RETURN, false, false, false)); | 613 ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_RETURN, false, false, false)); |
| 614 GURL url = browser()->GetSelectedTabContents()->GetURL(); | 614 GURL url = browser()->GetSelectedTabContents()->GetURL(); |
| 615 EXPECT_STREQ(kHistoryPageURL, url.spec().c_str()); | 615 EXPECT_STREQ(kHistoryPageURL, url.spec().c_str()); |
| 616 } | 616 } |
| 617 | 617 |
| 618 // FAILS on windows, http://crbug.com/57965 | 618 // Sometimes times out on Windows: http://crbug.com/57965 |
| 619 #if defined(OS_WIN) | 619 #if defined(OS_WIN) |
| 620 #define MAYBE_EscapeToDefaultMatch DISABLED_EscapeToDefaultMatch | 620 #define MAYBE_EscapeToDefaultMatch DISABLED_EscapeToDefaultMatch |
| 621 #else | 621 #else |
| 622 #define MAYBE_EscapeToDefaultMatch EscapeToDefaultMatch | 622 #define MAYBE_EscapeToDefaultMatch EscapeToDefaultMatch |
| 623 #endif | 623 #endif |
| 624 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, MAYBE_EscapeToDefaultMatch) { | 624 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, MAYBE_EscapeToDefaultMatch) { |
| 625 ASSERT_NO_FATAL_FAILURE(SetupComponents()); | 625 ASSERT_NO_FATAL_FAILURE(SetupComponents()); |
| 626 browser()->FocusLocationBar(); | 626 browser()->FocusLocationBar(); |
| 627 | 627 |
| 628 AutocompleteEditView* edit_view = NULL; | 628 AutocompleteEditView* edit_view = NULL; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 653 } | 653 } |
| 654 | 654 |
| 655 EXPECT_NE(old_text, edit_view->GetText()); | 655 EXPECT_NE(old_text, edit_view->GetText()); |
| 656 | 656 |
| 657 // Escape shall revert back to the default match item. | 657 // Escape shall revert back to the default match item. |
| 658 ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_ESCAPE, false, false, false)); | 658 ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_ESCAPE, false, false, false)); |
| 659 EXPECT_EQ(old_text, edit_view->GetText()); | 659 EXPECT_EQ(old_text, edit_view->GetText()); |
| 660 EXPECT_EQ(old_selected_line, popup_model->selected_line()); | 660 EXPECT_EQ(old_selected_line, popup_model->selected_line()); |
| 661 } | 661 } |
| 662 | 662 |
| 663 // Disabled, http://crbug.com/62935. | 663 // Sometimes times out on Windows: http://crbug.com/57965 |
| 664 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, DISABLED_BasicTextOperations) { | 664 #if defined(OS_WIN) |
| 665 #define MAYBE_BasicTextOperations DISABLED_BasicTextOperations |
| 666 #else |
| 667 #define MAYBE_BasicTextOperations BasicTextOperations |
| 668 #endif |
| 669 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, MAYBE_BasicTextOperations) { |
| 665 ASSERT_NO_FATAL_FAILURE(SetupComponents()); | 670 ASSERT_NO_FATAL_FAILURE(SetupComponents()); |
| 666 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kAboutBlankURL)); | 671 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kAboutBlankURL)); |
| 667 browser()->FocusLocationBar(); | 672 browser()->FocusLocationBar(); |
| 668 | 673 |
| 669 AutocompleteEditView* edit_view = NULL; | 674 AutocompleteEditView* edit_view = NULL; |
| 670 ASSERT_NO_FATAL_FAILURE(GetAutocompleteEditView(&edit_view)); | 675 ASSERT_NO_FATAL_FAILURE(GetAutocompleteEditView(&edit_view)); |
| 671 | 676 |
| 672 std::wstring old_text = edit_view->GetText(); | 677 std::wstring old_text = edit_view->GetText(); |
| 673 EXPECT_EQ(UTF8ToWide(chrome::kAboutBlankURL), old_text); | 678 EXPECT_EQ(UTF8ToWide(chrome::kAboutBlankURL), old_text); |
| 674 EXPECT_TRUE(edit_view->IsSelectAll()); | 679 EXPECT_TRUE(edit_view->IsSelectAll()); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 | 783 |
| 779 // Undo delete two characters. | 784 // Undo delete two characters. |
| 780 ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_Z, true, false, false)); | 785 ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_Z, true, false, false)); |
| 781 EXPECT_EQ(old_text, edit_view->GetText()); | 786 EXPECT_EQ(old_text, edit_view->GetText()); |
| 782 | 787 |
| 783 // Undo again. | 788 // Undo again. |
| 784 ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_Z, true, false, false)); | 789 ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_Z, true, false, false)); |
| 785 EXPECT_TRUE(edit_view->GetText().empty()); | 790 EXPECT_TRUE(edit_view->GetText().empty()); |
| 786 } | 791 } |
| 787 #endif | 792 #endif |
| OLD | NEW |