| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "content/browser/child_process_security_policy_impl.h" | 10 #include "content/browser/child_process_security_policy_impl.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 int32_t routing_id = process()->GetNextRoutingID(); | 81 int32_t routing_id = process()->GetNextRoutingID(); |
| 82 test_rvh()->CreateNewFullscreenWidget(routing_id); | 82 test_rvh()->CreateNewFullscreenWidget(routing_id); |
| 83 } | 83 } |
| 84 | 84 |
| 85 // Ensure we do not grant bindings to a process shared with unprivileged views. | 85 // Ensure we do not grant bindings to a process shared with unprivileged views. |
| 86 TEST_F(RenderViewHostTest, DontGrantBindingsToSharedProcess) { | 86 TEST_F(RenderViewHostTest, DontGrantBindingsToSharedProcess) { |
| 87 // Create another view in the same process. | 87 // Create another view in the same process. |
| 88 std::unique_ptr<TestWebContents> new_web_contents( | 88 std::unique_ptr<TestWebContents> new_web_contents( |
| 89 TestWebContents::Create(browser_context(), rvh()->GetSiteInstance())); | 89 TestWebContents::Create(browser_context(), rvh()->GetSiteInstance())); |
| 90 | 90 |
| 91 rvh()->AllowBindings(BINDINGS_POLICY_WEB_UI); | 91 rvh()->GetMainFrame()->AllowBindings(BINDINGS_POLICY_WEB_UI); |
| 92 EXPECT_FALSE(rvh()->GetEnabledBindings() & BINDINGS_POLICY_WEB_UI); | 92 EXPECT_FALSE(rvh()->GetMainFrame()->GetEnabledBindings() & |
| 93 BINDINGS_POLICY_WEB_UI); |
| 93 } | 94 } |
| 94 | 95 |
| 95 class MockDraggingRenderViewHostDelegateView | 96 class MockDraggingRenderViewHostDelegateView |
| 96 : public RenderViewHostDelegateView { | 97 : public RenderViewHostDelegateView { |
| 97 public: | 98 public: |
| 98 ~MockDraggingRenderViewHostDelegateView() override {} | 99 ~MockDraggingRenderViewHostDelegateView() override {} |
| 99 void StartDragging(const DropData& drop_data, | 100 void StartDragging(const DropData& drop_data, |
| 100 blink::WebDragOperationsMask allowed_ops, | 101 blink::WebDragOperationsMask allowed_ops, |
| 101 const gfx::ImageSkia& image, | 102 const gfx::ImageSkia& image, |
| 102 const gfx::Vector2d& image_offset, | 103 const gfx::Vector2d& image_offset, |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 const std::string data_url = "data:image/gif;base64," | 307 const std::string data_url = "data:image/gif;base64," |
| 307 "R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs="; | 308 "R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs="; |
| 308 | 309 |
| 309 tester->Reset(); | 310 tester->Reset(); |
| 310 tester->Test(data_url); | 311 tester->Test(data_url); |
| 311 EXPECT_EQ(tester->UrlString(), data_url); | 312 EXPECT_EQ(tester->UrlString(), data_url); |
| 312 EXPECT_TRUE(tester->IsDownloaded()); | 313 EXPECT_TRUE(tester->IsDownloaded()); |
| 313 } | 314 } |
| 314 | 315 |
| 315 } // namespace content | 316 } // namespace content |
| OLD | NEW |