Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Side by Side Diff: content/renderer/render_frame_impl_browsertest.cc

Issue 1635873003: Replicating WebFrame::uniqueName across renderers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dump-render-tree3
Patch Set: Fixing fallout from the new assert in FrameTree.cpp. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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(kSubframeRouteId, MSG_ROUTING_NONE,
58 MSG_ROUTING_NONE, kFrameProxyRouteId, 62 MSG_ROUTING_NONE, kFrameProxyRouteId,
59 MSG_ROUTING_NONE, FrameReplicationState(), 63 MSG_ROUTING_NONE, frame_replication_state,
60 &compositor_deps_, widget_params, 64 &compositor_deps_, widget_params,
61 blink::WebFrameOwnerProperties()); 65 blink::WebFrameOwnerProperties());
62 66
63 frame_ = RenderFrameImpl::FromRoutingID(kSubframeRouteId); 67 frame_ = RenderFrameImpl::FromRoutingID(kSubframeRouteId);
64 EXPECT_FALSE(frame_->is_main_frame_); 68 EXPECT_FALSE(frame_->is_main_frame_);
65 } 69 }
66 70
67 void TearDown() override { 71 void TearDown() override {
68 #if defined(LEAK_SANITIZER) 72 #if defined(LEAK_SANITIZER)
69 // Do this before shutting down V8 in RenderViewTest::TearDown(). 73 // Do this before shutting down V8 in RenderViewTest::TearDown().
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 // but serves the purpose of testing the LoFi state logic. 231 // but serves the purpose of testing the LoFi state logic.
228 GetMainRenderFrame()->didCommitProvisionalLoad( 232 GetMainRenderFrame()->didCommitProvisionalLoad(
229 GetMainRenderFrame()->GetWebFrame(), item, blink::WebStandardCommit); 233 GetMainRenderFrame()->GetWebFrame(), item, blink::WebStandardCommit);
230 EXPECT_FALSE(GetMainRenderFrame()->IsUsingLoFi()); 234 EXPECT_FALSE(GetMainRenderFrame()->IsUsingLoFi());
231 // The subframe would be deleted here after a cross-document navigation. It 235 // 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 236 // happens to be left around in this test because this does not simulate the
233 // frame detach. 237 // frame detach.
234 } 238 }
235 239
236 } // namespace 240 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698