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 "base/macros.h" | 5 #include "base/macros.h" |
6 #include "base/strings/string_util.h" | 6 #include "base/strings/string_util.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 EXPECT_TRUE(IsViewFocused(browser(), VIEW_ID_FIND_IN_PAGE_TEXT_FIELD)); | 491 EXPECT_TRUE(IsViewFocused(browser(), VIEW_ID_FIND_IN_PAGE_TEXT_FIELD)); |
492 | 492 |
493 // Search for "a". | 493 // Search for "a". |
494 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( | 494 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( |
495 browser(), ui::VKEY_A, false, false, false, false)); | 495 browser(), ui::VKEY_A, false, false, false, false)); |
496 | 496 |
497 // We should find "a" here. | 497 // We should find "a" here. |
498 EXPECT_EQ(ASCIIToUTF16("a"), GetFindBarText()); | 498 EXPECT_EQ(ASCIIToUTF16("a"), GetFindBarText()); |
499 | 499 |
500 // Reload the page to clear the matching result. | 500 // Reload the page to clear the matching result. |
501 chrome::Reload(browser(), CURRENT_TAB); | 501 chrome::Reload(browser(), WindowOpenDisposition::CURRENT_TAB); |
502 | 502 |
503 // Focus the Find bar again to make sure the text is selected. | 503 // Focus the Find bar again to make sure the text is selected. |
504 browser()->GetFindBarController()->Show(); | 504 browser()->GetFindBarController()->Show(); |
505 | 505 |
506 EXPECT_TRUE(IsViewFocused(browser(), VIEW_ID_FIND_IN_PAGE_TEXT_FIELD)); | 506 EXPECT_TRUE(IsViewFocused(browser(), VIEW_ID_FIND_IN_PAGE_TEXT_FIELD)); |
507 | 507 |
508 // "a" should be selected. | 508 // "a" should be selected. |
509 EXPECT_EQ(ASCIIToUTF16("a"), GetFindBarSelectedText()); | 509 EXPECT_EQ(ASCIIToUTF16("a"), GetFindBarSelectedText()); |
510 | 510 |
511 // Press Ctrl-C to copy the content. | 511 // Press Ctrl-C to copy the content. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 ui_test_utils::UrlLoadObserver observer( | 552 ui_test_utils::UrlLoadObserver observer( |
553 GURL("about:blank"), content::NotificationService::AllSources()); | 553 GURL("about:blank"), content::NotificationService::AllSources()); |
554 | 554 |
555 // Send Ctrl-Enter, should cause navigation to about:blank. | 555 // Send Ctrl-Enter, should cause navigation to about:blank. |
556 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( | 556 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( |
557 browser(), ui::VKEY_RETURN, true, false, false, false)); | 557 browser(), ui::VKEY_RETURN, true, false, false, false)); |
558 | 558 |
559 observer.Wait(); | 559 observer.Wait(); |
560 } | 560 } |
561 #endif | 561 #endif |
OLD | NEW |