| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
| 6 #include "base/values.h" | 6 #include "base/values.h" |
| 7 #include "chrome/browser/host_content_settings_map.h" |
| 8 #include "chrome/browser/profile.h" |
| 7 #include "chrome/browser/renderer_host/render_view_host.h" | 9 #include "chrome/browser/renderer_host/render_view_host.h" |
| 8 #include "chrome/browser/tab_contents/tab_contents.h" | 10 #include "chrome/browser/tab_contents/tab_contents.h" |
| 11 #include "chrome/browser/tab_contents/tab_specific_content_settings.h" |
| 9 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/test/in_process_browser_test.h" | 13 #include "chrome/test/in_process_browser_test.h" |
| 11 #include "chrome/test/ui_test_utils.h" | 14 #include "chrome/test/ui_test_utils.h" |
| 12 #include "net/test/test_server.h" | 15 #include "net/test/test_server.h" |
| 13 | 16 |
| 14 typedef InProcessBrowserTest RenderViewHostTest; | 17 typedef InProcessBrowserTest RenderViewHostTest; |
| 15 | 18 |
| 16 typedef std::pair<int, Value*> ExecuteDetailType; | 19 typedef std::pair<int, Value*> ExecuteDetailType; |
| 17 | 20 |
| 18 namespace { | 21 namespace { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 &observer, | 87 &observer, |
| 85 NotificationType::EXECUTE_JAVASCRIPT_RESULT, | 88 NotificationType::EXECUTE_JAVASCRIPT_RESULT, |
| 86 Source<RenderViewHost>(rvh)); | 89 Source<RenderViewHost>(rvh)); |
| 87 EXPECT_EQ(execute_id2, observer.id()); | 90 EXPECT_EQ(execute_id2, observer.id()); |
| 88 ASSERT_TRUE(observer.value()); | 91 ASSERT_TRUE(observer.value()); |
| 89 bool bool_value; | 92 bool bool_value; |
| 90 ASSERT_TRUE(observer.value()->GetAsBoolean(&bool_value)); | 93 ASSERT_TRUE(observer.value()->GetAsBoolean(&bool_value)); |
| 91 EXPECT_FALSE(bool_value); | 94 EXPECT_FALSE(bool_value); |
| 92 } | 95 } |
| 93 } | 96 } |
| 97 |
| 98 // Regression test for http://crbug.com/63649. |
| 99 IN_PROC_BROWSER_TEST_F(RenderViewHostTest, RedirectLoopCookies) { |
| 100 ASSERT_TRUE(test_server()->Start()); |
| 101 |
| 102 GURL test_url = test_server()->GetURL("files/redirect-loop.html"); |
| 103 |
| 104 browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting( |
| 105 CONTENT_SETTINGS_TYPE_COOKIES, CONTENT_SETTING_BLOCK); |
| 106 |
| 107 ui_test_utils::NavigateToURL(browser(), test_url); |
| 108 |
| 109 TabContents* tab_contents = browser()->GetSelectedTabContents(); |
| 110 ASSERT_EQ(UTF8ToUTF16(test_url.spec() + " failed to load"), |
| 111 tab_contents->GetTitle()); |
| 112 |
| 113 EXPECT_TRUE(tab_contents->GetTabSpecificContentSettings()->IsContentBlocked( |
| 114 CONTENT_SETTINGS_TYPE_COOKIES)); |
| 115 } |
| OLD | NEW |