| 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/common/content_settings.h" | 5 #include "chrome/common/content_settings.h" |
| 6 #include "chrome/common/render_messages.h" | 6 #include "chrome/common/render_messages.h" |
| 7 #include "chrome/renderer/content_settings_observer.h" | 7 #include "chrome/renderer/content_settings_observer.h" |
| 8 #include "chrome/test/base/chrome_render_view_test.h" | 8 #include "chrome/test/base/chrome_render_view_test.h" |
| 9 #include "content/public/renderer/render_view.h" | 9 #include "content/public/renderer/render_view.h" |
| 10 #include "ipc/ipc_message_macros.h" | 10 #include "ipc/ipc_message_macros.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 std::string kBarPlugin = "bar"; | 68 std::string kBarPlugin = "bar"; |
| 69 EXPECT_CALL(observer, | 69 EXPECT_CALL(observer, |
| 70 OnContentBlocked(CONTENT_SETTINGS_TYPE_PLUGINS, kFooPlugin)); | 70 OnContentBlocked(CONTENT_SETTINGS_TYPE_PLUGINS, kFooPlugin)); |
| 71 EXPECT_CALL(observer, | 71 EXPECT_CALL(observer, |
| 72 OnContentBlocked(CONTENT_SETTINGS_TYPE_PLUGINS, kBarPlugin)); | 72 OnContentBlocked(CONTENT_SETTINGS_TYPE_PLUGINS, kBarPlugin)); |
| 73 observer.DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS, kFooPlugin); | 73 observer.DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS, kFooPlugin); |
| 74 observer.DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS, kBarPlugin); | 74 observer.DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS, kBarPlugin); |
| 75 } | 75 } |
| 76 | 76 |
| 77 // Tests that multiple invokations of AllowDOMStorage result in a single IPC. | 77 // Tests that multiple invokations of AllowDOMStorage result in a single IPC. |
| 78 TEST_F(ChromeRenderViewTest, AllowDOMStorage) { | 78 // Fails due to http://crbug.com/104300 |
| 79 TEST_F(ChromeRenderViewTest, FAILS_AllowDOMStorage) { |
| 79 // Load some HTML, so we have a valid security origin. | 80 // Load some HTML, so we have a valid security origin. |
| 80 LoadHTML("<html></html>"); | 81 LoadHTML("<html></html>"); |
| 81 MockContentSettingsObserver observer(view_); | 82 MockContentSettingsObserver observer(view_); |
| 82 ON_CALL(observer, | 83 ON_CALL(observer, |
| 83 OnAllowDOMStorage(_, _, _, _, _)).WillByDefault(DeleteArg<4>()); | 84 OnAllowDOMStorage(_, _, _, _, _)).WillByDefault(DeleteArg<4>()); |
| 84 EXPECT_CALL(observer, | 85 EXPECT_CALL(observer, |
| 85 OnAllowDOMStorage(_, _, _, _, _)); | 86 OnAllowDOMStorage(_, _, _, _, _)); |
| 86 observer.AllowStorage(view_->GetWebView()->focusedFrame(), true); | 87 observer.AllowStorage(view_->GetWebView()->focusedFrame(), true); |
| 87 | 88 |
| 88 // Accessing localStorage from the same origin again shouldn't result in a | 89 // Accessing localStorage from the same origin again shouldn't result in a |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 ContentSettingsPattern::FromString(mock_observer.image_origin_), | 241 ContentSettingsPattern::FromString(mock_observer.image_origin_), |
| 241 CONTENT_SETTING_BLOCK, | 242 CONTENT_SETTING_BLOCK, |
| 242 "", | 243 "", |
| 243 false)); | 244 false)); |
| 244 EXPECT_CALL(mock_observer, | 245 EXPECT_CALL(mock_observer, |
| 245 OnContentBlocked(CONTENT_SETTINGS_TYPE_IMAGES, std::string())); | 246 OnContentBlocked(CONTENT_SETTINGS_TYPE_IMAGES, std::string())); |
| 246 EXPECT_FALSE(observer->AllowImage(GetMainFrame(), | 247 EXPECT_FALSE(observer->AllowImage(GetMainFrame(), |
| 247 true, mock_observer.image_url_)); | 248 true, mock_observer.image_url_)); |
| 248 ::testing::Mock::VerifyAndClearExpectations(&observer); | 249 ::testing::Mock::VerifyAndClearExpectations(&observer); |
| 249 } | 250 } |
| OLD | NEW |