| 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 "chrome_frame/test/test_with_web_server.h" | 5 #include "chrome_frame/test/test_with_web_server.h" |
| 6 | 6 |
| 7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/file_version_info.h" | 8 #include "base/file_version_info.h" |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 L"navigateurl_absolute_host.html"; | 457 L"navigateurl_absolute_host.html"; |
| 458 | 458 |
| 459 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_NavigateURLAbsolute) { | 459 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_NavigateURLAbsolute) { |
| 460 SimpleBrowserTest(IE, kNavigateURLAbsolutePage); | 460 SimpleBrowserTest(IE, kNavigateURLAbsolutePage); |
| 461 } | 461 } |
| 462 | 462 |
| 463 const wchar_t kNavigateURLRelativePage[] = | 463 const wchar_t kNavigateURLRelativePage[] = |
| 464 L"navigateurl_relative_host.html"; | 464 L"navigateurl_relative_host.html"; |
| 465 | 465 |
| 466 // Flaky, crbug.com/160497. | 466 // Flaky, crbug.com/160497. |
| 467 TEST_F(ChromeFrameTestWithWebServer, FLAKY_WidgetModeIE_NavigateURLRelative) { | 467 TEST_F(ChromeFrameTestWithWebServer, |
| 468 DISABLED_WidgetModeIE_NavigateURLRelative) { |
| 468 SimpleBrowserTest(IE, kNavigateURLRelativePage); | 469 SimpleBrowserTest(IE, kNavigateURLRelativePage); |
| 469 } | 470 } |
| 470 | 471 |
| 471 const wchar_t kNavigateSimpleObjectFocus[] = L"simple_object_focus.html"; | 472 const wchar_t kNavigateSimpleObjectFocus[] = L"simple_object_focus.html"; |
| 472 | 473 |
| 473 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_ObjectFocus) { | 474 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_ObjectFocus) { |
| 474 SimpleBrowserTest(IE, kNavigateSimpleObjectFocus); | 475 SimpleBrowserTest(IE, kNavigateSimpleObjectFocus); |
| 475 } | 476 } |
| 476 | 477 |
| 477 const wchar_t kiframeBasicPage[] = L"iframe_basic_host.html"; | 478 const wchar_t kiframeBasicPage[] = L"iframe_basic_host.html"; |
| 478 | 479 |
| 479 | 480 |
| 480 // Flaky, crbug.com/160497. | 481 // Flaky, crbug.com/160497. |
| 481 TEST_F(ChromeFrameTestWithWebServer, FLAKY_WidgetModeIE_iframeBasic) { | 482 TEST_F(ChromeFrameTestWithWebServer, DISABLED_WidgetModeIE_iframeBasic) { |
| 482 SimpleBrowserTest(IE, kiframeBasicPage); | 483 SimpleBrowserTest(IE, kiframeBasicPage); |
| 483 } | 484 } |
| 484 | 485 |
| 485 const wchar_t kSrcPropertyTestPage[] = L"src_property_host.html"; | 486 const wchar_t kSrcPropertyTestPage[] = L"src_property_host.html"; |
| 486 | 487 |
| 487 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_SrcProperty) { | 488 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_SrcProperty) { |
| 488 SimpleBrowserTest(IE, kSrcPropertyTestPage); | 489 SimpleBrowserTest(IE, kSrcPropertyTestPage); |
| 489 } | 490 } |
| 490 | 491 |
| 491 const wchar_t kCFInstanceBasicTestPage[] = L"CFInstance_basic_host.html"; | 492 const wchar_t kCFInstanceBasicTestPage[] = L"CFInstance_basic_host.html"; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 508 | 509 |
| 509 const wchar_t kCFIFallbackPage[] = L"CFInstance_fallback_host.html"; | 510 const wchar_t kCFIFallbackPage[] = L"CFInstance_fallback_host.html"; |
| 510 | 511 |
| 511 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_CFInstanceFallback) { | 512 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_CFInstanceFallback) { |
| 512 SimpleBrowserTest(IE, kCFIFallbackPage); | 513 SimpleBrowserTest(IE, kCFIFallbackPage); |
| 513 } | 514 } |
| 514 | 515 |
| 515 const wchar_t kCFINoSrcPage[] = L"CFInstance_no_src_host.html"; | 516 const wchar_t kCFINoSrcPage[] = L"CFInstance_no_src_host.html"; |
| 516 | 517 |
| 517 // Flaky, crbug.com/160497. | 518 // Flaky, crbug.com/160497. |
| 518 TEST_F(ChromeFrameTestWithWebServer, FLAKY_WidgetModeIE_CFInstanceNoSrc) { | 519 TEST_F(ChromeFrameTestWithWebServer, DISABLED_WidgetModeIE_CFInstanceNoSrc) { |
| 519 SimpleBrowserTest(IE, kCFINoSrcPage); | 520 SimpleBrowserTest(IE, kCFINoSrcPage); |
| 520 } | 521 } |
| 521 | 522 |
| 522 const wchar_t kCFIIfrOnLoadPage[] = L"CFInstance_iframe_onload_host.html"; | 523 const wchar_t kCFIIfrOnLoadPage[] = L"CFInstance_iframe_onload_host.html"; |
| 523 | 524 |
| 524 // disabled since it's unlikely that we care about this case | 525 // disabled since it's unlikely that we care about this case |
| 525 TEST_F(ChromeFrameTestWithWebServer, | 526 TEST_F(ChromeFrameTestWithWebServer, |
| 526 DISABLED_WidgetModeIE_CFInstanceIfrOnLoad) { | 527 DISABLED_WidgetModeIE_CFInstanceIfrOnLoad) { |
| 527 SimpleBrowserTest(IE, kCFIIfrOnLoadPage); | 528 SimpleBrowserTest(IE, kCFIIfrOnLoadPage); |
| 528 } | 529 } |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 const wchar_t kFullTabHttpHeaderPageFrameset[] = | 641 const wchar_t kFullTabHttpHeaderPageFrameset[] = |
| 641 L"chrome_frame_http_header_frameset.html"; | 642 L"chrome_frame_http_header_frameset.html"; |
| 642 | 643 |
| 643 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_CFHttpHeaderFrameSet) { | 644 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_CFHttpHeaderFrameSet) { |
| 644 SimpleBrowserTest(IE, kFullTabHttpHeaderPageFrameset); | 645 SimpleBrowserTest(IE, kFullTabHttpHeaderPageFrameset); |
| 645 } | 646 } |
| 646 | 647 |
| 647 const wchar_t kVersionPage[] = L"version.html"; | 648 const wchar_t kVersionPage[] = L"version.html"; |
| 648 | 649 |
| 649 // Flaky, crbug.com/160497. | 650 // Flaky, crbug.com/160497. |
| 650 TEST_F(ChromeFrameTestWithWebServer, FLAKY_WidgetModeIE_Version) { | 651 TEST_F(ChromeFrameTestWithWebServer, DISABLED_WidgetModeIE_Version) { |
| 651 VersionTest(IE, kVersionPage); | 652 VersionTest(IE, kVersionPage); |
| 652 } | 653 } |
| 653 | 654 |
| 654 const wchar_t kEventListenerPage[] = L"event_listener.html"; | 655 const wchar_t kEventListenerPage[] = L"event_listener.html"; |
| 655 | 656 |
| 656 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_EventListener) { | 657 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_EventListener) { |
| 657 SimpleBrowserTest(IE, kEventListenerPage); | 658 SimpleBrowserTest(IE, kEventListenerPage); |
| 658 } | 659 } |
| 659 | 660 |
| 660 const wchar_t kPrivilegedApisPage[] = L"privileged_apis_host.html"; | 661 const wchar_t kPrivilegedApisPage[] = L"privileged_apis_host.html"; |
| 661 | 662 |
| 662 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_PrivilegedApis) { | 663 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_PrivilegedApis) { |
| 663 SimpleBrowserTest(IE, kPrivilegedApisPage); | 664 SimpleBrowserTest(IE, kPrivilegedApisPage); |
| 664 } | 665 } |
| 665 | 666 |
| 666 const wchar_t kMetaTagPage[] = L"meta_tag.html"; | 667 const wchar_t kMetaTagPage[] = L"meta_tag.html"; |
| 667 // Flaky, crbug.com/160497. | 668 // Flaky, crbug.com/160497. |
| 668 TEST_F(ChromeFrameTestWithWebServer, FLAKY_FullTabModeIE_MetaTag) { | 669 TEST_F(ChromeFrameTestWithWebServer, DISABLED_FullTabModeIE_MetaTag) { |
| 669 SimpleBrowserTest(IE, kMetaTagPage); | 670 SimpleBrowserTest(IE, kMetaTagPage); |
| 670 } | 671 } |
| 671 | 672 |
| 672 // Times out: http://crbug.com/163728 | 673 // Times out: http://crbug.com/163728 |
| 673 const wchar_t kCFProtocolPage[] = L"cf_protocol.html"; | 674 const wchar_t kCFProtocolPage[] = L"cf_protocol.html"; |
| 674 TEST_F(ChromeFrameTestWithWebServer, DISABLED_FullTabModeIE_CFProtocol) { | 675 TEST_F(ChromeFrameTestWithWebServer, DISABLED_FullTabModeIE_CFProtocol) { |
| 675 // Temporarily enable gcf: protocol for this test. | 676 // Temporarily enable gcf: protocol for this test. |
| 676 SetConfigBool(kAllowUnsafeURLs, true); | 677 SetConfigBool(kAllowUnsafeURLs, true); |
| 677 SimpleBrowserTest(IE, kCFProtocolPage); | 678 SimpleBrowserTest(IE, kCFProtocolPage); |
| 678 SetConfigBool(kAllowUnsafeURLs, false); | 679 SetConfigBool(kAllowUnsafeURLs, false); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 703 | 704 |
| 704 const wchar_t kSubIFrameTestPage[] = L"full_tab_sub_iframe_main.html"; | 705 const wchar_t kSubIFrameTestPage[] = L"full_tab_sub_iframe_main.html"; |
| 705 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_SubIFrame) { | 706 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_SubIFrame) { |
| 706 SimpleBrowserTest(IE, kSubIFrameTestPage); | 707 SimpleBrowserTest(IE, kSubIFrameTestPage); |
| 707 } | 708 } |
| 708 | 709 |
| 709 const wchar_t kXMLHttpRequestTestUrl[] = | 710 const wchar_t kXMLHttpRequestTestUrl[] = |
| 710 L"xmlhttprequest_test.html"; | 711 L"xmlhttprequest_test.html"; |
| 711 | 712 |
| 712 // Flaky, crbug.com/160497. | 713 // Flaky, crbug.com/160497. |
| 713 TEST_F(ChromeFrameTestWithWebServer, FLAKY_FullTabModeIE_XHRTest) { | 714 TEST_F(ChromeFrameTestWithWebServer, DISABLED_FullTabModeIE_XHRTest) { |
| 714 SimpleBrowserTest(IE, kXMLHttpRequestTestUrl); | 715 SimpleBrowserTest(IE, kXMLHttpRequestTestUrl); |
| 715 } | 716 } |
| 716 | 717 |
| 717 const wchar_t kInstallFlowTestUrl[] = | 718 const wchar_t kInstallFlowTestUrl[] = |
| 718 L"install_flow_test.html"; | 719 L"install_flow_test.html"; |
| 719 | 720 |
| 720 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_InstallFlowTest) { | 721 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_InstallFlowTest) { |
| 721 if (base::win::GetVersion() < base::win::VERSION_VISTA) { | 722 if (base::win::GetVersion() < base::win::VERSION_VISTA) { |
| 722 ScopedChromeFrameRegistrar::UnregisterAtPath( | 723 ScopedChromeFrameRegistrar::UnregisterAtPath( |
| 723 GetChromeFrameBuildPath().value(), | 724 GetChromeFrameBuildPath().value(), |
| (...skipping 19 matching lines...) Expand all Loading... |
| 743 L"multiple_cf_instances_main.html"; | 744 L"multiple_cf_instances_main.html"; |
| 744 | 745 |
| 745 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_MultipleCFInstances) { | 746 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_MultipleCFInstances) { |
| 746 SimpleBrowserTest(IE, kMultipleCFInstancesTestUrl); | 747 SimpleBrowserTest(IE, kMultipleCFInstancesTestUrl); |
| 747 } | 748 } |
| 748 | 749 |
| 749 const wchar_t kXHRHeaderTestUrl[] = | 750 const wchar_t kXHRHeaderTestUrl[] = |
| 750 L"xmlhttprequest_header_test.html"; | 751 L"xmlhttprequest_header_test.html"; |
| 751 | 752 |
| 752 // Marking as flaky since it occasionally times out. crbug.com/127395. | 753 // Marking as flaky since it occasionally times out. crbug.com/127395. |
| 753 TEST_F(ChromeFrameTestWithWebServer, FLAKY_FullTabModeIE_XHRHeaderTest) { | 754 TEST_F(ChromeFrameTestWithWebServer, DISABLED_FullTabModeIE_XHRHeaderTest) { |
| 754 SimpleBrowserTest(IE, kXHRHeaderTestUrl); | 755 SimpleBrowserTest(IE, kXHRHeaderTestUrl); |
| 755 } | 756 } |
| 756 | 757 |
| 757 const wchar_t kDeleteCookieTest[] = | 758 const wchar_t kDeleteCookieTest[] = |
| 758 L"fulltab_delete_cookie_test.html"; | 759 L"fulltab_delete_cookie_test.html"; |
| 759 | 760 |
| 760 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_DeleteCookieTest) { | 761 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_DeleteCookieTest) { |
| 761 SimpleBrowserTest(IE, kDeleteCookieTest); | 762 SimpleBrowserTest(IE, kDeleteCookieTest); |
| 762 } | 763 } |
| 763 | 764 |
| 764 const wchar_t kAnchorUrlNavigate[] = | 765 const wchar_t kAnchorUrlNavigate[] = |
| 765 L"fulltab_anchor_url_navigate.html#chrome_frame"; | 766 L"fulltab_anchor_url_navigate.html#chrome_frame"; |
| 766 | 767 |
| 767 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_AnchorUrlNavigateTest) { | 768 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_AnchorUrlNavigateTest) { |
| 768 SimpleBrowserTest(IE, kAnchorUrlNavigate); | 769 SimpleBrowserTest(IE, kAnchorUrlNavigate); |
| 769 } | 770 } |
| 770 | 771 |
| 771 // Test whether POST-ing a form from an mshtml page to a CF page will cause | 772 // Test whether POST-ing a form from an mshtml page to a CF page will cause |
| 772 // the request to get reissued. It should not. | 773 // the request to get reissued. It should not. |
| 773 // https://code.google.com/p/chromium/issues/detail?id=143699 | 774 // https://code.google.com/p/chromium/issues/detail?id=143699 |
| 774 TEST_F(ChromeFrameTestWithWebServer, FLAKY_FullTabModeIE_TestPostReissue) { | 775 TEST_F(ChromeFrameTestWithWebServer, DISABLED_FullTabModeIE_TestPostReissue) { |
| 775 // The order of pages in this array is assumed to be mshtml, cf, script. | 776 // The order of pages in this array is assumed to be mshtml, cf, script. |
| 776 const wchar_t* kPages[] = { | 777 const wchar_t* kPages[] = { |
| 777 L"full_tab_post_mshtml.html", | 778 L"full_tab_post_mshtml.html", |
| 778 L"full_tab_post_target_cf.html", | 779 L"full_tab_post_target_cf.html", |
| 779 L"chrome_frame_tester_helpers.js", | 780 L"chrome_frame_tester_helpers.js", |
| 780 }; | 781 }; |
| 781 | 782 |
| 782 SimpleWebServerTest server(local_address_, 46664); | 783 SimpleWebServerTest server(local_address_, 46664); |
| 783 server.PopulateStaticFileListT<test_server::FileResponse>(kPages, | 784 server.PopulateStaticFileListT<test_server::FileResponse>(kPages, |
| 784 arraysize(kPages), GetCFTestFilePath()); | 785 arraysize(kPages), GetCFTestFilePath()); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 796 // Check how many requests we got for the cf page. Also expect it to be | 797 // Check how many requests we got for the cf page. Also expect it to be |
| 797 // a POST. | 798 // a POST. |
| 798 int requests = server.GetRequestCountForPage(kPages[1], "POST"); | 799 int requests = server.GetRequestCountForPage(kPages[1], "POST"); |
| 799 EXPECT_EQ(1, requests); | 800 EXPECT_EQ(1, requests); |
| 800 } | 801 } |
| 801 } | 802 } |
| 802 | 803 |
| 803 // Test whether following a link from an mshtml page to a CF page will cause | 804 // Test whether following a link from an mshtml page to a CF page will cause |
| 804 // multiple network requests. It should not. | 805 // multiple network requests. It should not. |
| 805 // Flaky, crbug.com/160497. | 806 // Flaky, crbug.com/160497. |
| 806 TEST_F(ChromeFrameTestWithWebServer, FLAKY_FullTabModeIE_TestMultipleGet) { | 807 TEST_F(ChromeFrameTestWithWebServer, DISABLED_FullTabModeIE_TestMultipleGet) { |
| 807 // The order of pages in this array is assumed to be mshtml, cf, script. | 808 // The order of pages in this array is assumed to be mshtml, cf, script. |
| 808 const wchar_t* kPages[] = { | 809 const wchar_t* kPages[] = { |
| 809 L"full_tab_get_mshtml.html", | 810 L"full_tab_get_mshtml.html", |
| 810 L"full_tab_get_target_cf.html", | 811 L"full_tab_get_target_cf.html", |
| 811 L"chrome_frame_tester_helpers.js", | 812 L"chrome_frame_tester_helpers.js", |
| 812 }; | 813 }; |
| 813 | 814 |
| 814 SimpleWebServerTest server(local_address_, 46664); | 815 SimpleWebServerTest server(local_address_, 46664); |
| 815 | 816 |
| 816 server.PopulateStaticFileListT<test_server::FileResponse>(kPages, | 817 server.PopulateStaticFileListT<test_server::FileResponse>(kPages, |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1074 server.web_server()->AddResponse(response); | 1075 server.web_server()->AddResponse(response); |
| 1075 | 1076 |
| 1076 std::wstring url(server.FormatHttpPath(L"form.html")); | 1077 std::wstring url(server.FormatHttpPath(L"form.html")); |
| 1077 | 1078 |
| 1078 ASSERT_TRUE(LaunchBrowser(IE, url.c_str())); | 1079 ASSERT_TRUE(LaunchBrowser(IE, url.c_str())); |
| 1079 loop().RunFor(kChromeFrameLongNavigationTimeout); | 1080 loop().RunFor(kChromeFrameLongNavigationTimeout); |
| 1080 | 1081 |
| 1081 EXPECT_EQ(1, response->get_request_count()); | 1082 EXPECT_EQ(1, response->get_request_count()); |
| 1082 EXPECT_EQ(1, response->post_request_count()); | 1083 EXPECT_EQ(1, response->post_request_count()); |
| 1083 } | 1084 } |
| OLD | NEW |