summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test/ui_test.cc
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-05 18:50:31 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-05 18:50:31 +0000
commitd118f54157b7a2cd0b76ff4c59027ae67024e438 (patch)
treef615fcefc7289662c28b4ba6d90bf0f449d6d364 /chrome_frame/test/ui_test.cc
parent222d11e382022d51bfc4ec560ae3d9f2b7fdb2e5 (diff)
downloadchromium_src-d118f54157b7a2cd0b76ff4c59027ae67024e438.zip
chromium_src-d118f54157b7a2cd0b76ff4c59027ae67024e438.tar.gz
chromium_src-d118f54157b7a2cd0b76ff4c59027ae67024e438.tar.bz2
Back forward transitions would not work within ChromeFrame when attempted via the context menu.
This was because the Back and Forward menu items on the context menu were disabled. The context menu is displayed by the active document in IE and it attempts to enable/disable these items based on entries in the IE travel log. The enabling of these items was failing as we were incorrectly passing in the string id of these options instead of their command id equivalents Should fix bug http://code.google.com/p/chromium/issues/detail?id=34657 Bug=34657 Test=Covered by new ChromeFrame context menu back forward test. Review URL: http://codereview.chromium.org/4500002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65231 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test/ui_test.cc')
-rw-r--r--chrome_frame/test/ui_test.cc70
1 files changed, 70 insertions, 0 deletions
diff --git a/chrome_frame/test/ui_test.cc b/chrome_frame/test/ui_test.cc
index 169bcc1..c308637 100644
--- a/chrome_frame/test/ui_test.cc
+++ b/chrome_frame/test/ui_test.cc
@@ -647,4 +647,74 @@ TEST_F(ContextMenuTest, IEBackForward) {
LaunchIEAndNavigate(page1);
}
+TEST_F(ContextMenuTest, CFBackForward) {
+ std::wstring page1 = GetLinkPageUrl();
+ std::wstring page2 = GetSimplePageUrl();
+ std::wstring page3 = GetTestUrl(L"anchor.html");
+
+ server_mock_.ExpectAndServeRequestWithCardinality(
+ CFInvocation::MetaTag(), page1, testing::Exactly(2));
+
+ server_mock_.ExpectAndServeRequestWithCardinality(
+ CFInvocation::None(), page2, testing::Exactly(3));
+
+ server_mock_.ExpectAndServeRequestWithCardinality(
+ CFInvocation::MetaTag(), page3, testing::Exactly(2));
+
+ InSequence expect_in_sequence_for_scope;
+
+ // Navigate to second page.
+ EXPECT_CALL(acc_observer_, OnAccDocLoad(_))
+ .WillOnce(testing::DoAll(
+ VerifyPageLoad(&ie_mock_, IN_CF, page1),
+ Navigate(&ie_mock_, page2)));
+
+ // Navigate to third page.
+ EXPECT_CALL(acc_observer_, OnAccDocLoad(_))
+ .WillOnce(testing::DoAll(
+ VerifyPageLoad(&ie_mock_, IN_IE, page2),
+ Navigate(&ie_mock_, page3)));
+
+ // Go back.
+ EXPECT_CALL(acc_observer_, OnAccDocLoad(_))
+ .WillOnce(testing::DoAll(
+ VerifyPageLoad(&ie_mock_, IN_CF, page3),
+ OpenContextMenuAsync()));
+
+ EXPECT_CALL(acc_observer_, OnMenuPopup(_))
+ .WillOnce(AccLeftClick(AccObjectMatcher(L"Back")));
+
+ // Go back
+ EXPECT_CALL(acc_observer_, OnAccDocLoad(_))
+ .WillOnce(testing::DoAll(
+ VerifyPageLoad(&ie_mock_, IN_IE, page2),
+ OpenContextMenuAsync()));
+
+ EXPECT_CALL(acc_observer_, OnMenuPopup(_))
+ .WillOnce(AccLeftClick(AccObjectMatcher(L"Back")));
+
+ // Go forward.
+ EXPECT_CALL(acc_observer_, OnAccDocLoad(_))
+ .WillOnce(testing::DoAll(
+ VerifyPageLoad(&ie_mock_, IN_CF, page1),
+ OpenContextMenuAsync()));
+
+ EXPECT_CALL(acc_observer_, OnMenuPopup(_))
+ .WillOnce(AccLeftClick(AccObjectMatcher(L"Forward")));
+
+ // Go forward.
+ EXPECT_CALL(acc_observer_, OnAccDocLoad(_))
+ .WillOnce(testing::DoAll(
+ VerifyPageLoad(&ie_mock_, IN_IE, page2),
+ OpenContextMenuAsync()));
+
+ EXPECT_CALL(acc_observer_, OnMenuPopup(_))
+ .WillOnce(AccLeftClick(AccObjectMatcher(L"Forward")));
+
+ EXPECT_CALL(ie_mock_, OnLoad(IN_CF, StrEq(page3)))
+ .WillOnce(CloseBrowserMock(&ie_mock_));
+
+ LaunchIEAndNavigate(page1);
+}
+
} // namespace chrome_frame_test