Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: chrome/browser/autocomplete/autocomplete_edit_view_browsertest.cc

Issue 223021: Enable disabled autocomplete edit view tests.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 // Delete all text in omnibox. 376 // Delete all text in omnibox.
377 ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_BACK, false, false, false)); 377 ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_BACK, false, false, false));
378 EXPECT_TRUE(edit_view->GetText().empty()); 378 EXPECT_TRUE(edit_view->GetText().empty());
379 379
380 // Escape shall revert the text in omnibox. 380 // Escape shall revert the text in omnibox.
381 ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_ESCAPE, false, false, false)); 381 ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_ESCAPE, false, false, false));
382 EXPECT_EQ(old_text, edit_view->GetText()); 382 EXPECT_EQ(old_text, edit_view->GetText());
383 EXPECT_TRUE(edit_view->IsSelectAll()); 383 EXPECT_TRUE(edit_view->IsSelectAll());
384 } 384 }
385 385
386 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, DISABLED_DesiredTLD) { 386 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, DesiredTLD) {
387 ASSERT_NO_FATAL_FAILURE(SetupHostResolver()); 387 ASSERT_NO_FATAL_FAILURE(SetupHostResolver());
388 ASSERT_NO_FATAL_FAILURE(SetupSearchEngine()); 388 ASSERT_NO_FATAL_FAILURE(SetupSearchEngine());
389 browser()->FocusLocationBar(); 389 browser()->FocusLocationBar();
390 390
391 AutocompleteEditView* edit_view = NULL; 391 AutocompleteEditView* edit_view = NULL;
392 ASSERT_NO_FATAL_FAILURE(GetAutocompleteEditView(&edit_view)); 392 ASSERT_NO_FATAL_FAILURE(GetAutocompleteEditView(&edit_view));
393 AutocompletePopupModel* popup_model = edit_view->model()->popup_model(); 393 AutocompletePopupModel* popup_model = edit_view->model()->popup_model();
394 ASSERT_TRUE(popup_model); 394 ASSERT_TRUE(popup_model);
395 395
396 // Test ctrl-Enter. 396 // Test ctrl-Enter.
397 ASSERT_NO_FATAL_FAILURE(SendKeySequence(kDesiredTLDKeys)); 397 ASSERT_NO_FATAL_FAILURE(SendKeySequence(kDesiredTLDKeys));
398 ASSERT_NO_FATAL_FAILURE(WaitForAutocompleteControllerDone()); 398 ASSERT_NO_FATAL_FAILURE(WaitForAutocompleteControllerDone());
399 ASSERT_TRUE(popup_model->IsOpen()); 399 ASSERT_TRUE(popup_model->IsOpen());
400 // ctrl-Enter triggers desired_tld feature, thus www.bar.com shall be opened. 400 // ctrl-Enter triggers desired_tld feature, thus www.bar.com shall be opened.
401 ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_RETURN, true, false, false)); 401 ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_RETURN, true, false, false));
402 402
403 GURL url = browser()->GetSelectedTabContents()->GetURL(); 403 GURL url = browser()->GetSelectedTabContents()->GetURL();
404 EXPECT_STREQ(kDesiredTLDHostname, url.host().c_str()); 404 EXPECT_STREQ(kDesiredTLDHostname, url.host().c_str());
405 } 405 }
406 406
407 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, DISABLED_AltEnter) { 407 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, AltEnter) {
408 ASSERT_NO_FATAL_FAILURE(SetupHostResolver()); 408 ASSERT_NO_FATAL_FAILURE(SetupHostResolver());
409 browser()->FocusLocationBar(); 409 browser()->FocusLocationBar();
410 410
411 AutocompleteEditView* edit_view = NULL; 411 AutocompleteEditView* edit_view = NULL;
412 ASSERT_NO_FATAL_FAILURE(GetAutocompleteEditView(&edit_view)); 412 ASSERT_NO_FATAL_FAILURE(GetAutocompleteEditView(&edit_view));
413 413
414 edit_view->SetUserText(L"chrome://history/"); 414 edit_view->SetUserText(L"chrome://history/");
415 int tab_count = browser()->tab_count(); 415 int tab_count = browser()->tab_count();
416 // alt-Enter opens a new tab. 416 // alt-Enter opens a new tab.
417 ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_RETURN, false, false, true)); 417 ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_RETURN, false, false, true));
418 ASSERT_NO_FATAL_FAILURE(WaitForTabOpenOrClose(tab_count + 1)); 418 ASSERT_NO_FATAL_FAILURE(WaitForTabOpenOrClose(tab_count + 1));
419 } 419 }
420 420
421 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, DISABLED_EnterToSearch) { 421 IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, EnterToSearch) {
422 ASSERT_NO_FATAL_FAILURE(SetupHostResolver()); 422 ASSERT_NO_FATAL_FAILURE(SetupHostResolver());
423 ASSERT_NO_FATAL_FAILURE(SetupSearchEngine()); 423 ASSERT_NO_FATAL_FAILURE(SetupSearchEngine());
424 browser()->FocusLocationBar(); 424 browser()->FocusLocationBar();
425 425
426 AutocompleteEditView* edit_view = NULL; 426 AutocompleteEditView* edit_view = NULL;
427 ASSERT_NO_FATAL_FAILURE(GetAutocompleteEditView(&edit_view)); 427 ASSERT_NO_FATAL_FAILURE(GetAutocompleteEditView(&edit_view));
428 AutocompletePopupModel* popup_model = edit_view->model()->popup_model(); 428 AutocompletePopupModel* popup_model = edit_view->model()->popup_model();
429 ASSERT_TRUE(popup_model); 429 ASSERT_TRUE(popup_model);
430 430
431 // Test Enter to search. 431 // Test Enter to search.
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 break; 535 break;
536 } 536 }
537 537
538 EXPECT_NE(old_text, edit_view->GetText()); 538 EXPECT_NE(old_text, edit_view->GetText());
539 539
540 // Escape shall revert back to the default match item. 540 // Escape shall revert back to the default match item.
541 ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_ESCAPE, false, false, false)); 541 ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_ESCAPE, false, false, false));
542 EXPECT_EQ(old_text, edit_view->GetText()); 542 EXPECT_EQ(old_text, edit_view->GetText());
543 EXPECT_EQ(old_selected_line, popup_model->selected_line()); 543 EXPECT_EQ(old_selected_line, popup_model->selected_line());
544 } 544 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698