| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 OptionalBrowserTest(SAFARI, kCFIIfrPostPage); | 631 OptionalBrowserTest(SAFARI, kCFIIfrPostPage); |
| 632 } | 632 } |
| 633 | 633 |
| 634 TEST_F(ChromeFrameTestWithWebServer, WidgetModeOpera_CFInstanceIfrPost) { | 634 TEST_F(ChromeFrameTestWithWebServer, WidgetModeOpera_CFInstanceIfrPost) { |
| 635 OptionalBrowserTest(OPERA, kCFIIfrPostPage); | 635 OptionalBrowserTest(OPERA, kCFIIfrPostPage); |
| 636 } | 636 } |
| 637 | 637 |
| 638 const wchar_t kCFIPostPage[] = L"CFInstance_post_host.html"; | 638 const wchar_t kCFIPostPage[] = L"CFInstance_post_host.html"; |
| 639 | 639 |
| 640 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_CFInstancePost) { | 640 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_CFInstancePost) { |
| 641 if (chrome_frame_test::GetInstalledIEVersion() == IE_9) { |
| 642 LOG(INFO) << "Not running test on Vista/Windows 7 with IE9"; |
| 643 return; |
| 644 } |
| 641 SimpleBrowserTest(IE, kCFIPostPage); | 645 SimpleBrowserTest(IE, kCFIPostPage); |
| 642 } | 646 } |
| 643 | 647 |
| 644 // This test randomly fails on the ChromeFrame builder. | 648 // This test randomly fails on the ChromeFrame builder. |
| 645 // Bug http://code.google.com/p/chromium/issues/detail?id=31532 | 649 // Bug http://code.google.com/p/chromium/issues/detail?id=31532 |
| 646 TEST_F(ChromeFrameTestWithWebServer, FLAKY_WidgetModeFF_CFInstancePost) { | 650 TEST_F(ChromeFrameTestWithWebServer, FLAKY_WidgetModeFF_CFInstancePost) { |
| 647 SimpleBrowserTest(FIREFOX, kCFIPostPage); | 651 SimpleBrowserTest(FIREFOX, kCFIPostPage); |
| 648 } | 652 } |
| 649 | 653 |
| 650 TEST_F(ChromeFrameTestWithWebServer, WidgetModeChrome_CFInstancePost) { | 654 TEST_F(ChromeFrameTestWithWebServer, WidgetModeChrome_CFInstancePost) { |
| 651 SimpleBrowserTest(CHROME, kCFIPostPage); | 655 SimpleBrowserTest(CHROME, kCFIPostPage); |
| 652 } | 656 } |
| 653 | 657 |
| 654 TEST_F(ChromeFrameTestWithWebServer, WidgetModeSafari_CFInstancePost) { | 658 TEST_F(ChromeFrameTestWithWebServer, WidgetModeSafari_CFInstancePost) { |
| 655 OptionalBrowserTest(SAFARI, kCFIPostPage); | 659 OptionalBrowserTest(SAFARI, kCFIPostPage); |
| 656 } | 660 } |
| 657 | 661 |
| 658 TEST_F(ChromeFrameTestWithWebServer, DISABLED_WidgetModeOpera_CFInstancePost) { | 662 TEST_F(ChromeFrameTestWithWebServer, DISABLED_WidgetModeOpera_CFInstancePost) { |
| 659 OptionalBrowserTest(OPERA, kCFIPostPage); | 663 OptionalBrowserTest(OPERA, kCFIPostPage); |
| 660 } | 664 } |
| 661 | 665 |
| 662 const wchar_t kCFIRPCPage[] = L"CFInstance_rpc_host.html"; | 666 const wchar_t kCFIRPCPage[] = L"CFInstance_rpc_host.html"; |
| 663 | 667 |
| 664 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_CFInstanceRPC) { | 668 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_CFInstanceRPC) { |
| 669 if (chrome_frame_test::GetInstalledIEVersion() == IE_9) { |
| 670 LOG(INFO) << "Not running test on Vista/Windows 7 with IE9"; |
| 671 return; |
| 672 } |
| 665 SimpleBrowserTest(IE, kCFIRPCPage); | 673 SimpleBrowserTest(IE, kCFIRPCPage); |
| 666 } | 674 } |
| 667 | 675 |
| 668 // This test randomly fails on the ChromeFrame builder. | 676 // This test randomly fails on the ChromeFrame builder. |
| 669 // Bug http://code.google.com/p/chromium/issues/detail?id=31532 | 677 // Bug http://code.google.com/p/chromium/issues/detail?id=31532 |
| 670 TEST_F(ChromeFrameTestWithWebServer, FLAKY_WidgetModeFF_CFInstanceRPC) { | 678 TEST_F(ChromeFrameTestWithWebServer, FLAKY_WidgetModeFF_CFInstanceRPC) { |
| 671 SimpleBrowserTest(FIREFOX, kCFIRPCPage); | 679 SimpleBrowserTest(FIREFOX, kCFIRPCPage); |
| 672 } | 680 } |
| 673 | 681 |
| 674 TEST_F(ChromeFrameTestWithWebServer, WidgetModeChrome_CFInstanceRPC) { | 682 TEST_F(ChromeFrameTestWithWebServer, WidgetModeChrome_CFInstanceRPC) { |
| 675 SimpleBrowserTest(CHROME, kCFIRPCPage); | 683 SimpleBrowserTest(CHROME, kCFIRPCPage); |
| 676 } | 684 } |
| 677 | 685 |
| 678 TEST_F(ChromeFrameTestWithWebServer, WidgetModeSafari_CFInstanceRPC) { | 686 TEST_F(ChromeFrameTestWithWebServer, WidgetModeSafari_CFInstanceRPC) { |
| 679 OptionalBrowserTest(SAFARI, kCFIRPCPage); | 687 OptionalBrowserTest(SAFARI, kCFIRPCPage); |
| 680 } | 688 } |
| 681 | 689 |
| 682 TEST_F(ChromeFrameTestWithWebServer, DISABLED_WidgetModeOpera_CFInstanceRPC) { | 690 TEST_F(ChromeFrameTestWithWebServer, DISABLED_WidgetModeOpera_CFInstanceRPC) { |
| 683 OptionalBrowserTest(OPERA, kCFIRPCPage); | 691 OptionalBrowserTest(OPERA, kCFIRPCPage); |
| 684 } | 692 } |
| 685 | 693 |
| 686 const wchar_t kCFIRPCInternalPage[] = | 694 const wchar_t kCFIRPCInternalPage[] = |
| 687 L"CFInstance_rpc_internal_host.html"; | 695 L"CFInstance_rpc_internal_host.html"; |
| 688 | 696 |
| 689 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_CFInstanceRPCInternal) { | 697 TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_CFInstanceRPCInternal) { |
| 698 if (chrome_frame_test::GetInstalledIEVersion() == IE_9) { |
| 699 LOG(INFO) << "Not running test on Vista/Windows 7 with IE9"; |
| 700 return; |
| 701 } |
| 690 SimpleBrowserTest(IE, kCFIRPCInternalPage); | 702 SimpleBrowserTest(IE, kCFIRPCInternalPage); |
| 691 } | 703 } |
| 692 | 704 |
| 693 // http://code.google.com/p/chromium/issues/detail?id=37204 | 705 // http://code.google.com/p/chromium/issues/detail?id=37204 |
| 694 TEST_F(ChromeFrameTestWithWebServer, FLAKY_WidgetModeFF_CFInstanceRPCInternal) { | 706 TEST_F(ChromeFrameTestWithWebServer, FLAKY_WidgetModeFF_CFInstanceRPCInternal) { |
| 695 SimpleBrowserTest(FIREFOX, kCFIRPCInternalPage); | 707 SimpleBrowserTest(FIREFOX, kCFIRPCInternalPage); |
| 696 } | 708 } |
| 697 | 709 |
| 698 TEST_F(ChromeFrameTestWithWebServer, WidgetModeChrome_CFInstanceRPCInternal) { | 710 TEST_F(ChromeFrameTestWithWebServer, WidgetModeChrome_CFInstanceRPCInternal) { |
| 699 SimpleBrowserTest(CHROME, kCFIRPCInternalPage); | 711 SimpleBrowserTest(CHROME, kCFIRPCInternalPage); |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1103 | 1115 |
| 1104 loop_.RunFor(kChromeFrameLongNavigationTimeoutInSeconds); | 1116 loop_.RunFor(kChromeFrameLongNavigationTimeoutInSeconds); |
| 1105 | 1117 |
| 1106 test_server::SimpleWebServer* ws = server.web_server(); | 1118 test_server::SimpleWebServer* ws = server.web_server(); |
| 1107 const test_server::ConnectionList& connections = ws->connections(); | 1119 const test_server::ConnectionList& connections = ws->connections(); |
| 1108 test_server::ConnectionList::const_iterator it = connections.begin(); | 1120 test_server::ConnectionList::const_iterator it = connections.begin(); |
| 1109 int requests_for_first_page = 0; | 1121 int requests_for_first_page = 0; |
| 1110 for (; it != connections.end(); ++it) { | 1122 for (; it != connections.end(); ++it) { |
| 1111 test_server::Connection* c = (*it); | 1123 test_server::Connection* c = (*it); |
| 1112 const test_server::Request& r = c->request(); | 1124 const test_server::Request& r = c->request(); |
| 1113 if (ASCIIToWide(r.path().substr(1)).compare(kPages[0]) == 0) { | 1125 if (!r.path().empty() && |
| 1126 ASCIIToWide(r.path().substr(1)).compare(kPages[0]) == 0) { |
| 1114 requests_for_first_page++; | 1127 requests_for_first_page++; |
| 1115 std::string ua(GetHeaderValue(r.headers(), "User-Agent")); | 1128 std::string ua(GetHeaderValue(r.headers(), "User-Agent")); |
| 1116 EXPECT_NE(std::string::npos, ua.find("chromeframe")); | 1129 EXPECT_NE(std::string::npos, ua.find("chromeframe")); |
| 1117 } | 1130 } |
| 1118 } | 1131 } |
| 1119 EXPECT_GT(requests_for_first_page, 1); | 1132 EXPECT_GT(requests_for_first_page, 1); |
| 1120 } | 1133 } |
| 1121 | 1134 |
| 1122 // See bug 36694 for details. http://crbug.com/36694 | 1135 // See bug 36694 for details. http://crbug.com/36694 |
| 1123 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_TestDownloadFromForm) { | 1136 TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_TestDownloadFromForm) { |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1237 | 1250 |
| 1238 std::wstring url(server.FormatHttpPath(L"form.html")); | 1251 std::wstring url(server.FormatHttpPath(L"form.html")); |
| 1239 | 1252 |
| 1240 ASSERT_TRUE(LaunchBrowser(IE, url.c_str())); | 1253 ASSERT_TRUE(LaunchBrowser(IE, url.c_str())); |
| 1241 loop_.RunFor(kChromeFrameLongNavigationTimeoutInSeconds); | 1254 loop_.RunFor(kChromeFrameLongNavigationTimeoutInSeconds); |
| 1242 | 1255 |
| 1243 EXPECT_EQ(1, response->get_request_count()); | 1256 EXPECT_EQ(1, response->get_request_count()); |
| 1244 EXPECT_EQ(1, response->post_request_count()); | 1257 EXPECT_EQ(1, response->post_request_count()); |
| 1245 } | 1258 } |
| 1246 | 1259 |
| OLD | NEW |