Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3835)

Unified Diff: chrome/browser/renderer_host/test/render_view_host_browsertest.cc

Issue 5254005: Do not reset the content settings delegate's cookies when a network error occurred. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/browser/tab_contents
Patch Set: updates Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/renderer_host/test/render_view_host_browsertest.cc
diff --git a/chrome/browser/renderer_host/test/render_view_host_browsertest.cc b/chrome/browser/renderer_host/test/render_view_host_browsertest.cc
index c93a3a5281afd797c2351addb2cf4539d7680692..4989e6a7cda8e1f6d1d4f4e1e52151198686816c 100644
--- a/chrome/browser/renderer_host/test/render_view_host_browsertest.cc
+++ b/chrome/browser/renderer_host/test/render_view_host_browsertest.cc
@@ -4,8 +4,11 @@
#include "base/utf_string_conversions.h"
#include "base/values.h"
+#include "chrome/browser/host_content_settings_map.h"
+#include "chrome/browser/profile.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/tab_contents/tab_contents.h"
+#include "chrome/browser/tab_contents/tab_specific_content_settings.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/in_process_browser_test.h"
#include "chrome/test/ui_test_utils.h"
@@ -91,3 +94,22 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostTest,
EXPECT_FALSE(bool_value);
}
}
+
+// Regression test for http://crbug.com/63649.
+IN_PROC_BROWSER_TEST_F(RenderViewHostTest, RedirectLoopCookies) {
+ ASSERT_TRUE(test_server()->Start());
+
+ GURL test_url = test_server()->GetURL("files/redirect-loop.html");
+
+ browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting(
+ CONTENT_SETTINGS_TYPE_COOKIES, CONTENT_SETTING_BLOCK);
+
+ ui_test_utils::NavigateToURL(browser(), test_url);
+
+ TabContents* tab_contents = browser()->GetSelectedTabContents();
+ ASSERT_EQ(UTF8ToUTF16(test_url.spec() + " failed to load"),
+ tab_contents->GetTitle());
+
+ EXPECT_TRUE(tab_contents->GetTabSpecificContentSettings()->IsContentBlocked(
+ CONTENT_SETTINGS_TYPE_COOKIES));
+}

Powered by Google App Engine
This is Rietveld 408576698