OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 // Fails due to http://crbug.com/104300 | 78 // Fails due to http://crbug.com/104300 |
79 TEST_F(ChromeRenderViewTest, FAILS_AllowDOMStorage) { | 79 TEST_F(ChromeRenderViewTest, DISABLED_AllowDOMStorage) { |
80 // Load some HTML, so we have a valid security origin. | 80 // Load some HTML, so we have a valid security origin. |
81 LoadHTML("<html></html>"); | 81 LoadHTML("<html></html>"); |
82 MockContentSettingsObserver observer(view_); | 82 MockContentSettingsObserver observer(view_); |
83 ON_CALL(observer, | 83 ON_CALL(observer, |
84 OnAllowDOMStorage(_, _, _, _, _)).WillByDefault(DeleteArg<4>()); | 84 OnAllowDOMStorage(_, _, _, _, _)).WillByDefault(DeleteArg<4>()); |
85 EXPECT_CALL(observer, | 85 EXPECT_CALL(observer, |
86 OnAllowDOMStorage(_, _, _, _, _)); | 86 OnAllowDOMStorage(_, _, _, _, _)); |
87 observer.AllowStorage(view_->GetWebView()->focusedFrame(), true); | 87 observer.AllowStorage(view_->GetWebView()->focusedFrame(), true); |
88 | 88 |
89 // 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 EXPECT_FALSE(was_blocked); | 380 EXPECT_FALSE(was_blocked); |
381 | 381 |
382 // Verify that images are allowed. | 382 // Verify that images are allowed. |
383 EXPECT_CALL( | 383 EXPECT_CALL( |
384 mock_observer, | 384 mock_observer, |
385 OnContentBlocked(CONTENT_SETTINGS_TYPE_IMAGES, std::string())).Times(0); | 385 OnContentBlocked(CONTENT_SETTINGS_TYPE_IMAGES, std::string())).Times(0); |
386 EXPECT_TRUE(observer->AllowImage(GetMainFrame(), true, | 386 EXPECT_TRUE(observer->AllowImage(GetMainFrame(), true, |
387 mock_observer.image_url_)); | 387 mock_observer.image_url_)); |
388 ::testing::Mock::VerifyAndClearExpectations(&observer); | 388 ::testing::Mock::VerifyAndClearExpectations(&observer); |
389 } | 389 } |
OLD | NEW |