| 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/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 const wchar_t kNavigateURLAbsolutePage[] = | 448 const wchar_t kNavigateURLAbsolutePage[] = |
| 449 L"navigateurl_absolute_host.html"; | 449 L"navigateurl_absolute_host.html"; |
| 450 | 450 |
| 451 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_NavigateURLAbsolute) { | 451 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_NavigateURLAbsolute) { |
| 452 SimpleBrowserTest(IE, kNavigateURLAbsolutePage); | 452 SimpleBrowserTest(IE, kNavigateURLAbsolutePage); |
| 453 } | 453 } |
| 454 | 454 |
| 455 const wchar_t kNavigateURLRelativePage[] = | 455 const wchar_t kNavigateURLRelativePage[] = |
| 456 L"navigateurl_relative_host.html"; | 456 L"navigateurl_relative_host.html"; |
| 457 | 457 |
| 458 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_NavigateURLRelative) { | 458 // Flaky, crbug.com/160497. |
| 459 TEST_F(ChromeFrameTestWithWebServer, FLAKY_WidgetModeIE_NavigateURLRelative) { |
| 459 SimpleBrowserTest(IE, kNavigateURLRelativePage); | 460 SimpleBrowserTest(IE, kNavigateURLRelativePage); |
| 460 } | 461 } |
| 461 | 462 |
| 462 const wchar_t kNavigateSimpleObjectFocus[] = L"simple_object_focus.html"; | 463 const wchar_t kNavigateSimpleObjectFocus[] = L"simple_object_focus.html"; |
| 463 | 464 |
| 464 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_ObjectFocus) { | 465 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_ObjectFocus) { |
| 465 SimpleBrowserTest(IE, kNavigateSimpleObjectFocus); | 466 SimpleBrowserTest(IE, kNavigateSimpleObjectFocus); |
| 466 } | 467 } |
| 467 | 468 |
| 468 const wchar_t kiframeBasicPage[] = L"iframe_basic_host.html"; | 469 const wchar_t kiframeBasicPage[] = L"iframe_basic_host.html"; |
| 469 | 470 |
| 470 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_iframeBasic) { | 471 |
| 472 // Flaky, crbug.com/160497. |
| 473 TEST_F(ChromeFrameTestWithWebServer, FLAKY_WidgetModeIE_iframeBasic) { |
| 471 SimpleBrowserTest(IE, kiframeBasicPage); | 474 SimpleBrowserTest(IE, kiframeBasicPage); |
| 472 } | 475 } |
| 473 | 476 |
| 474 const wchar_t kSrcPropertyTestPage[] = L"src_property_host.html"; | 477 const wchar_t kSrcPropertyTestPage[] = L"src_property_host.html"; |
| 475 | 478 |
| 476 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_SrcProperty) { | 479 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_SrcProperty) { |
| 477 SimpleBrowserTest(IE, kSrcPropertyTestPage); | 480 SimpleBrowserTest(IE, kSrcPropertyTestPage); |
| 478 } | 481 } |
| 479 | 482 |
| 480 const wchar_t kCFInstanceBasicTestPage[] = L"CFInstance_basic_host.html"; | 483 const wchar_t kCFInstanceBasicTestPage[] = L"CFInstance_basic_host.html"; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 496 } | 499 } |
| 497 | 500 |
| 498 const wchar_t kCFIFallbackPage[] = L"CFInstance_fallback_host.html"; | 501 const wchar_t kCFIFallbackPage[] = L"CFInstance_fallback_host.html"; |
| 499 | 502 |
| 500 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_CFInstanceFallback) { | 503 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_CFInstanceFallback) { |
| 501 SimpleBrowserTest(IE, kCFIFallbackPage); | 504 SimpleBrowserTest(IE, kCFIFallbackPage); |
| 502 } | 505 } |
| 503 | 506 |
| 504 const wchar_t kCFINoSrcPage[] = L"CFInstance_no_src_host.html"; | 507 const wchar_t kCFINoSrcPage[] = L"CFInstance_no_src_host.html"; |
| 505 | 508 |
| 506 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_CFInstanceNoSrc) { | 509 // Flaky, crbug.com/160497. |
| 510 TEST_F(ChromeFrameTestWithWebServer, FLAKY_WidgetModeIE_CFInstanceNoSrc) { |
| 507 SimpleBrowserTest(IE, kCFINoSrcPage); | 511 SimpleBrowserTest(IE, kCFINoSrcPage); |
| 508 } | 512 } |
| 509 | 513 |
| 510 const wchar_t kCFIIfrOnLoadPage[] = L"CFInstance_iframe_onload_host.html"; | 514 const wchar_t kCFIIfrOnLoadPage[] = L"CFInstance_iframe_onload_host.html"; |
| 511 | 515 |
| 512 // disabled since it's unlikely that we care about this case | 516 // disabled since it's unlikely that we care about this case |
| 513 TEST_F(ChromeFrameTestWithWebServer, | 517 TEST_F(ChromeFrameTestWithWebServer, |
| 514 DISABLED_WidgetModeIE_CFInstanceIfrOnLoad) { | 518 DISABLED_WidgetModeIE_CFInstanceIfrOnLoad) { |
| 515 SimpleBrowserTest(IE, kCFIIfrOnLoadPage); | 519 SimpleBrowserTest(IE, kCFIIfrOnLoadPage); |
| 516 } | 520 } |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 | 631 |
| 628 const wchar_t kFullTabHttpHeaderPageFrameset[] = | 632 const wchar_t kFullTabHttpHeaderPageFrameset[] = |
| 629 L"chrome_frame_http_header_frameset.html"; | 633 L"chrome_frame_http_header_frameset.html"; |
| 630 | 634 |
| 631 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_CFHttpHeaderFrameSet) { | 635 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_CFHttpHeaderFrameSet) { |
| 632 SimpleBrowserTest(IE, kFullTabHttpHeaderPageFrameset); | 636 SimpleBrowserTest(IE, kFullTabHttpHeaderPageFrameset); |
| 633 } | 637 } |
| 634 | 638 |
| 635 const wchar_t kVersionPage[] = L"version.html"; | 639 const wchar_t kVersionPage[] = L"version.html"; |
| 636 | 640 |
| 637 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_Version) { | 641 // Flaky, crbug.com/160497. |
| 642 TEST_F(ChromeFrameTestWithWebServer, FLAKY_WidgetModeIE_Version) { |
| 638 VersionTest(IE, kVersionPage); | 643 VersionTest(IE, kVersionPage); |
| 639 } | 644 } |
| 640 | 645 |
| 641 const wchar_t kEventListenerPage[] = L"event_listener.html"; | 646 const wchar_t kEventListenerPage[] = L"event_listener.html"; |
| 642 | 647 |
| 643 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_EventListener) { | 648 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_EventListener) { |
| 644 SimpleBrowserTest(IE, kEventListenerPage); | 649 SimpleBrowserTest(IE, kEventListenerPage); |
| 645 } | 650 } |
| 646 | 651 |
| 647 const wchar_t kPrivilegedApisPage[] = L"privileged_apis_host.html"; | 652 const wchar_t kPrivilegedApisPage[] = L"privileged_apis_host.html"; |
| 648 | 653 |
| 649 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_PrivilegedApis) { | 654 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_PrivilegedApis) { |
| 650 SimpleBrowserTest(IE, kPrivilegedApisPage); | 655 SimpleBrowserTest(IE, kPrivilegedApisPage); |
| 651 } | 656 } |
| 652 | 657 |
| 653 const wchar_t kMetaTagPage[] = L"meta_tag.html"; | 658 const wchar_t kMetaTagPage[] = L"meta_tag.html"; |
| 654 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_MetaTag) { | 659 // Flaky, crbug.com/160497. |
| 660 TEST_F(ChromeFrameTestWithWebServer, FLAKY_FullTabModeIE_MetaTag) { |
| 655 SimpleBrowserTest(IE, kMetaTagPage); | 661 SimpleBrowserTest(IE, kMetaTagPage); |
| 656 } | 662 } |
| 657 | 663 |
| 658 const wchar_t kCFProtocolPage[] = L"cf_protocol.html"; | 664 const wchar_t kCFProtocolPage[] = L"cf_protocol.html"; |
| 659 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_CFProtocol) { | 665 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_CFProtocol) { |
| 660 // Temporarily enable gcf: protocol for this test. | 666 // Temporarily enable gcf: protocol for this test. |
| 661 SetConfigBool(kAllowUnsafeURLs, true); | 667 SetConfigBool(kAllowUnsafeURLs, true); |
| 662 SimpleBrowserTest(IE, kCFProtocolPage); | 668 SimpleBrowserTest(IE, kCFProtocolPage); |
| 663 SetConfigBool(kAllowUnsafeURLs, false); | 669 SetConfigBool(kAllowUnsafeURLs, false); |
| 664 } | 670 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 686 } | 692 } |
| 687 | 693 |
| 688 const wchar_t kSubIFrameTestPage[] = L"full_tab_sub_iframe_main.html"; | 694 const wchar_t kSubIFrameTestPage[] = L"full_tab_sub_iframe_main.html"; |
| 689 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_SubIFrame) { | 695 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_SubIFrame) { |
| 690 SimpleBrowserTest(IE, kSubIFrameTestPage); | 696 SimpleBrowserTest(IE, kSubIFrameTestPage); |
| 691 } | 697 } |
| 692 | 698 |
| 693 const wchar_t kXMLHttpRequestTestUrl[] = | 699 const wchar_t kXMLHttpRequestTestUrl[] = |
| 694 L"xmlhttprequest_test.html"; | 700 L"xmlhttprequest_test.html"; |
| 695 | 701 |
| 696 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_XHRTest) { | 702 // Flaky, crbug.com/160497. |
| 703 TEST_F(ChromeFrameTestWithWebServer, FLAKY_FullTabModeIE_XHRTest) { |
| 697 SimpleBrowserTest(IE, kXMLHttpRequestTestUrl); | 704 SimpleBrowserTest(IE, kXMLHttpRequestTestUrl); |
| 698 } | 705 } |
| 699 | 706 |
| 700 const wchar_t kInstallFlowTestUrl[] = | 707 const wchar_t kInstallFlowTestUrl[] = |
| 701 L"install_flow_test.html"; | 708 L"install_flow_test.html"; |
| 702 | 709 |
| 703 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_InstallFlowTest) { | 710 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_InstallFlowTest) { |
| 704 if (base::win::GetVersion() < base::win::VERSION_VISTA) { | 711 if (base::win::GetVersion() < base::win::VERSION_VISTA) { |
| 705 ScopedChromeFrameRegistrar::UnregisterAtPath( | 712 ScopedChromeFrameRegistrar::UnregisterAtPath( |
| 706 GetChromeFrameBuildPath().value(), | 713 GetChromeFrameBuildPath().value(), |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 if (request->arguments().compare("OK") == 0) { | 785 if (request->arguments().compare("OK") == 0) { |
| 779 // Check how many requests we got for the cf page. Also expect it to be | 786 // Check how many requests we got for the cf page. Also expect it to be |
| 780 // a POST. | 787 // a POST. |
| 781 int requests = server.GetRequestCountForPage(kPages[1], "POST"); | 788 int requests = server.GetRequestCountForPage(kPages[1], "POST"); |
| 782 EXPECT_EQ(1, requests); | 789 EXPECT_EQ(1, requests); |
| 783 } | 790 } |
| 784 } | 791 } |
| 785 | 792 |
| 786 // Test whether following a link from an mshtml page to a CF page will cause | 793 // Test whether following a link from an mshtml page to a CF page will cause |
| 787 // multiple network requests. It should not. | 794 // multiple network requests. It should not. |
| 788 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_TestMultipleGet) { | 795 // Flaky, crbug.com/160497. |
| 796 TEST_F(ChromeFrameTestWithWebServer, FLAKY_FullTabModeIE_TestMultipleGet) { |
| 789 // The order of pages in this array is assumed to be mshtml, cf, script. | 797 // The order of pages in this array is assumed to be mshtml, cf, script. |
| 790 const wchar_t* kPages[] = { | 798 const wchar_t* kPages[] = { |
| 791 L"full_tab_get_mshtml.html", | 799 L"full_tab_get_mshtml.html", |
| 792 L"full_tab_get_target_cf.html", | 800 L"full_tab_get_target_cf.html", |
| 793 L"chrome_frame_tester_helpers.js", | 801 L"chrome_frame_tester_helpers.js", |
| 794 }; | 802 }; |
| 795 | 803 |
| 796 SimpleWebServerTest server(local_address_, 46664); | 804 SimpleWebServerTest server(local_address_, 46664); |
| 797 | 805 |
| 798 server.PopulateStaticFileListT<test_server::FileResponse>(kPages, | 806 server.PopulateStaticFileListT<test_server::FileResponse>(kPages, |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1056 server.web_server()->AddResponse(response); | 1064 server.web_server()->AddResponse(response); |
| 1057 | 1065 |
| 1058 std::wstring url(server.FormatHttpPath(L"form.html")); | 1066 std::wstring url(server.FormatHttpPath(L"form.html")); |
| 1059 | 1067 |
| 1060 ASSERT_TRUE(LaunchBrowser(IE, url.c_str())); | 1068 ASSERT_TRUE(LaunchBrowser(IE, url.c_str())); |
| 1061 loop().RunFor(kChromeFrameLongNavigationTimeout); | 1069 loop().RunFor(kChromeFrameLongNavigationTimeout); |
| 1062 | 1070 |
| 1063 EXPECT_EQ(1, response->get_request_count()); | 1071 EXPECT_EQ(1, response->get_request_count()); |
| 1064 EXPECT_EQ(1, response->post_request_count()); | 1072 EXPECT_EQ(1, response->post_request_count()); |
| 1065 } | 1073 } |
| OLD | NEW |