diff options
author | kkania@chromium.org <kkania@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-02 21:26:34 +0000 |
---|---|---|
committer | kkania@chromium.org <kkania@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-02 21:26:34 +0000 |
commit | 586b3b0b16308c37fbf19f072dd82a448f456155 (patch) | |
tree | 4898b2914f167deabcddddc3f41e7bcacf1cd054 /chrome_frame/test/navigation_test.cc | |
parent | 4a729ae7ff3f615214d2120a2218a5bef4742c58 (diff) | |
download | chromium_src-586b3b0b16308c37fbf19f072dd82a448f456155.zip chromium_src-586b3b0b16308c37fbf19f072dd82a448f456155.tar.gz chromium_src-586b3b0b16308c37fbf19f072dd82a448f456155.tar.bz2 |
[chrome_frame] Add methods for finding and performing default action on Accessibility objects. Use this approach in one test.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/2895016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54603 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test/navigation_test.cc')
-rw-r--r-- | chrome_frame/test/navigation_test.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/chrome_frame/test/navigation_test.cc b/chrome_frame/test/navigation_test.cc index 2324f86..52f0aac 100644 --- a/chrome_frame/test/navigation_test.cc +++ b/chrome_frame/test/navigation_test.cc @@ -536,8 +536,8 @@ TEST_P(NavigationTransitionTest, DISABLED_JavascriptRedirection) { LaunchIEAndNavigate(redirect_url); } -// Test following a link by TAB + ENTER. -TEST_P(NavigationTransitionTest, FLAKY_FollowLink) { +// Test following a link. +TEST_P(NavigationTransitionTest, FollowLink) { if (page1_.invokes_cf() && page2_.invokes_cf() && GetInstalledIEVersion() > IE_6) { // For some reason IE 7 and 8 send two BeforeNavigate events for the second @@ -546,15 +546,16 @@ TEST_P(NavigationTransitionTest, FLAKY_FollowLink) { return; } ie_mock_.ExpectNavigation(page1_.invokes_cf(), GetLinkPageUrl()); - server_mock_.ExpectAndServeRequestAllowCache(page1_, GetLinkPageUrl()); + // Two requests are made when going from CF to IE, at least on Win7 IE8. + EXPECT_CALL(server_mock_, Get(_, UrlPathEq(GetLinkPageUrl()), _)) + .Times(testing::Between(1, 2)) + .WillRepeatedly(SendResponse(&server_mock_, page1_)); EXPECT_CALL(ie_mock_, OnLoad(page1_.invokes_cf(), StrEq(GetLinkPageUrl()))) - .WillOnce(testing::DoAll( - SetFocusToRenderer(&ie_mock_), - DelaySendChar(&loop_, 500, VK_TAB, simulate_input::NONE), - DelaySendChar(&loop_, 1000, VK_RETURN, simulate_input::NONE))); + .WillOnce(DoDefaultUIActionInDocument(&ie_mock_, + UIObjectMatcher(L"", L"link"))); ie_mock_.ExpectNavigation(page2_.invokes_cf(), GetSimplePageUrl()); - server_mock_.ExpectAndServeRequestAllowCache(page2_, GetSimplePageUrl()); + server_mock_.ExpectAndServeRequest(page2_, GetSimplePageUrl()); EXPECT_CALL(ie_mock_, OnLoad(page2_.invokes_cf(), StrEq(GetSimplePageUrl()))) .WillOnce(testing::DoAll( VerifyAddressBarUrl(&ie_mock_), |