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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/scoped_comptr_win.h" | 7 #include "base/scoped_comptr_win.h" |
8 #include "base/test/test_file_util.h" | 8 #include "base/test/test_file_util.h" |
9 #include "base/win/windows_version.h" | 9 #include "base/win/windows_version.h" |
10 #include "chrome_frame/test/chrome_frame_test_utils.h" | 10 #include "chrome_frame/test/chrome_frame_test_utils.h" |
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
741 // Navigates IE to a URL which in ChromeFrame. | 741 // Navigates IE to a URL which in ChromeFrame. |
742 // Performs a top level form post in the document | 742 // Performs a top level form post in the document |
743 // In response to the POST we send over an attachment via the | 743 // In response to the POST we send over an attachment via the |
744 // content-disposition header. | 744 // content-disposition header. |
745 // IE brings up a file open dialog in this context. | 745 // IE brings up a file open dialog in this context. |
746 // We bring up the Save dialog via accessibility and save the file | 746 // We bring up the Save dialog via accessibility and save the file |
747 // and validate that all is well. | 747 // and validate that all is well. |
748 TEST_F(FullTabDownloadTest, CF_DownloadFileFromPost) { | 748 TEST_F(FullTabDownloadTest, CF_DownloadFileFromPost) { |
749 // Please see http://code.google.com/p/chromium/issues/detail?id=60987 | 749 // Please see http://code.google.com/p/chromium/issues/detail?id=60987 |
750 // for more information on why this test is disabled for Vista with IE7. | 750 // for more information on why this test is disabled for Vista with IE7. |
751 if (base::win::GetVersion() == base::win::VERSION_VISTA && | 751 if (base::win::GetVersion() >= base::win::VERSION_VISTA) { |
752 GetInstalledIEVersion() == IE_7) { | 752 if (GetInstalledIEVersion() == IE_7) { |
753 LOG(INFO) << "Not running test on Vista with IE7"; | 753 LOG(INFO) << "Not running test on Vista with IE7"; |
754 return; | 754 return; |
755 } else if (GetInstalledIEVersion() == IE_9) { | |
amit
2010/11/15 21:25:47
nit: wouldn't be better to call GetInstalledIEVers
| |
756 LOG(INFO) << "Not running test on Vista/Windows 7 with IE9"; | |
757 return; | |
758 } | |
755 } | 759 } |
760 | |
756 chrome_frame_test::MockWindowObserver download_watcher; | 761 chrome_frame_test::MockWindowObserver download_watcher; |
757 download_watcher.WatchWindow("File Download", ""); | 762 download_watcher.WatchWindow("File Download", ""); |
758 | 763 |
759 chrome_frame_test::MockWindowObserver save_dialog_watcher; | 764 chrome_frame_test::MockWindowObserver save_dialog_watcher; |
760 save_dialog_watcher.WatchWindow("Save As", ""); | 765 save_dialog_watcher.WatchWindow("Save As", ""); |
761 | 766 |
762 EXPECT_CALL(server_mock_, Get(_, StrEq(L"/post_source.html"), _)).WillOnce( | 767 EXPECT_CALL(server_mock_, Get(_, StrEq(L"/post_source.html"), _)).WillOnce( |
763 SendFast( | 768 SendFast( |
764 "HTTP/1.1 200 OK\r\n" | 769 "HTTP/1.1 200 OK\r\n" |
765 "Content-Type: text/html\r\n", | 770 "Content-Type: text/html\r\n", |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
946 DelayRefresh(&ie_mock_, &loop_, 2000), | 951 DelayRefresh(&ie_mock_, &loop_, 2000), |
947 DelayCloseBrowserMock(&loop_, 4000, &ie_mock_))); | 952 DelayCloseBrowserMock(&loop_, 4000, &ie_mock_))); |
948 | 953 |
949 EXPECT_CALL(ie_mock_, OnLoad(in_cf, StrEq(src_url))) | 954 EXPECT_CALL(ie_mock_, OnLoad(in_cf, StrEq(src_url))) |
950 .Times(2); | 955 .Times(2); |
951 | 956 |
952 LaunchIEAndNavigate(src_url); | 957 LaunchIEAndNavigate(src_url); |
953 } | 958 } |
954 | 959 |
955 } // namespace chrome_frame_test | 960 } // namespace chrome_frame_test |
OLD | NEW |