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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/debug/leak_annotations.h" | 6 #include "base/debug/leak_annotations.h" |
7 #include "content/common/frame_messages.h" | 7 #include "content/common/frame_messages.h" |
8 #include "content/common/view_messages.h" | 8 #include "content/common/view_messages.h" |
9 #include "content/public/common/content_switches.h" | 9 #include "content/public/common/site_isolation_policy.h" |
10 #include "content/public/test/frame_load_waiter.h" | 10 #include "content/public/test/frame_load_waiter.h" |
11 #include "content/public/test/render_view_test.h" | 11 #include "content/public/test/render_view_test.h" |
12 #include "content/renderer/render_frame_impl.h" | 12 #include "content/renderer/render_frame_impl.h" |
13 #include "content/renderer/render_view_impl.h" | 13 #include "content/renderer/render_view_impl.h" |
14 #include "content/test/fake_compositor_dependencies.h" | 14 #include "content/test/fake_compositor_dependencies.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 16 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
17 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 17 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
18 | 18 |
19 namespace { | 19 namespace { |
(...skipping 17 matching lines...) Expand all Loading... |
37 EXPECT_FALSE(static_cast<RenderFrameImpl*>(view_->GetMainRenderFrame()) | 37 EXPECT_FALSE(static_cast<RenderFrameImpl*>(view_->GetMainRenderFrame()) |
38 ->is_subframe_); | 38 ->is_subframe_); |
39 | 39 |
40 FrameMsg_NewFrame_WidgetParams widget_params; | 40 FrameMsg_NewFrame_WidgetParams widget_params; |
41 widget_params.routing_id = kSubframeWidgetRouteId; | 41 widget_params.routing_id = kSubframeWidgetRouteId; |
42 widget_params.surface_id = kSubframeSurfaceId; | 42 widget_params.surface_id = kSubframeSurfaceId; |
43 widget_params.hidden = false; | 43 widget_params.hidden = false; |
44 | 44 |
45 compositor_deps_.reset(new FakeCompositorDependencies); | 45 compositor_deps_.reset(new FakeCompositorDependencies); |
46 | 46 |
47 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 47 SiteIsolationPolicy::IsolateAllSitesForTesting( |
48 switches::kSitePerProcess); | 48 base::CommandLine::ForCurrentProcess()); |
49 | 49 |
50 LoadHTML("Parent frame <iframe name='frame'></iframe>"); | 50 LoadHTML("Parent frame <iframe name='frame'></iframe>"); |
51 | 51 |
52 RenderFrameImpl::FromWebFrame( | 52 RenderFrameImpl::FromWebFrame( |
53 view_->GetMainRenderFrame()->GetWebFrame()->firstChild()) | 53 view_->GetMainRenderFrame()->GetWebFrame()->firstChild()) |
54 ->OnSwapOut(kFrameProxyRouteId, false, FrameReplicationState()); | 54 ->OnSwapOut(kFrameProxyRouteId, false, FrameReplicationState()); |
55 | 55 |
56 RenderFrameImpl::CreateFrame(kSubframeRouteId, kFrameProxyRouteId, | 56 RenderFrameImpl::CreateFrame(kSubframeRouteId, kFrameProxyRouteId, |
57 MSG_ROUTING_NONE, MSG_ROUTING_NONE, | 57 MSG_ROUTING_NONE, MSG_ROUTING_NONE, |
58 FrameReplicationState(), | 58 FrameReplicationState(), |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 151 |
152 scoped_ptr<IPC::Message> was_shown_message( | 152 scoped_ptr<IPC::Message> was_shown_message( |
153 new ViewMsg_WasShown(0, true, ui::LatencyInfo())); | 153 new ViewMsg_WasShown(0, true, ui::LatencyInfo())); |
154 FrameWidget()->OnMessageReceived(*was_shown_message); | 154 FrameWidget()->OnMessageReceived(*was_shown_message); |
155 | 155 |
156 EXPECT_FALSE(FrameWidget()->is_hidden()); | 156 EXPECT_FALSE(FrameWidget()->is_hidden()); |
157 EXPECT_TRUE(observer.visible()); | 157 EXPECT_TRUE(observer.visible()); |
158 } | 158 } |
159 | 159 |
160 } // namespace | 160 } // namespace |
OLD | NEW |