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

Side by Side Diff: chrome/browser/ui/omnibox/omnibox_view_browsertest.cc

Issue 10412009: Enable disabled omnibox tests on aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 7 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 | chrome/browser/ui/views/omnibox/omnibox_view_views.cc » ('j') | 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) 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 <stdio.h> 5 #include <stdio.h>
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/string16.h" 8 #include "base/string16.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after
1385 IN_PROC_BROWSER_TEST_F(OmniboxViewTest, 1385 IN_PROC_BROWSER_TEST_F(OmniboxViewTest,
1386 PersistKeywordModeOnTabSwitch) { 1386 PersistKeywordModeOnTabSwitch) {
1387 PersistKeywordModeOnTabSwitch(); 1387 PersistKeywordModeOnTabSwitch();
1388 } 1388 }
1389 1389
1390 IN_PROC_BROWSER_TEST_F(OmniboxViewTest, 1390 IN_PROC_BROWSER_TEST_F(OmniboxViewTest,
1391 CtrlKeyPressedWithInlineAutocompleteTest) { 1391 CtrlKeyPressedWithInlineAutocompleteTest) {
1392 CtrlKeyPressedWithInlineAutocompleteTest(); 1392 CtrlKeyPressedWithInlineAutocompleteTest();
1393 } 1393 }
1394 1394
1395 #if defined(TOOLKIT_GTK) 1395 #if defined(TOOLKIT_GTK) || defined(USE_AURA)
1396 // TODO(oshima): enable these tests for views-implmentation when 1396 IN_PROC_BROWSER_TEST_F(OmniboxViewTest, UndoRedo) {
1397 // these featuers are supported. http://crbug.com/121558.
1398
1399 IN_PROC_BROWSER_TEST_F(OmniboxViewTest, UndoRedoLinux) {
1400 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kAboutBlankURL)); 1397 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kAboutBlankURL));
1401 browser()->FocusLocationBar(); 1398 browser()->FocusLocationBar();
1402 1399
1403 OmniboxView* omnibox_view = NULL; 1400 OmniboxView* omnibox_view = NULL;
1404 ASSERT_NO_FATAL_FAILURE(GetOmniboxView(&omnibox_view)); 1401 ASSERT_NO_FATAL_FAILURE(GetOmniboxView(&omnibox_view));
1405 1402
1406 string16 old_text = omnibox_view->GetText(); 1403 string16 old_text = omnibox_view->GetText();
1407 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL), old_text); 1404 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL), old_text);
1408 EXPECT_TRUE(omnibox_view->IsSelectAll()); 1405 EXPECT_TRUE(omnibox_view->IsSelectAll());
1409 1406
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1454 1451
1455 // Undo delete two characters. 1452 // Undo delete two characters.
1456 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_Z, ui::EF_CONTROL_DOWN)); 1453 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_Z, ui::EF_CONTROL_DOWN));
1457 EXPECT_EQ(old_text, omnibox_view->GetText()); 1454 EXPECT_EQ(old_text, omnibox_view->GetText());
1458 1455
1459 // Undo again. 1456 // Undo again.
1460 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_Z, ui::EF_CONTROL_DOWN)); 1457 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_Z, ui::EF_CONTROL_DOWN));
1461 EXPECT_TRUE(omnibox_view->GetText().empty()); 1458 EXPECT_TRUE(omnibox_view->GetText().empty());
1462 } 1459 }
1463 1460
1461 // See http://crosbug.com/10306
1462 IN_PROC_BROWSER_TEST_F(OmniboxViewTest,
1463 BackspaceDeleteHalfWidthKatakana) {
1464 OmniboxView* omnibox_view = NULL;
1465 ASSERT_NO_FATAL_FAILURE(GetOmniboxView(&omnibox_view));
1466 // Insert text: ダ
1467 omnibox_view->SetUserText(UTF8ToUTF16("\357\276\200\357\276\236"));
1468
1469 // Move the cursor to the end.
1470 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_END, 0));
1471
1472 // Backspace should delete one character.
1473 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_BACK, 0));
1474 EXPECT_EQ(UTF8ToUTF16("\357\276\200"), omnibox_view->GetText());
1475 }
1476
1477 #endif // defined(TOOLKIT_GTK) || defined(USE_AURA)
1478
1479 #if defined(TOOLKIT_GTK)
1464 // See http://crbug.com/63860 1480 // See http://crbug.com/63860
1465 IN_PROC_BROWSER_TEST_F(OmniboxViewTest, PrimarySelection) { 1481 IN_PROC_BROWSER_TEST_F(OmniboxViewTest, PrimarySelection) {
1466 OmniboxView* omnibox_view = NULL; 1482 OmniboxView* omnibox_view = NULL;
1467 ASSERT_NO_FATAL_FAILURE(GetOmniboxView(&omnibox_view)); 1483 ASSERT_NO_FATAL_FAILURE(GetOmniboxView(&omnibox_view));
1468 omnibox_view->SetUserText(ASCIIToUTF16("Hello world")); 1484 omnibox_view->SetUserText(ASCIIToUTF16("Hello world"));
1469 EXPECT_FALSE(omnibox_view->IsSelectAll()); 1485 EXPECT_FALSE(omnibox_view->IsSelectAll());
1470 1486
1471 // Move the cursor to the end. 1487 // Move the cursor to the end.
1472 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_END, 0)); 1488 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_END, 0));
1473 1489
1474 // Select all text by pressing Shift+Home 1490 // Select all text by pressing Shift+Home
1475 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_HOME, ui::EF_SHIFT_DOWN)); 1491 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_HOME, ui::EF_SHIFT_DOWN));
1476 EXPECT_TRUE(omnibox_view->IsSelectAll()); 1492 EXPECT_TRUE(omnibox_view->IsSelectAll());
1477 1493
1478 // The selected content should be saved to the PRIMARY clipboard. 1494 // The selected content should be saved to the PRIMARY clipboard.
1479 EXPECT_EQ("Hello world", GetPrimarySelectionText()); 1495 EXPECT_EQ("Hello world", GetPrimarySelectionText());
1480 1496
1481 // Move the cursor to the end. 1497 // Move the cursor to the end.
1482 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_END, 0)); 1498 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_END, 0));
1483 EXPECT_FALSE(omnibox_view->IsSelectAll()); 1499 EXPECT_FALSE(omnibox_view->IsSelectAll());
1484 1500
1485 // The content in the PRIMARY clipboard should not be cleared. 1501 // The content in the PRIMARY clipboard should not be cleared.
1486 EXPECT_EQ("Hello world", GetPrimarySelectionText()); 1502 EXPECT_EQ("Hello world", GetPrimarySelectionText());
1487 } 1503 }
1488 1504
1489 // See http://crosbug.com/10306
1490 IN_PROC_BROWSER_TEST_F(OmniboxViewTest,
1491 BackspaceDeleteHalfWidthKatakana) {
1492 OmniboxView* omnibox_view = NULL;
1493 ASSERT_NO_FATAL_FAILURE(GetOmniboxView(&omnibox_view));
1494 // Insert text: ダ
1495 omnibox_view->SetUserText(UTF8ToUTF16("\357\276\200\357\276\236"));
1496
1497 // Move the cursor to the end.
1498 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_END, 0));
1499
1500 // Backspace should delete one character.
1501 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_BACK, 0));
1502 EXPECT_EQ(UTF8ToUTF16("\357\276\200"), omnibox_view->GetText());
1503 }
1504
1505 // http://crbug.com/12316 1505 // http://crbug.com/12316
1506 IN_PROC_BROWSER_TEST_F(OmniboxViewTest, PasteReplacingAll) { 1506 IN_PROC_BROWSER_TEST_F(OmniboxViewTest, PasteReplacingAll) {
1507 OmniboxView* omnibox_view = NULL; 1507 OmniboxView* omnibox_view = NULL;
1508 ASSERT_NO_FATAL_FAILURE(GetOmniboxView(&omnibox_view)); 1508 ASSERT_NO_FATAL_FAILURE(GetOmniboxView(&omnibox_view));
1509 AutocompletePopupModel* popup_model = omnibox_view->model()->popup_model(); 1509 AutocompletePopupModel* popup_model = omnibox_view->model()->popup_model();
1510 ASSERT_TRUE(popup_model); 1510 ASSERT_TRUE(popup_model);
1511 1511
1512 SetClipboardText(kSearchText); 1512 SetClipboardText(kSearchText);
1513 1513
1514 // Paste text. 1514 // Paste text.
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
1576 1576
1577 // Middle-clicking shouldn't select all the text either. 1577 // Middle-clicking shouldn't select all the text either.
1578 ASSERT_NO_FATAL_FAILURE( 1578 ASSERT_NO_FATAL_FAILURE(
1579 ClickFocusViewOrigin(ui_controls::LEFT, kClickOffset, kClickOffset)); 1579 ClickFocusViewOrigin(ui_controls::LEFT, kClickOffset, kClickOffset));
1580 ASSERT_NO_FATAL_FAILURE(ClickBrowserWindowCenter()); 1580 ASSERT_NO_FATAL_FAILURE(ClickBrowserWindowCenter());
1581 ASSERT_NO_FATAL_FAILURE( 1581 ASSERT_NO_FATAL_FAILURE(
1582 ClickFocusViewOrigin(ui_controls::MIDDLE, kClickOffset, kClickOffset)); 1582 ClickFocusViewOrigin(ui_controls::MIDDLE, kClickOffset, kClickOffset));
1583 EXPECT_FALSE(omnibox_view->IsSelectAll()); 1583 EXPECT_FALSE(omnibox_view->IsSelectAll());
1584 } 1584 }
1585 #endif // defined(USE_AURA) 1585 #endif // defined(USE_AURA)
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/omnibox/omnibox_view_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698