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/test/frame_load_waiter.h" | 9 #include "content/public/test/frame_load_waiter.h" |
10 #include "content/public/test/render_view_test.h" | 10 #include "content/public/test/render_view_test.h" |
11 #include "content/public/test/test_utils.h" | 11 #include "content/public/test/test_utils.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/WebFrameOwnerProperties.h" |
17 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 18 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
18 | 19 |
19 namespace { | 20 namespace { |
20 const int32 kSubframeRouteId = 20; | 21 const int32 kSubframeRouteId = 20; |
21 const int32 kSubframeWidgetRouteId = 21; | 22 const int32 kSubframeWidgetRouteId = 21; |
22 const int32 kFrameProxyRouteId = 22; | 23 const int32 kFrameProxyRouteId = 22; |
23 const int32 kSubframeSurfaceId = 43; | 24 const int32 kSubframeSurfaceId = 43; |
24 } // namespace | 25 } // namespace |
25 | 26 |
26 namespace content { | 27 namespace content { |
(...skipping 19 matching lines...) Expand all Loading... |
46 | 47 |
47 LoadHTML("Parent frame <iframe name='frame'></iframe>"); | 48 LoadHTML("Parent frame <iframe name='frame'></iframe>"); |
48 | 49 |
49 RenderFrameImpl::FromWebFrame( | 50 RenderFrameImpl::FromWebFrame( |
50 view_->GetMainRenderFrame()->GetWebFrame()->firstChild()) | 51 view_->GetMainRenderFrame()->GetWebFrame()->firstChild()) |
51 ->OnSwapOut(kFrameProxyRouteId, false, FrameReplicationState()); | 52 ->OnSwapOut(kFrameProxyRouteId, false, FrameReplicationState()); |
52 | 53 |
53 RenderFrameImpl::CreateFrame(kSubframeRouteId, MSG_ROUTING_NONE, | 54 RenderFrameImpl::CreateFrame(kSubframeRouteId, MSG_ROUTING_NONE, |
54 MSG_ROUTING_NONE, kFrameProxyRouteId, | 55 MSG_ROUTING_NONE, kFrameProxyRouteId, |
55 MSG_ROUTING_NONE, FrameReplicationState(), | 56 MSG_ROUTING_NONE, FrameReplicationState(), |
56 &compositor_deps_, widget_params); | 57 &compositor_deps_, widget_params, |
| 58 blink::WebFrameOwnerProperties()); |
57 | 59 |
58 frame_ = RenderFrameImpl::FromRoutingID(kSubframeRouteId); | 60 frame_ = RenderFrameImpl::FromRoutingID(kSubframeRouteId); |
59 EXPECT_TRUE(frame_->is_subframe_); | 61 EXPECT_TRUE(frame_->is_subframe_); |
60 } | 62 } |
61 | 63 |
62 void TearDown() override { | 64 void TearDown() override { |
63 #if defined(LEAK_SANITIZER) | 65 #if defined(LEAK_SANITIZER) |
64 // Do this before shutting down V8 in RenderViewTest::TearDown(). | 66 // Do this before shutting down V8 in RenderViewTest::TearDown(). |
65 // http://crbug.com/328552 | 67 // http://crbug.com/328552 |
66 __lsan_do_leak_check(); | 68 __lsan_do_leak_check(); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 RenderFrameTestObserver observer(frame()); | 152 RenderFrameTestObserver observer(frame()); |
151 | 153 |
152 ViewMsg_WasShown was_shown_message(0, true, ui::LatencyInfo()); | 154 ViewMsg_WasShown was_shown_message(0, true, ui::LatencyInfo()); |
153 frame_widget()->OnMessageReceived(was_shown_message); | 155 frame_widget()->OnMessageReceived(was_shown_message); |
154 | 156 |
155 EXPECT_FALSE(frame_widget()->is_hidden()); | 157 EXPECT_FALSE(frame_widget()->is_hidden()); |
156 EXPECT_TRUE(observer.visible()); | 158 EXPECT_TRUE(observer.visible()); |
157 } | 159 } |
158 | 160 |
159 } // namespace | 161 } // namespace |
OLD | NEW |