Commit b5f9de67 authored by ananta@chromium.org's avatar ananta@chromium.org

The ChromeFrame persistent cookie test creates persistent cookies and reloads...

The ChromeFrame persistent cookie test creates persistent cookies and reloads the current page via the gcf: protocol to load
it in chrome. The page when loaded in Chrome validates whether the cookies were set. This does not work correctly on IE8 in Vista
and windows 7 as the cookie stores are partitioned.

Fix is redirect the page to a target page which validates the cookies.

Review URL: http://codereview.chromium.org/3053018

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53891 0039d316-1c4b-4281-b951-d872f2087c98
parent 309a0c3b
<html>
<head>
<meta http-equiv="x-ua-compatible" content="chrome=1" />
<title>Persistent host browser chrome frame cookie test final page</title>
<script type="text/javascript"
src="chrome_frame_tester_helpers.js"></script>
<script type="text/javascript">
function validatePersistentCookie() {
if (!isRunningInChrome()) {
onFailure("PersistentCookieTest", 1, "Not running in Chrome");
} else {
if (readCookie("PersistentCookie1") != "Cookie1" ||
readCookie("PersistentCookie2") != "Cookie2") {
onFailure("PersistentCookieTest", 1, "Failed");
} else {
onSuccess("PersistentCookieTest", 1);
}
}
eraseCookie("PersistentCookie1");
eraseCookie("PersistentCookie2");
}
</script>
</head>
<body onLoad="validatePersistentCookie();">
<h2>Persistent cookie validation page.!</h2>
</body>
</html>
<html> <html>
<head><title>Persistent host browser chrome frame cookie test</title> <head><title>Persistent host browser chrome frame cookie test page</title>
<script type="text/javascript" <script type="text/javascript"
src="chrome_frame_tester_helpers.js"></script> src="chrome_frame_tester_helpers.js"></script>
<script type="text/javascript"> <script type="text/javascript">
function validatePersistentCookie() {
if (readCookie("PersistentCookie1") != "Cookie1" ||
readCookie("PersistentCookie2") != "Cookie2") {
onFailure("PersistentCookieTest", 1, "Failed");
} else {
onSuccess("PersistentCookieTest", 1);
}
eraseCookie("PersistentCookie1");
eraseCookie("PersistentCookie2");
}
function setPersistentCookieAndRedirect() { function setPersistentCookieAndRedirect() {
if (isRunningInMSIE()) { if (isRunningInMSIE()) {
...@@ -21,9 +11,9 @@ ...@@ -21,9 +11,9 @@
eraseCookie("PersistentCookie2"); eraseCookie("PersistentCookie2");
createCookie("PersistentCookie1", "Cookie1", 365); createCookie("PersistentCookie1", "Cookie1", 365);
createCookie("PersistentCookie2", "Cookie2", 365); createCookie("PersistentCookie2", "Cookie2", 365);
reloadUsingCFProtocol(); document.location = "persistent_cookie_test_final_page.html";
} else { } else {
validatePersistentCookie(); onFailure("PersistentCookieTest", 1, "Incorrectly loaded in chrome");
} }
} }
</script> </script>
...@@ -31,6 +21,6 @@ ...@@ -31,6 +21,6 @@
<body onLoad="setTimeout(setPersistentCookieAndRedirect, 100);"> <body onLoad="setTimeout(setPersistentCookieAndRedirect, 100);">
<h2>Prepare to be redirected!</h2> <h2>Prepare to be redirected!</h2>
<p>Sets two persistent cookies in the host and redirects ChromeFrame <br /> <p>Sets two persistent cookies in the host and redirects ChromeFrame <br />
to the same page </p> to a page which validates the cookies.</p>
</body> </body>
</html> </html>
...@@ -772,10 +772,7 @@ TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_CFProtocol) { ...@@ -772,10 +772,7 @@ TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_CFProtocol) {
const wchar_t kPersistentCookieTest[] = const wchar_t kPersistentCookieTest[] =
L"files/persistent_cookie_test_page.html"; L"files/persistent_cookie_test_page.html";
TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_PersistentCookieTest) { TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_PersistentCookieTest) {
// Temporarily enable gcf: protocol for this test.
SetConfigBool(kEnableGCFProtocol, true);
SimpleBrowserTest(IE, kPersistentCookieTest, L"PersistentCookieTest"); SimpleBrowserTest(IE, kPersistentCookieTest, L"PersistentCookieTest");
SetConfigBool(kEnableGCFProtocol, false);
} }
const wchar_t kNavigateOutPage[] = L"files/navigate_out.html"; const wchar_t kNavigateOutPage[] = L"files/navigate_out.html";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment