OLD | NEW |
---|---|
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 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
518 ASSERT_EQ(kSearchKeyword, UTF16ToUTF8(omnibox_view->model()->keyword())); | 518 ASSERT_EQ(kSearchKeyword, UTF16ToUTF8(omnibox_view->model()->keyword())); |
519 | 519 |
520 // Input something as search text. | 520 // Input something as search text. |
521 ASSERT_NO_FATAL_FAILURE(SendKeySequence(kSearchTextKeys)); | 521 ASSERT_NO_FATAL_FAILURE(SendKeySequence(kSearchTextKeys)); |
522 | 522 |
523 // Should stay in keyword mode while deleting search text by pressing | 523 // Should stay in keyword mode while deleting search text by pressing |
524 // backspace. | 524 // backspace. |
525 for (size_t i = 0; i < arraysize(kSearchText) - 1; ++i) { | 525 for (size_t i = 0; i < arraysize(kSearchText) - 1; ++i) { |
526 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_BACK, 0)); | 526 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_BACK, 0)); |
527 ASSERT_FALSE(omnibox_view->model()->is_keyword_hint()); | 527 ASSERT_FALSE(omnibox_view->model()->is_keyword_hint()); |
528 ASSERT_EQ(kSearchKeyword, UTF16ToUTF8(omnibox_view->model()->keyword())); | 528 ASSERT_EQ(kSearchKeyword, |
529 UTF16ToUTF8(omnibox_view->model()->keyword())); | |
Peter Kasting
2012/07/26 23:03:24
Nit: This change unnecessary
dominich
2012/07/27 20:33:54
Done.
| |
529 } | 530 } |
530 | 531 |
531 // Input something as search text. | 532 // Input something as search text. |
532 ASSERT_NO_FATAL_FAILURE(SendKeySequence(kSearchTextKeys)); | 533 ASSERT_NO_FATAL_FAILURE(SendKeySequence(kSearchTextKeys)); |
533 | 534 |
534 // Move cursor to the beginning of the search text. | 535 // Move cursor to the beginning of the search text. |
535 #if defined(OS_MACOSX) | 536 #if defined(OS_MACOSX) |
536 // Home doesn't work on Mac trybot. | 537 // Home doesn't work on Mac trybot. |
537 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_A, ui::EF_CONTROL_DOWN)); | 538 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_A, ui::EF_CONTROL_DOWN)); |
538 #else | 539 #else |
(...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1665 | 1666 |
1666 // Middle-clicking shouldn't select all the text either. | 1667 // Middle-clicking shouldn't select all the text either. |
1667 ASSERT_NO_FATAL_FAILURE( | 1668 ASSERT_NO_FATAL_FAILURE( |
1668 ClickFocusViewOrigin(ui_controls::LEFT, kClickOffset, kClickOffset)); | 1669 ClickFocusViewOrigin(ui_controls::LEFT, kClickOffset, kClickOffset)); |
1669 ASSERT_NO_FATAL_FAILURE(ClickBrowserWindowCenter()); | 1670 ASSERT_NO_FATAL_FAILURE(ClickBrowserWindowCenter()); |
1670 ASSERT_NO_FATAL_FAILURE( | 1671 ASSERT_NO_FATAL_FAILURE( |
1671 ClickFocusViewOrigin(ui_controls::MIDDLE, kClickOffset, kClickOffset)); | 1672 ClickFocusViewOrigin(ui_controls::MIDDLE, kClickOffset, kClickOffset)); |
1672 EXPECT_FALSE(omnibox_view->IsSelectAll()); | 1673 EXPECT_FALSE(omnibox_view->IsSelectAll()); |
1673 } | 1674 } |
1674 #endif // defined(USE_AURA) | 1675 #endif // defined(USE_AURA) |
OLD | NEW |