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 : ChromeRenderViewHostTestHarness(), |
jam
2011/09/13 18:04:03
nit: not really needed
| |
17 browser_thread_(BrowserThread::UI, &message_loop_) {} | 17 browser_thread_(BrowserThread::UI, &message_loop_) {} |
18 | 18 |
19 private: | 19 private: |
20 BrowserThread browser_thread_; | 20 BrowserThread browser_thread_; |
21 | 21 |
22 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettingsTest); | 22 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettingsTest); |
23 }; | 23 }; |
24 | 24 |
25 TEST_F(TabSpecificContentSettingsTest, BlockedContent) { | 25 TEST_F(TabSpecificContentSettingsTest, BlockedContent) { |
26 TabSpecificContentSettings content_settings(contents()); | 26 TabSpecificContentSettings content_settings(contents()); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 content_settings.IsContentAccessed(CONTENT_SETTINGS_TYPE_COOKIES)); | 128 content_settings.IsContentAccessed(CONTENT_SETTINGS_TYPE_COOKIES)); |
129 ASSERT_FALSE( | 129 ASSERT_FALSE( |
130 content_settings.IsContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES)); | 130 content_settings.IsContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES)); |
131 content_settings.OnCookiesRead( | 131 content_settings.OnCookiesRead( |
132 GURL("http://google.com"), net::CookieList(), true); | 132 GURL("http://google.com"), net::CookieList(), true); |
133 ASSERT_FALSE( | 133 ASSERT_FALSE( |
134 content_settings.IsContentAccessed(CONTENT_SETTINGS_TYPE_COOKIES)); | 134 content_settings.IsContentAccessed(CONTENT_SETTINGS_TYPE_COOKIES)); |
135 ASSERT_FALSE( | 135 ASSERT_FALSE( |
136 content_settings.IsContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES)); | 136 content_settings.IsContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES)); |
137 } | 137 } |
OLD | NEW |