diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-28 01:22:43 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-28 01:22:43 +0000 |
commit | b5f9de67c1231759039f1d0eced5143c7d911ce5 (patch) | |
tree | 278c68744b94804f7f0614431fef53e00452a2b9 /chrome_frame | |
parent | 309a0c3bc90e0348a13727c30c15f39d06896d84 (diff) | |
download | chromium_src-b5f9de67c1231759039f1d0eced5143c7d911ce5.zip chromium_src-b5f9de67c1231759039f1d0eced5143c7d911ce5.tar.gz chromium_src-b5f9de67c1231759039f1d0eced5143c7d911ce5.tar.bz2 |
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
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/test/data/persistent_cookie_test_final_page.html | 28 | ||||
-rw-r--r-- | chrome_frame/test/data/persistent_cookie_test_page.html | 18 | ||||
-rw-r--r-- | chrome_frame/test/test_with_web_server.cc | 3 |
3 files changed, 32 insertions, 17 deletions
diff --git a/chrome_frame/test/data/persistent_cookie_test_final_page.html b/chrome_frame/test/data/persistent_cookie_test_final_page.html new file mode 100644 index 0000000..45b57da --- /dev/null +++ b/chrome_frame/test/data/persistent_cookie_test_final_page.html @@ -0,0 +1,28 @@ +<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>
diff --git a/chrome_frame/test/data/persistent_cookie_test_page.html b/chrome_frame/test/data/persistent_cookie_test_page.html index ea56262..c80c41a 100644 --- a/chrome_frame/test/data/persistent_cookie_test_page.html +++ b/chrome_frame/test/data/persistent_cookie_test_page.html @@ -1,19 +1,9 @@ <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"
src="chrome_frame_tester_helpers.js"></script>
<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() {
if (isRunningInMSIE()) {
@@ -21,9 +11,9 @@ eraseCookie("PersistentCookie2");
createCookie("PersistentCookie1", "Cookie1", 365);
createCookie("PersistentCookie2", "Cookie2", 365);
- reloadUsingCFProtocol();
+ document.location = "persistent_cookie_test_final_page.html";
} else {
- validatePersistentCookie();
+ onFailure("PersistentCookieTest", 1, "Incorrectly loaded in chrome");
}
}
</script>
@@ -31,6 +21,6 @@ <body onLoad="setTimeout(setPersistentCookieAndRedirect, 100);">
<h2>Prepare to be redirected!</h2>
<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>
</html>
diff --git a/chrome_frame/test/test_with_web_server.cc b/chrome_frame/test/test_with_web_server.cc index d35dcf7..7bd48b8 100644 --- a/chrome_frame/test/test_with_web_server.cc +++ b/chrome_frame/test/test_with_web_server.cc @@ -772,10 +772,7 @@ TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_CFProtocol) { const wchar_t kPersistentCookieTest[] = L"files/persistent_cookie_test_page.html"; TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_PersistentCookieTest) { - // Temporarily enable gcf: protocol for this test. - SetConfigBool(kEnableGCFProtocol, true); SimpleBrowserTest(IE, kPersistentCookieTest, L"PersistentCookieTest"); - SetConfigBool(kEnableGCFProtocol, false); } const wchar_t kNavigateOutPage[] = L"files/navigate_out.html"; |