| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/debug/leak_annotations.h" | 8 #include "base/debug/leak_annotations.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "content/common/frame_messages.h" | 10 #include "content/common/frame_messages.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 EXPECT_TRUE(GetMainRenderFrame()->is_main_frame_); | 43 EXPECT_TRUE(GetMainRenderFrame()->is_main_frame_); |
| 44 | 44 |
| 45 FrameMsg_NewFrame_WidgetParams widget_params; | 45 FrameMsg_NewFrame_WidgetParams widget_params; |
| 46 widget_params.routing_id = kSubframeWidgetRouteId; | 46 widget_params.routing_id = kSubframeWidgetRouteId; |
| 47 widget_params.hidden = false; | 47 widget_params.hidden = false; |
| 48 | 48 |
| 49 IsolateAllSitesForTesting(base::CommandLine::ForCurrentProcess()); | 49 IsolateAllSitesForTesting(base::CommandLine::ForCurrentProcess()); |
| 50 | 50 |
| 51 LoadHTML("Parent frame <iframe name='frame'></iframe>"); | 51 LoadHTML("Parent frame <iframe name='frame'></iframe>"); |
| 52 | 52 |
| 53 FrameReplicationState frame_replication_state; |
| 54 frame_replication_state.name = "frame"; |
| 55 frame_replication_state.unique_name = "frame-uniqueName"; |
| 56 |
| 53 RenderFrameImpl::FromWebFrame( | 57 RenderFrameImpl::FromWebFrame( |
| 54 view_->GetMainRenderFrame()->GetWebFrame()->firstChild()) | 58 view_->GetMainRenderFrame()->GetWebFrame()->firstChild()) |
| 55 ->OnSwapOut(kFrameProxyRouteId, false, FrameReplicationState()); | 59 ->OnSwapOut(kFrameProxyRouteId, false, frame_replication_state); |
| 56 | 60 |
| 57 RenderFrameImpl::CreateFrame(kSubframeRouteId, MSG_ROUTING_NONE, | 61 RenderFrameImpl::CreateFrame( |
| 58 MSG_ROUTING_NONE, kFrameProxyRouteId, | 62 kSubframeRouteId, MSG_ROUTING_NONE, MSG_ROUTING_NONE, |
| 59 MSG_ROUTING_NONE, FrameReplicationState(), | 63 kFrameProxyRouteId, MSG_ROUTING_NONE, frame_replication_state, |
| 60 &compositor_deps_, widget_params, | 64 &compositor_deps_, widget_params, blink::WebFrameOwnerProperties()); |
| 61 blink::WebFrameOwnerProperties()); | |
| 62 | 65 |
| 63 frame_ = RenderFrameImpl::FromRoutingID(kSubframeRouteId); | 66 frame_ = RenderFrameImpl::FromRoutingID(kSubframeRouteId); |
| 64 EXPECT_FALSE(frame_->is_main_frame_); | 67 EXPECT_FALSE(frame_->is_main_frame_); |
| 65 } | 68 } |
| 66 | 69 |
| 67 void TearDown() override { | 70 void TearDown() override { |
| 68 #if defined(LEAK_SANITIZER) | 71 #if defined(LEAK_SANITIZER) |
| 69 // Do this before shutting down V8 in RenderViewTest::TearDown(). | 72 // Do this before shutting down V8 in RenderViewTest::TearDown(). |
| 70 // http://crbug.com/328552 | 73 // http://crbug.com/328552 |
| 71 __lsan_do_leak_check(); | 74 __lsan_do_leak_check(); |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 // but serves the purpose of testing the LoFi state logic. | 230 // but serves the purpose of testing the LoFi state logic. |
| 228 GetMainRenderFrame()->didCommitProvisionalLoad( | 231 GetMainRenderFrame()->didCommitProvisionalLoad( |
| 229 GetMainRenderFrame()->GetWebFrame(), item, blink::WebStandardCommit); | 232 GetMainRenderFrame()->GetWebFrame(), item, blink::WebStandardCommit); |
| 230 EXPECT_FALSE(GetMainRenderFrame()->IsUsingLoFi()); | 233 EXPECT_FALSE(GetMainRenderFrame()->IsUsingLoFi()); |
| 231 // The subframe would be deleted here after a cross-document navigation. It | 234 // The subframe would be deleted here after a cross-document navigation. It |
| 232 // happens to be left around in this test because this does not simulate the | 235 // happens to be left around in this test because this does not simulate the |
| 233 // frame detach. | 236 // frame detach. |
| 234 } | 237 } |
| 235 | 238 |
| 236 } // namespace | 239 } // namespace |
| OLD | NEW |