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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 171 |
172 FrameReplicationState result; | 172 FrameReplicationState result; |
173 // can't recover result.scope - no way to get WebTreeScopeType via public | 173 // can't recover result.scope - no way to get WebTreeScopeType via public |
174 // blink API... | 174 // blink API... |
175 result.name = base::UTF16ToUTF8(base::StringPiece16(frame->assignedName())); | 175 result.name = base::UTF16ToUTF8(base::StringPiece16(frame->assignedName())); |
176 result.unique_name = | 176 result.unique_name = |
177 base::UTF16ToUTF8(base::StringPiece16(frame->uniqueName())); | 177 base::UTF16ToUTF8(base::StringPiece16(frame->uniqueName())); |
178 result.sandbox_flags = frame->effectiveSandboxFlags(); | 178 result.sandbox_flags = frame->effectiveSandboxFlags(); |
179 // result.should_enforce_strict_mixed_content_checking is calculated in the | 179 // result.should_enforce_strict_mixed_content_checking is calculated in the |
180 // browser... | 180 // browser... |
181 result.origin = frame->securityOrigin(); | 181 result.origin = frame->getSecurityOrigin(); |
182 | 182 |
183 return result; | 183 return result; |
184 } | 184 } |
185 | 185 |
186 } // namespace | 186 } // namespace |
187 | 187 |
188 class RenderViewImplTest : public RenderViewTest { | 188 class RenderViewImplTest : public RenderViewTest { |
189 public: | 189 public: |
190 RenderViewImplTest() { | 190 RenderViewImplTest() { |
191 // Attach a pseudo keyboard device to this object. | 191 // Attach a pseudo keyboard device to this object. |
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
925 // WebRemoteFrame. | 925 // WebRemoteFrame. |
926 content::FrameReplicationState replication_state = | 926 content::FrameReplicationState replication_state = |
927 ReconstructReplicationStateForTesting(child_frame); | 927 ReconstructReplicationStateForTesting(child_frame); |
928 replication_state.origin = url::Origin(GURL("http://foo.com")); | 928 replication_state.origin = url::Origin(GURL("http://foo.com")); |
929 child_frame->SwapOut(kProxyRoutingId, true, replication_state); | 929 child_frame->SwapOut(kProxyRoutingId, true, replication_state); |
930 | 930 |
931 // The child frame should now be a WebRemoteFrame. | 931 // The child frame should now be a WebRemoteFrame. |
932 EXPECT_TRUE(web_frame->firstChild()->isWebRemoteFrame()); | 932 EXPECT_TRUE(web_frame->firstChild()->isWebRemoteFrame()); |
933 | 933 |
934 // Expect the origin to be updated properly. | 934 // Expect the origin to be updated properly. |
935 blink::WebSecurityOrigin origin = web_frame->firstChild()->securityOrigin(); | 935 blink::WebSecurityOrigin origin = |
| 936 web_frame->firstChild()->getSecurityOrigin(); |
936 EXPECT_EQ(origin.toString(), | 937 EXPECT_EQ(origin.toString(), |
937 WebString::fromUTF8(replication_state.origin.Serialize())); | 938 WebString::fromUTF8(replication_state.origin.Serialize())); |
938 | 939 |
939 // Now, swap out the second frame using a unique origin and verify that it is | 940 // Now, swap out the second frame using a unique origin and verify that it is |
940 // replicated correctly. | 941 // replicated correctly. |
941 replication_state.origin = url::Origin(); | 942 replication_state.origin = url::Origin(); |
942 TestRenderFrame* child_frame2 = static_cast<TestRenderFrame*>( | 943 TestRenderFrame* child_frame2 = static_cast<TestRenderFrame*>( |
943 RenderFrame::FromWebFrame(web_frame->lastChild())); | 944 RenderFrame::FromWebFrame(web_frame->lastChild())); |
944 child_frame2->SwapOut(kProxyRoutingId + 1, true, replication_state); | 945 child_frame2->SwapOut(kProxyRoutingId + 1, true, replication_state); |
945 EXPECT_TRUE(web_frame->lastChild()->isWebRemoteFrame()); | 946 EXPECT_TRUE(web_frame->lastChild()->isWebRemoteFrame()); |
946 EXPECT_TRUE(web_frame->lastChild()->securityOrigin().isUnique()); | 947 EXPECT_TRUE(web_frame->lastChild()->getSecurityOrigin().isUnique()); |
947 } | 948 } |
948 | 949 |
949 // Test for https://crbug.com/568676, where a parent detaches a remote child | 950 // Test for https://crbug.com/568676, where a parent detaches a remote child |
950 // while the browser navigates it to the parent's site in parallel, with the | 951 // while the browser navigates it to the parent's site in parallel, with the |
951 // detach happening after the provisional RenderFrame is created but before | 952 // detach happening after the provisional RenderFrame is created but before |
952 // FrameMsg_Navigate is received. This is a variant of | 953 // FrameMsg_Navigate is received. This is a variant of |
953 // https://crbug.com/526304. | 954 // https://crbug.com/526304. |
954 TEST_F(RenderViewImplTest, NavigateProxyAndDetachBeforeOnNavigate) { | 955 TEST_F(RenderViewImplTest, NavigateProxyAndDetachBeforeOnNavigate) { |
955 // This test should only run with --site-per-process. | 956 // This test should only run with --site-per-process. |
956 if (!AreAllSitesIsolatedForTesting()) | 957 if (!AreAllSitesIsolatedForTesting()) |
(...skipping 1517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2474 FROM_HERE, | 2475 FROM_HERE, |
2475 base::Bind(&DevToolsAgentTest::CloseWhilePaused, base::Unretained(this))); | 2476 base::Bind(&DevToolsAgentTest::CloseWhilePaused, base::Unretained(this))); |
2476 ExecuteJavaScriptForTests("debugger;"); | 2477 ExecuteJavaScriptForTests("debugger;"); |
2477 | 2478 |
2478 // CloseWhilePaused should resume execution and continue here. | 2479 // CloseWhilePaused should resume execution and continue here. |
2479 EXPECT_FALSE(IsPaused()); | 2480 EXPECT_FALSE(IsPaused()); |
2480 Detach(); | 2481 Detach(); |
2481 } | 2482 } |
2482 | 2483 |
2483 } // namespace content | 2484 } // namespace content |
OLD | NEW |