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/win_util.h" | 8 #include "base/win_util.h" |
9 #include "chrome_frame/test/chrome_frame_test_utils.h" | 9 #include "chrome_frame/test/chrome_frame_test_utils.h" |
10 #include "chrome_frame/test/mock_ie_event_sink_actions.h" | 10 #include "chrome_frame/test/mock_ie_event_sink_actions.h" |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 .Times(2) | 625 .Times(2) |
626 .WillRepeatedly(CloseBrowserMock(&new_window_mock)); | 626 .WillRepeatedly(CloseBrowserMock(&new_window_mock)); |
627 | 627 |
628 EXPECT_CALL(new_window_mock, OnNavigateComplete2(_, _)); | 628 EXPECT_CALL(new_window_mock, OnNavigateComplete2(_, _)); |
629 | 629 |
630 EXPECT_CALL(new_window_mock, OnQuit()).WillOnce(CloseBrowserMock(&ie_mock_)); | 630 EXPECT_CALL(new_window_mock, OnQuit()).WillOnce(CloseBrowserMock(&ie_mock_)); |
631 | 631 |
632 LaunchIEAndNavigate(kDownloadFromNewWin); | 632 LaunchIEAndNavigate(kDownloadFromNewWin); |
633 } | 633 } |
634 | 634 |
635 } // namespace chrome_frame_test | 635 TEST_P(FullTabNavigationTest, FLAKY_FormPostBackForward) { |
| 636 bool in_cf = GetParam().invokes_cf(); |
| 637 // Navigate to the form-get.html page: |
| 638 // - First set focus to chrome renderer window |
| 639 // - Send over a character to the window. |
| 640 // - This should initiate a form post which eventually navigates to the |
| 641 // action.html page. |
| 642 // Navigate backwards from the action.html page and then navigate forward |
| 643 // from the form-get.html page. |
| 644 |
| 645 std::wstring kFormPostUrl = |
| 646 GetTestUrl(L"form-get.html"); |
| 647 |
| 648 std::wstring kFormPostActionUrl = |
| 649 GetTestUrl(L"action.html?field1=a&field2=b&submit=Submit"); |
| 650 |
| 651 server_mock_.ExpectAndServeAnyRequests(GetParam()); |
| 652 InSequence expect_in_sequence_for_scope; |
| 653 |
| 654 ie_mock_.ExpectNavigation(in_cf, kFormPostUrl); |
| 655 EXPECT_CALL(ie_mock_, OnLoad(in_cf, StrEq(kFormPostUrl))) |
| 656 .WillOnce(testing::DoAll( |
| 657 SetFocusToRenderer(&ie_mock_), |
| 658 DelaySendChar(&loop_, 500, 'C', simulate_input::NONE))); |
| 659 |
| 660 ie_mock_.ExpectNavigation(in_cf, kFormPostActionUrl); |
| 661 EXPECT_CALL(ie_mock_, OnLoad(in_cf, StrEq(kFormPostActionUrl))) |
| 662 .WillOnce(testing::DoAll( |
| 663 VerifyAddressBarUrl(&ie_mock_), |
| 664 DelayGoBack(&ie_mock_, &loop_, 0))); |
| 665 |
| 666 ie_mock_.ExpectNavigation(in_cf, kFormPostUrl); |
| 667 EXPECT_CALL(ie_mock_, OnLoad(in_cf, StrEq(kFormPostUrl))) |
| 668 .WillOnce(testing::DoAll( |
| 669 VerifyAddressBarUrl(&ie_mock_), |
| 670 DelayGoForward(&ie_mock_, &loop_, 0))); |
| 671 |
| 672 ie_mock_.ExpectNavigation(in_cf, kFormPostActionUrl); |
| 673 EXPECT_CALL(ie_mock_, OnLoad(in_cf, StrEq(kFormPostActionUrl))) |
| 674 .WillOnce(CloseBrowserMock(&ie_mock_)); |
| 675 |
| 676 LaunchIEAndNavigate(kFormPostUrl); |
| 677 } |
| 678 |
| 679 } // namespace chrome_frame_test |
| 680 |
OLD | NEW |