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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 AutocompleteEditView* edit_view = NULL; | 385 AutocompleteEditView* edit_view = NULL; |
386 ASSERT_NO_FATAL_FAILURE(GetAutocompleteEditView(&edit_view)); | 386 ASSERT_NO_FATAL_FAILURE(GetAutocompleteEditView(&edit_view)); |
387 | 387 |
388 edit_view->SetUserText(L"chrome://history/"); | 388 edit_view->SetUserText(L"chrome://history/"); |
389 int tab_count = browser()->tab_count(); | 389 int tab_count = browser()->tab_count(); |
390 // alt-Enter opens a new tab. | 390 // alt-Enter opens a new tab. |
391 ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_RETURN, false, false, true)); | 391 ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_RETURN, false, false, true)); |
392 ASSERT_NO_FATAL_FAILURE(WaitForTabOpenOrClose(tab_count + 1)); | 392 ASSERT_NO_FATAL_FAILURE(WaitForTabOpenOrClose(tab_count + 1)); |
393 } | 393 } |
394 | 394 |
395 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, EnterToSearch) { | 395 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, DISABLED_EnterToSearch) { |
396 ASSERT_NO_FATAL_FAILURE(SetupHostResolver()); | 396 ASSERT_NO_FATAL_FAILURE(SetupHostResolver()); |
397 ASSERT_NO_FATAL_FAILURE(SetupSearchEngine()); | 397 ASSERT_NO_FATAL_FAILURE(SetupSearchEngine()); |
398 browser()->FocusLocationBar(); | 398 browser()->FocusLocationBar(); |
399 | 399 |
400 AutocompleteEditView* edit_view = NULL; | 400 AutocompleteEditView* edit_view = NULL; |
401 ASSERT_NO_FATAL_FAILURE(GetAutocompleteEditView(&edit_view)); | 401 ASSERT_NO_FATAL_FAILURE(GetAutocompleteEditView(&edit_view)); |
402 AutocompletePopupModel* popup_model = edit_view->model()->popup_model(); | 402 AutocompletePopupModel* popup_model = edit_view->model()->popup_model(); |
403 ASSERT_TRUE(popup_model); | 403 ASSERT_TRUE(popup_model); |
404 | 404 |
405 // Test Enter to search. | 405 // Test Enter to search. |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 break; | 492 break; |
493 } | 493 } |
494 | 494 |
495 EXPECT_NE(old_text, edit_view->GetText()); | 495 EXPECT_NE(old_text, edit_view->GetText()); |
496 | 496 |
497 // Escape shall revert back to the default match item. | 497 // Escape shall revert back to the default match item. |
498 ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_ESCAPE, false, false, false)); | 498 ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_ESCAPE, false, false, false)); |
499 EXPECT_EQ(old_text, edit_view->GetText()); | 499 EXPECT_EQ(old_text, edit_view->GetText()); |
500 EXPECT_EQ(old_selected_line, popup_model->selected_line()); | 500 EXPECT_EQ(old_selected_line, popup_model->selected_line()); |
501 } | 501 } |
OLD | NEW |