| 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/host_content_settings_map.h" | 7 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| 11 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 11 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 12 #include "chrome/test/in_process_browser_test.h" | 12 #include "chrome/test/base/in_process_browser_test.h" |
| 13 #include "chrome/test/ui_test_utils.h" | 13 #include "chrome/test/base/ui_test_utils.h" |
| 14 #include "net/test/test_server.h" | 14 #include "net/test/test_server.h" |
| 15 | 15 |
| 16 // Regression test for http://crbug.com/63649. | 16 // Regression test for http://crbug.com/63649. |
| 17 IN_PROC_BROWSER_TEST_F(InProcessBrowserTest, RedirectLoopCookies) { | 17 IN_PROC_BROWSER_TEST_F(InProcessBrowserTest, RedirectLoopCookies) { |
| 18 ASSERT_TRUE(test_server()->Start()); | 18 ASSERT_TRUE(test_server()->Start()); |
| 19 | 19 |
| 20 GURL test_url = test_server()->GetURL("files/redirect-loop.html"); | 20 GURL test_url = test_server()->GetURL("files/redirect-loop.html"); |
| 21 | 21 |
| 22 browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting( | 22 browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting( |
| 23 CONTENT_SETTINGS_TYPE_COOKIES, CONTENT_SETTING_BLOCK); | 23 CONTENT_SETTINGS_TYPE_COOKIES, CONTENT_SETTING_BLOCK); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting( | 63 browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting( |
| 64 CONTENT_SETTINGS_TYPE_COOKIES, CONTENT_SETTING_BLOCK); | 64 CONTENT_SETTINGS_TYPE_COOKIES, CONTENT_SETTING_BLOCK); |
| 65 | 65 |
| 66 ui_test_utils::NavigateToURL(browser(), test_url); | 66 ui_test_utils::NavigateToURL(browser(), test_url); |
| 67 | 67 |
| 68 TabContentsWrapper* tab_contents = browser()->GetSelectedTabContentsWrapper(); | 68 TabContentsWrapper* tab_contents = browser()->GetSelectedTabContentsWrapper(); |
| 69 | 69 |
| 70 EXPECT_TRUE(tab_contents->content_settings()->IsContentBlocked( | 70 EXPECT_TRUE(tab_contents->content_settings()->IsContentBlocked( |
| 71 CONTENT_SETTINGS_TYPE_COOKIES)); | 71 CONTENT_SETTINGS_TYPE_COOKIES)); |
| 72 } | 72 } |
| OLD | NEW |