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

Side by Side Diff: chrome/browser/errorpage_uitest.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 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/string_util.h" 5 #include "base/string_util.h"
6 #include "base/utf_string_conversions.h"
6 #include "chrome/test/automation/tab_proxy.h" 7 #include "chrome/test/automation/tab_proxy.h"
7 #include "chrome/test/ui/ui_test.h" 8 #include "chrome/test/ui/ui_test.h"
8 #include "chrome/browser/net/url_request_failed_dns_job.h" 9 #include "chrome/browser/net/url_request_failed_dns_job.h"
9 #include "chrome/browser/net/url_request_mock_http_job.h" 10 #include "chrome/browser/net/url_request_mock_http_job.h"
10 #include "net/test/test_server.h" 11 #include "net/test/test_server.h"
11 12
12 class ErrorPageTest : public UITest { 13 class ErrorPageTest : public UITest {
13 protected: 14 protected:
14 bool WaitForTitleMatching(const std::wstring& title) { 15 bool WaitForTitleMatching(const std::wstring& title) {
15 for (int i = 0; i < 10; ++i) { 16 for (int i = 0; i < 10; ++i) {
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 // page. 202 // page.
202 NavigateToURLBlockUntilNavigationsComplete( 203 NavigateToURLBlockUntilNavigationsComplete(
203 URLRequestMockHTTPJob::GetMockUrl( 204 URLRequestMockHTTPJob::GetMockUrl(
204 FilePath(FILE_PATH_LITERAL("page404.html"))), 2); 205 FilePath(FILE_PATH_LITERAL("page404.html"))), 2);
205 EXPECT_TRUE(WaitForTitleMatching(L"Mock Link Doctor")); 206 EXPECT_TRUE(WaitForTitleMatching(L"Mock Link Doctor"));
206 207
207 EXPECT_TRUE(GetActiveTab()->GoBack()); 208 EXPECT_TRUE(GetActiveTab()->GoBack());
208 209
209 EXPECT_TRUE(WaitForTitleMatching(L"Title Of Awesomeness")); 210 EXPECT_TRUE(WaitForTitleMatching(L"Title Of Awesomeness"));
210 } 211 }
212
213 // Regression test for http://crbug.com/63649.
214 TEST_F(ErrorPageTest, RedirectLoopCookies) {
215 net::TestServer test_server(net::TestServer::TYPE_HTTP,
216 FilePath(FILE_PATH_LITERAL("chrome/test/data")));
217 ASSERT_TRUE(test_server.Start());
218
219 GURL test_url = test_server.GetURL("files/redirect-loop.html");
220
221 ASSERT_TRUE(automation()->GetBrowserWindow(0)->SetDefaultContentSetting(
222 CONTENT_SETTINGS_TYPE_COOKIES, CONTENT_SETTING_BLOCK));
223
224 NavigateToURLBlockUntilNavigationsComplete(test_url, 1);
225 ASSERT_TRUE(
226 WaitForTitleMatching(UTF8ToWide(test_url.spec()) + L" failed to load"));
227
228 bool content_blocked = false;
229 ASSERT_TRUE(GetActiveTab()->IsContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES,
230 &content_blocked));
231 EXPECT_TRUE(content_blocked);
232 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698