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 <mshtmcid.h> | 5 #include <mshtmcid.h> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/test/test_file_util.h" | 10 #include "base/test/test_file_util.h" |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 } | 477 } |
478 | 478 |
479 // Common helper function for "Save xxx As" tests. | 479 // Common helper function for "Save xxx As" tests. |
480 void DoSaveAsTest(const wchar_t* role, const wchar_t* menu_item_name, | 480 void DoSaveAsTest(const wchar_t* role, const wchar_t* menu_item_name, |
481 const wchar_t* file_ext) { | 481 const wchar_t* file_ext) { |
482 server_mock_.ExpectAndServeAnyRequests(CFInvocation::MetaTag()); | 482 server_mock_.ExpectAndServeAnyRequests(CFInvocation::MetaTag()); |
483 MockWindowObserver win_observer_mock; | 483 MockWindowObserver win_observer_mock; |
484 InSequence expect_in_sequence_for_scope; | 484 InSequence expect_in_sequence_for_scope; |
485 | 485 |
486 // Open 'Save As' dialog. | 486 // Open 'Save As' dialog. |
487 string16 initial_url(GetTestUrl(L"save_as_context_menu.html")); | 487 base::string16 initial_url(GetTestUrl(L"save_as_context_menu.html")); |
488 const char* kSaveDlgCaption = "Save As"; | 488 const char* kSaveDlgCaption = "Save As"; |
489 EXPECT_CALL(acc_observer_, | 489 EXPECT_CALL(acc_observer_, |
490 OnAccDocLoad(TabContentsTitleEq(initial_url, | 490 OnAccDocLoad(TabContentsTitleEq(initial_url, |
491 L"Save As download test"))) | 491 L"Save As download test"))) |
492 .WillOnce(testing::DoAll( | 492 .WillOnce(testing::DoAll( |
493 WatchWindow(&win_observer_mock, kSaveDlgCaption, ""), | 493 WatchWindow(&win_observer_mock, kSaveDlgCaption, ""), |
494 AccRightClick(AccObjectMatcher(L"", role)))); | 494 AccRightClick(AccObjectMatcher(L"", role)))); |
495 EXPECT_CALL(acc_observer_, OnMenuPopup(_)) | 495 EXPECT_CALL(acc_observer_, OnMenuPopup(_)) |
496 .WillOnce(AccLeftClick(AccObjectMatcher(menu_item_name))); | 496 .WillOnce(AccLeftClick(AccObjectMatcher(menu_item_name))); |
497 | 497 |
(...skipping 27 matching lines...) Expand all Loading... |
525 const std::wstring kTextFieldInitValue; | 525 const std::wstring kTextFieldInitValue; |
526 | 526 |
527 testing::NiceMock<MockAccEventObserver> acc_observer_; | 527 testing::NiceMock<MockAccEventObserver> acc_observer_; |
528 }; | 528 }; |
529 | 529 |
530 // Test reloading from the context menu. | 530 // Test reloading from the context menu. |
531 TEST_F(ContextMenuTest, CFReload) { | 531 TEST_F(ContextMenuTest, CFReload) { |
532 server_mock_.ExpectAndServeAnyRequests(CFInvocation::MetaTag()); | 532 server_mock_.ExpectAndServeAnyRequests(CFInvocation::MetaTag()); |
533 InSequence expect_in_sequence_for_scope; | 533 InSequence expect_in_sequence_for_scope; |
534 | 534 |
535 string16 initial_url(GetSimplePageUrl()); | 535 base::string16 initial_url(GetSimplePageUrl()); |
536 EXPECT_CALL(acc_observer_, | 536 EXPECT_CALL(acc_observer_, |
537 OnAccDocLoad(TabContentsTitleEq(initial_url, | 537 OnAccDocLoad(TabContentsTitleEq(initial_url, |
538 GetSimplePageTitle()))) | 538 GetSimplePageTitle()))) |
539 .WillOnce(OpenContextMenuAsync()); | 539 .WillOnce(OpenContextMenuAsync()); |
540 EXPECT_CALL(acc_observer_, OnMenuPopup(_)) | 540 EXPECT_CALL(acc_observer_, OnMenuPopup(_)) |
541 .WillOnce(AccLeftClick(AccObjectMatcher(L"Reload"))); | 541 .WillOnce(AccLeftClick(AccObjectMatcher(L"Reload"))); |
542 | 542 |
543 EXPECT_CALL(ie_mock_, OnLoad(IN_CF, StrEq(initial_url))) | 543 EXPECT_CALL(ie_mock_, OnLoad(IN_CF, StrEq(initial_url))) |
544 .WillOnce(CloseBrowserMock(&ie_mock_)); | 544 .WillOnce(CloseBrowserMock(&ie_mock_)); |
545 | 545 |
546 LaunchIEAndNavigate(initial_url); | 546 LaunchIEAndNavigate(initial_url); |
547 } | 547 } |
548 | 548 |
549 // Test view source from the context menu. | 549 // Test view source from the context menu. |
550 TEST_F(ContextMenuTest, CFViewSource) { | 550 TEST_F(ContextMenuTest, CFViewSource) { |
551 // Please see http://code.google.com/p/chromium/issues/detail?id=60987 | 551 // Please see http://code.google.com/p/chromium/issues/detail?id=60987 |
552 // for more information on why this test is disabled for Vista with IE7. | 552 // for more information on why this test is disabled for Vista with IE7. |
553 if (base::win::GetVersion() == base::win::VERSION_VISTA && | 553 if (base::win::GetVersion() == base::win::VERSION_VISTA && |
554 GetInstalledIEVersion() == IE_7) { | 554 GetInstalledIEVersion() == IE_7) { |
555 LOG(INFO) << "Not running test on Vista with IE7"; | 555 LOG(INFO) << "Not running test on Vista with IE7"; |
556 return; | 556 return; |
557 } | 557 } |
558 server_mock_.ExpectAndServeAnyRequests(CFInvocation::MetaTag()); | 558 server_mock_.ExpectAndServeAnyRequests(CFInvocation::MetaTag()); |
559 MockIEEventSink view_source_mock; | 559 MockIEEventSink view_source_mock; |
560 view_source_mock.ExpectAnyNavigations(); | 560 view_source_mock.ExpectAnyNavigations(); |
561 InSequence expect_in_sequence_for_scope; | 561 InSequence expect_in_sequence_for_scope; |
562 string16 initial_url(GetSimplePageUrl()); | 562 base::string16 initial_url(GetSimplePageUrl()); |
563 | 563 |
564 // View the page source. | 564 // View the page source. |
565 EXPECT_CALL(acc_observer_, | 565 EXPECT_CALL(acc_observer_, |
566 OnAccDocLoad(TabContentsTitleEq(initial_url, | 566 OnAccDocLoad(TabContentsTitleEq(initial_url, |
567 GetSimplePageTitle()))) | 567 GetSimplePageTitle()))) |
568 .WillOnce(OpenContextMenuAsync()); | 568 .WillOnce(OpenContextMenuAsync()); |
569 EXPECT_CALL(acc_observer_, OnMenuPopup(_)) | 569 EXPECT_CALL(acc_observer_, OnMenuPopup(_)) |
570 .WillOnce(AccLeftClick(AccObjectMatcher(L"View page source"))); | 570 .WillOnce(AccLeftClick(AccObjectMatcher(L"View page source"))); |
571 | 571 |
572 // Expect notification for view-source window, handle new window event | 572 // Expect notification for view-source window, handle new window event |
(...skipping 17 matching lines...) Expand all Loading... |
590 .Times(testing::AtMost(1)) | 590 .Times(testing::AtMost(1)) |
591 .WillOnce(CloseBrowserMock(&ie_mock_)); | 591 .WillOnce(CloseBrowserMock(&ie_mock_)); |
592 | 592 |
593 LaunchIEAndNavigate(initial_url); | 593 LaunchIEAndNavigate(initial_url); |
594 } | 594 } |
595 | 595 |
596 TEST_F(ContextMenuTest, DISABLED_CFPageInfo) { | 596 TEST_F(ContextMenuTest, DISABLED_CFPageInfo) { |
597 server_mock_.ExpectAndServeAnyRequests(CFInvocation::MetaTag()); | 597 server_mock_.ExpectAndServeAnyRequests(CFInvocation::MetaTag()); |
598 MockWindowObserver win_observer_mock; | 598 MockWindowObserver win_observer_mock; |
599 InSequence expect_in_sequence_for_scope; | 599 InSequence expect_in_sequence_for_scope; |
600 string16 initial_url(GetSimplePageUrl()); | 600 base::string16 initial_url(GetSimplePageUrl()); |
601 | 601 |
602 // View page information. | 602 // View page information. |
603 EXPECT_CALL(acc_observer_, | 603 EXPECT_CALL(acc_observer_, |
604 OnAccDocLoad(TabContentsTitleEq(initial_url, | 604 OnAccDocLoad(TabContentsTitleEq(initial_url, |
605 GetSimplePageTitle()))) | 605 GetSimplePageTitle()))) |
606 .WillOnce(testing::DoAll( | 606 .WillOnce(testing::DoAll( |
607 WatchWindow(&win_observer_mock, "", "Chrome_WidgetWin_*"), | 607 WatchWindow(&win_observer_mock, "", "Chrome_WidgetWin_*"), |
608 OpenContextMenuAsync())); | 608 OpenContextMenuAsync())); |
609 EXPECT_CALL(acc_observer_, OnMenuPopup(_)) | 609 EXPECT_CALL(acc_observer_, OnMenuPopup(_)) |
610 .WillOnce(AccLeftClick(AccObjectMatcher(L"View page info"))); | 610 .WillOnce(AccLeftClick(AccObjectMatcher(L"View page info"))); |
(...skipping 12 matching lines...) Expand all Loading... |
623 | 623 |
624 TEST_F(ContextMenuTest, CFInspector) { | 624 TEST_F(ContextMenuTest, CFInspector) { |
625 server_mock_.ExpectAndServeAnyRequests(CFInvocation::MetaTag()); | 625 server_mock_.ExpectAndServeAnyRequests(CFInvocation::MetaTag()); |
626 MockWindowObserver win_observer_mock; | 626 MockWindowObserver win_observer_mock; |
627 InSequence expect_in_sequence_for_scope; | 627 InSequence expect_in_sequence_for_scope; |
628 | 628 |
629 // Open developer tools. | 629 // Open developer tools. |
630 // Devtools begins life with "Untitled" caption and it changes | 630 // Devtools begins life with "Untitled" caption and it changes |
631 // later to the 'Developer Tools - <url> form. | 631 // later to the 'Developer Tools - <url> form. |
632 const char* kPageInfoCaptionPattern = "Untitled*"; | 632 const char* kPageInfoCaptionPattern = "Untitled*"; |
633 string16 initial_url(GetSimplePageUrl()); | 633 base::string16 initial_url(GetSimplePageUrl()); |
634 EXPECT_CALL(acc_observer_, | 634 EXPECT_CALL(acc_observer_, |
635 OnAccDocLoad(TabContentsTitleEq(initial_url, | 635 OnAccDocLoad(TabContentsTitleEq(initial_url, |
636 GetSimplePageTitle()))) | 636 GetSimplePageTitle()))) |
637 .WillOnce(testing::DoAll( | 637 .WillOnce(testing::DoAll( |
638 WatchWindow(&win_observer_mock, kPageInfoCaptionPattern, ""), | 638 WatchWindow(&win_observer_mock, kPageInfoCaptionPattern, ""), |
639 OpenContextMenuAsync())); | 639 OpenContextMenuAsync())); |
640 EXPECT_CALL(acc_observer_, OnMenuPopup(_)) | 640 EXPECT_CALL(acc_observer_, OnMenuPopup(_)) |
641 .WillOnce(AccLeftClick(AccObjectMatcher(L"Inspect element"))); | 641 .WillOnce(AccLeftClick(AccObjectMatcher(L"Inspect element"))); |
642 | 642 |
643 EXPECT_CALL(win_observer_mock, OnWindowOpen(_)) | 643 EXPECT_CALL(win_observer_mock, OnWindowOpen(_)) |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 GetInstalledIEVersion() == IE_7) { | 681 GetInstalledIEVersion() == IE_7) { |
682 LOG(INFO) << "Not running test on Vista with IE7"; | 682 LOG(INFO) << "Not running test on Vista with IE7"; |
683 return; | 683 return; |
684 } | 684 } |
685 server_mock_.ExpectAndServeAnyRequests(CFInvocation::MetaTag()); | 685 server_mock_.ExpectAndServeAnyRequests(CFInvocation::MetaTag()); |
686 const wchar_t* kAboutVersionUrl = L"gcf:about:version"; | 686 const wchar_t* kAboutVersionUrl = L"gcf:about:version"; |
687 const wchar_t* kAboutVersionWithoutProtoUrl = L"about:version"; | 687 const wchar_t* kAboutVersionWithoutProtoUrl = L"about:version"; |
688 MockIEEventSink new_window_mock; | 688 MockIEEventSink new_window_mock; |
689 new_window_mock.ExpectAnyNavigations(); | 689 new_window_mock.ExpectAnyNavigations(); |
690 InSequence expect_in_sequence_for_scope; | 690 InSequence expect_in_sequence_for_scope; |
691 string16 initial_url(GetSimplePageUrl()); | 691 base::string16 initial_url(GetSimplePageUrl()); |
692 | 692 |
693 EXPECT_CALL(acc_observer_, | 693 EXPECT_CALL(acc_observer_, |
694 OnAccDocLoad(TabContentsTitleEq(initial_url, | 694 OnAccDocLoad(TabContentsTitleEq(initial_url, |
695 GetSimplePageTitle()))) | 695 GetSimplePageTitle()))) |
696 .WillOnce(OpenContextMenuAsync()); | 696 .WillOnce(OpenContextMenuAsync()); |
697 EXPECT_CALL(acc_observer_, OnMenuPopup(_)) | 697 EXPECT_CALL(acc_observer_, OnMenuPopup(_)) |
698 .WillOnce(AccLeftClick(AccObjectMatcher(L"About*"))); | 698 .WillOnce(AccLeftClick(AccObjectMatcher(L"About*"))); |
699 | 699 |
700 ie_mock_.ExpectNewWindow(&new_window_mock); | 700 ie_mock_.ExpectNewWindow(&new_window_mock); |
701 // For some reason this happens occasionally at least on Win7 IE8. | 701 // For some reason this happens occasionally at least on Win7 IE8. |
702 EXPECT_CALL(new_window_mock, OnLoad(IN_IE, StrEq(kAboutVersionUrl))) | 702 EXPECT_CALL(new_window_mock, OnLoad(IN_IE, StrEq(kAboutVersionUrl))) |
703 .Times(testing::AtMost(1)); | 703 .Times(testing::AtMost(1)); |
704 EXPECT_CALL(new_window_mock, | 704 EXPECT_CALL(new_window_mock, |
705 OnLoad(IN_CF, StrEq(kAboutVersionWithoutProtoUrl))) | 705 OnLoad(IN_CF, StrEq(kAboutVersionWithoutProtoUrl))) |
706 .WillOnce(testing::DoAll( | 706 .WillOnce(testing::DoAll( |
707 VerifyAddressBarUrlWithGcf(&new_window_mock), | 707 VerifyAddressBarUrlWithGcf(&new_window_mock), |
708 CloseBrowserMock(&new_window_mock))); | 708 CloseBrowserMock(&new_window_mock))); |
709 | 709 |
710 EXPECT_CALL(new_window_mock, OnQuit()) | 710 EXPECT_CALL(new_window_mock, OnQuit()) |
711 .Times(testing::AtMost(1)) | 711 .Times(testing::AtMost(1)) |
712 .WillOnce(CloseBrowserMock(&ie_mock_)); | 712 .WillOnce(CloseBrowserMock(&ie_mock_)); |
713 | 713 |
714 LaunchIEAndNavigate(initial_url); | 714 LaunchIEAndNavigate(initial_url); |
715 } | 715 } |
716 | 716 |
717 TEST_F(ContextMenuTest, IEOpen) { | 717 TEST_F(ContextMenuTest, IEOpen) { |
718 server_mock_.ExpectAndServeAnyRequests(CFInvocation::None()); | 718 server_mock_.ExpectAndServeAnyRequests(CFInvocation::None()); |
719 InSequence expect_in_sequence_for_scope; | 719 InSequence expect_in_sequence_for_scope; |
720 string16 initial_url(GetLinkPageUrl()); | 720 base::string16 initial_url(GetLinkPageUrl()); |
721 | 721 |
722 // Open the link through the context menu. | 722 // Open the link through the context menu. |
723 EXPECT_CALL(acc_observer_, | 723 EXPECT_CALL(acc_observer_, |
724 OnAccDocLoad(TabContentsTitleEq(initial_url, GetLinkPageTitle()))) | 724 OnAccDocLoad(TabContentsTitleEq(initial_url, GetLinkPageTitle()))) |
725 .WillOnce(AccRightClick(AccObjectMatcher(L"", L"link"))); | 725 .WillOnce(AccRightClick(AccObjectMatcher(L"", L"link"))); |
726 EXPECT_CALL(acc_observer_, OnMenuPopup(_)) | 726 EXPECT_CALL(acc_observer_, OnMenuPopup(_)) |
727 .WillOnce(AccLeftClick(AccObjectMatcher(L"Open"))); | 727 .WillOnce(AccLeftClick(AccObjectMatcher(L"Open"))); |
728 | 728 |
729 EXPECT_CALL(ie_mock_, OnLoad(IN_IE, StrEq(GetSimplePageUrl()))) | 729 EXPECT_CALL(ie_mock_, OnLoad(IN_IE, StrEq(GetSimplePageUrl()))) |
730 .WillOnce(testing::DoAll( | 730 .WillOnce(testing::DoAll( |
731 VerifyAddressBarUrl(&ie_mock_), | 731 VerifyAddressBarUrl(&ie_mock_), |
732 CloseBrowserMock(&ie_mock_))); | 732 CloseBrowserMock(&ie_mock_))); |
733 | 733 |
734 LaunchIEAndNavigate(initial_url); | 734 LaunchIEAndNavigate(initial_url); |
735 } | 735 } |
736 | 736 |
737 TEST_F(ContextMenuTest, IEOpenInNewWindow) { | 737 TEST_F(ContextMenuTest, IEOpenInNewWindow) { |
738 // See crbug.com/64794. | 738 // See crbug.com/64794. |
739 if (GetInstalledIEVersion() == IE_7) { | 739 if (GetInstalledIEVersion() == IE_7) { |
740 LOG(INFO) << "Not running test with IE7"; | 740 LOG(INFO) << "Not running test with IE7"; |
741 return; | 741 return; |
742 } | 742 } |
743 server_mock_.ExpectAndServeAnyRequests(CFInvocation::None()); | 743 server_mock_.ExpectAndServeAnyRequests(CFInvocation::None()); |
744 MockIEEventSink new_window_mock; | 744 MockIEEventSink new_window_mock; |
745 new_window_mock.ExpectAnyNavigations(); | 745 new_window_mock.ExpectAnyNavigations(); |
746 InSequence expect_in_sequence_for_scope; | 746 InSequence expect_in_sequence_for_scope; |
747 string16 initial_url(GetLinkPageUrl()); | 747 base::string16 initial_url(GetLinkPageUrl()); |
748 | 748 |
749 // Open the link in a new window. | 749 // Open the link in a new window. |
750 EXPECT_CALL(acc_observer_, | 750 EXPECT_CALL(acc_observer_, |
751 OnAccDocLoad(TabContentsTitleEq(initial_url, GetLinkPageTitle()))) | 751 OnAccDocLoad(TabContentsTitleEq(initial_url, GetLinkPageTitle()))) |
752 .WillOnce(AccRightClick(AccObjectMatcher(L"", L"link"))); | 752 .WillOnce(AccRightClick(AccObjectMatcher(L"", L"link"))); |
753 EXPECT_CALL(acc_observer_, OnMenuPopup(_)) | 753 EXPECT_CALL(acc_observer_, OnMenuPopup(_)) |
754 .WillOnce(AccLeftClick(AccObjectMatcher(L"Open in New Window"))); | 754 .WillOnce(AccLeftClick(AccObjectMatcher(L"Open in New Window"))); |
755 | 755 |
756 ie_mock_.ExpectNewWindow(&new_window_mock); | 756 ie_mock_.ExpectNewWindow(&new_window_mock); |
757 EXPECT_CALL(new_window_mock, OnLoad(IN_IE, StrEq(GetSimplePageUrl()))) | 757 EXPECT_CALL(new_window_mock, OnLoad(IN_IE, StrEq(GetSimplePageUrl()))) |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 | 800 |
801 LaunchIEAndNavigate(page1); | 801 LaunchIEAndNavigate(page1); |
802 } | 802 } |
803 | 803 |
804 // Test CF link context menu - Open link in new window. | 804 // Test CF link context menu - Open link in new window. |
805 // Failing intermittently on IE6/7. See crbug.com/64794. | 805 // Failing intermittently on IE6/7. See crbug.com/64794. |
806 TEST_F(ContextMenuTest, DISABLED_CFOpenLinkInNewWindow) { | 806 TEST_F(ContextMenuTest, DISABLED_CFOpenLinkInNewWindow) { |
807 server_mock_.ExpectAndServeAnyRequests(CFInvocation::MetaTag()); | 807 server_mock_.ExpectAndServeAnyRequests(CFInvocation::MetaTag()); |
808 MockIEEventSink new_window_mock; | 808 MockIEEventSink new_window_mock; |
809 new_window_mock.ExpectAnyNavigations(); | 809 new_window_mock.ExpectAnyNavigations(); |
810 string16 initial_url(GetLinkPageUrl()); | 810 base::string16 initial_url(GetLinkPageUrl()); |
811 | 811 |
812 // Invoke 'Open link in new window' context menu item. | 812 // Invoke 'Open link in new window' context menu item. |
813 EXPECT_CALL(acc_observer_, | 813 EXPECT_CALL(acc_observer_, |
814 OnAccDocLoad(TabContentsTitleEq(initial_url, GetLinkPageTitle()))) | 814 OnAccDocLoad(TabContentsTitleEq(initial_url, GetLinkPageTitle()))) |
815 .Times(testing::AtMost(2)) | 815 .Times(testing::AtMost(2)) |
816 .WillOnce(AccRightClick(AccObjectMatcher(L"", L"link"))) | 816 .WillOnce(AccRightClick(AccObjectMatcher(L"", L"link"))) |
817 .WillOnce(testing::Return()); | 817 .WillOnce(testing::Return()); |
818 EXPECT_CALL(acc_observer_, OnMenuPopup(_)) | 818 EXPECT_CALL(acc_observer_, OnMenuPopup(_)) |
819 .WillOnce(AccLeftClick(AccObjectMatcher(L"Open link in new window*"))); | 819 .WillOnce(AccLeftClick(AccObjectMatcher(L"Open link in new window*"))); |
820 | 820 |
821 ie_mock_.ExpectNewWindow(&new_window_mock); | 821 ie_mock_.ExpectNewWindow(&new_window_mock); |
822 EXPECT_CALL(new_window_mock, OnLoad(IN_CF, StrEq(GetSimplePageUrl()))) | 822 EXPECT_CALL(new_window_mock, OnLoad(IN_CF, StrEq(GetSimplePageUrl()))) |
823 .WillOnce(CloseBrowserMock(&new_window_mock)); | 823 .WillOnce(CloseBrowserMock(&new_window_mock)); |
824 EXPECT_CALL(new_window_mock, OnQuit()) | 824 EXPECT_CALL(new_window_mock, OnQuit()) |
825 .WillOnce(CloseBrowserMock(&ie_mock_)); | 825 .WillOnce(CloseBrowserMock(&ie_mock_)); |
826 | 826 |
827 LaunchIEAndNavigate(initial_url); | 827 LaunchIEAndNavigate(initial_url); |
828 } | 828 } |
829 | 829 |
830 // Test CF link context menu - Copy link address. | 830 // Test CF link context menu - Copy link address. |
831 TEST_F(ContextMenuTest, CFCopyLinkAddress) { | 831 TEST_F(ContextMenuTest, CFCopyLinkAddress) { |
832 server_mock_.ExpectAndServeAnyRequests(CFInvocation::MetaTag()); | 832 server_mock_.ExpectAndServeAnyRequests(CFInvocation::MetaTag()); |
833 string16 initial_url(GetLinkPageUrl()); | 833 base::string16 initial_url(GetLinkPageUrl()); |
834 | 834 |
835 // Invoke 'Copy link address' context menu item. | 835 // Invoke 'Copy link address' context menu item. |
836 EXPECT_CALL(acc_observer_, | 836 EXPECT_CALL(acc_observer_, |
837 OnAccDocLoad(TabContentsTitleEq(initial_url, GetLinkPageTitle()))) | 837 OnAccDocLoad(TabContentsTitleEq(initial_url, GetLinkPageTitle()))) |
838 .WillOnce(AccRightClick(AccObjectMatcher(L"", L"link"))); | 838 .WillOnce(AccRightClick(AccObjectMatcher(L"", L"link"))); |
839 EXPECT_CALL(acc_observer_, OnMenuPopup(_)) | 839 EXPECT_CALL(acc_observer_, OnMenuPopup(_)) |
840 .WillOnce(testing::DoAll( | 840 .WillOnce(testing::DoAll( |
841 AccLeftClick(AccObjectMatcher(L"Copy link address*")), | 841 AccLeftClick(AccObjectMatcher(L"Copy link address*")), |
842 CloseBrowserMock(&ie_mock_))); | 842 CloseBrowserMock(&ie_mock_))); |
843 | 843 |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1104 EXPECT_CALL(acc_observer_, OnMenuPopup(_)) | 1104 EXPECT_CALL(acc_observer_, OnMenuPopup(_)) |
1105 .WillOnce(AccLeftClick(AccObjectMatcher(L"Forward"))); | 1105 .WillOnce(AccLeftClick(AccObjectMatcher(L"Forward"))); |
1106 | 1106 |
1107 EXPECT_CALL(ie_mock_, OnLoad(IN_CF, StrEq(page3))) | 1107 EXPECT_CALL(ie_mock_, OnLoad(IN_CF, StrEq(page3))) |
1108 .WillOnce(CloseBrowserMock(&ie_mock_)); | 1108 .WillOnce(CloseBrowserMock(&ie_mock_)); |
1109 | 1109 |
1110 LaunchIENavigateAndLoop(page1, kChromeFrameVeryLongNavigationTimeout); | 1110 LaunchIENavigateAndLoop(page1, kChromeFrameVeryLongNavigationTimeout); |
1111 } | 1111 } |
1112 | 1112 |
1113 } // namespace chrome_frame_test | 1113 } // namespace chrome_frame_test |
OLD | NEW |