OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/stringprintf.h" | 5 #include "base/stringprintf.h" |
6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
7 #include "chrome/browser/content_settings/cookie_settings.h" | 7 #include "chrome/browser/content_settings/cookie_settings.h" |
8 #include "chrome/browser/content_settings/host_content_settings_map.h" | 8 #include "chrome/browser/content_settings/host_content_settings_map.h" |
9 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 9 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
12 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 12 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
13 #include "chrome/test/base/in_process_browser_test.h" | 13 #include "chrome/test/base/in_process_browser_test.h" |
14 #include "chrome/test/base/ui_test_utils.h" | 14 #include "chrome/test/base/ui_test_utils.h" |
| 15 #include "content/browser/tab_contents/tab_contents.h" |
15 #include "net/test/test_server.h" | 16 #include "net/test/test_server.h" |
16 | 17 |
17 // Regression test for http://crbug.com/63649. | 18 // Regression test for http://crbug.com/63649. |
18 IN_PROC_BROWSER_TEST_F(InProcessBrowserTest, RedirectLoopCookies) { | 19 IN_PROC_BROWSER_TEST_F(InProcessBrowserTest, RedirectLoopCookies) { |
19 ASSERT_TRUE(test_server()->Start()); | 20 ASSERT_TRUE(test_server()->Start()); |
20 | 21 |
21 GURL test_url = test_server()->GetURL("files/redirect-loop.html"); | 22 GURL test_url = test_server()->GetURL("files/redirect-loop.html"); |
22 | 23 |
23 CookieSettings::GetForProfile(browser()->profile())-> | 24 CookieSettings::GetForProfile(browser()->profile())-> |
24 SetDefaultCookieSetting(CONTENT_SETTING_BLOCK); | 25 SetDefaultCookieSetting(CONTENT_SETTING_BLOCK); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 CookieSettings::GetForProfile(browser()->profile())-> | 65 CookieSettings::GetForProfile(browser()->profile())-> |
65 SetDefaultCookieSetting(CONTENT_SETTING_BLOCK); | 66 SetDefaultCookieSetting(CONTENT_SETTING_BLOCK); |
66 | 67 |
67 ui_test_utils::NavigateToURL(browser(), test_url); | 68 ui_test_utils::NavigateToURL(browser(), test_url); |
68 | 69 |
69 TabContentsWrapper* tab_contents = browser()->GetSelectedTabContentsWrapper(); | 70 TabContentsWrapper* tab_contents = browser()->GetSelectedTabContentsWrapper(); |
70 | 71 |
71 EXPECT_TRUE(tab_contents->content_settings()->IsContentBlocked( | 72 EXPECT_TRUE(tab_contents->content_settings()->IsContentBlocked( |
72 CONTENT_SETTINGS_TYPE_COOKIES)); | 73 CONTENT_SETTINGS_TYPE_COOKIES)); |
73 } | 74 } |
OLD | NEW |