| 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 "chrome/browser/content_settings/tab_specific_content_settings.h" | 5 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 6 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| 6 #include "chrome/test/base/testing_profile.h" | 7 #include "chrome/test/base/testing_profile.h" |
| 7 #include "content/browser/browser_thread.h" | 8 #include "content/browser/browser_thread.h" |
| 8 #include "content/browser/renderer_host/test_render_view_host.h" | |
| 9 #include "content/browser/tab_contents/test_tab_contents.h" | 9 #include "content/browser/tab_contents/test_tab_contents.h" |
| 10 #include "net/base/cookie_monster.h" | 10 #include "net/base/cookie_monster.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 12 |
| 13 class TabSpecificContentSettingsTest : public RenderViewHostTestHarness { | 13 class TabSpecificContentSettingsTest : public ChromeRenderViewHostTestHarness { |
| 14 public: | 14 public: |
| 15 TabSpecificContentSettingsTest() | 15 TabSpecificContentSettingsTest() |
| 16 : RenderViewHostTestHarness(), | 16 : browser_thread_(BrowserThread::UI, &message_loop_) {} |
| 17 browser_thread_(BrowserThread::UI, &message_loop_) {} | |
| 18 | 17 |
| 19 private: | 18 private: |
| 20 BrowserThread browser_thread_; | 19 BrowserThread browser_thread_; |
| 21 | 20 |
| 22 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettingsTest); | 21 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettingsTest); |
| 23 }; | 22 }; |
| 24 | 23 |
| 25 TEST_F(TabSpecificContentSettingsTest, BlockedContent) { | 24 TEST_F(TabSpecificContentSettingsTest, BlockedContent) { |
| 26 TabSpecificContentSettings content_settings(contents()); | 25 TabSpecificContentSettings content_settings(contents()); |
| 27 net::CookieOptions options; | 26 net::CookieOptions options; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 content_settings.IsContentAccessed(CONTENT_SETTINGS_TYPE_COOKIES)); | 127 content_settings.IsContentAccessed(CONTENT_SETTINGS_TYPE_COOKIES)); |
| 129 ASSERT_FALSE( | 128 ASSERT_FALSE( |
| 130 content_settings.IsContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES)); | 129 content_settings.IsContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES)); |
| 131 content_settings.OnCookiesRead( | 130 content_settings.OnCookiesRead( |
| 132 GURL("http://google.com"), net::CookieList(), true); | 131 GURL("http://google.com"), net::CookieList(), true); |
| 133 ASSERT_FALSE( | 132 ASSERT_FALSE( |
| 134 content_settings.IsContentAccessed(CONTENT_SETTINGS_TYPE_COOKIES)); | 133 content_settings.IsContentAccessed(CONTENT_SETTINGS_TYPE_COOKIES)); |
| 135 ASSERT_FALSE( | 134 ASSERT_FALSE( |
| 136 content_settings.IsContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES)); | 135 content_settings.IsContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES)); |
| 137 } | 136 } |
| OLD | NEW |