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 } // namespace | 24 } // namespace |
24 | 25 |
25 namespace content { | 26 namespace content { |
26 | 27 |
(...skipping 17 matching lines...) Expand all Loading... |
44 | 45 |
45 LoadHTML("Parent frame <iframe name='frame'></iframe>"); | 46 LoadHTML("Parent frame <iframe name='frame'></iframe>"); |
46 | 47 |
47 RenderFrameImpl::FromWebFrame( | 48 RenderFrameImpl::FromWebFrame( |
48 view_->GetMainRenderFrame()->GetWebFrame()->firstChild()) | 49 view_->GetMainRenderFrame()->GetWebFrame()->firstChild()) |
49 ->OnSwapOut(kFrameProxyRouteId, false, FrameReplicationState()); | 50 ->OnSwapOut(kFrameProxyRouteId, false, FrameReplicationState()); |
50 | 51 |
51 RenderFrameImpl::CreateFrame(kSubframeRouteId, MSG_ROUTING_NONE, | 52 RenderFrameImpl::CreateFrame(kSubframeRouteId, MSG_ROUTING_NONE, |
52 MSG_ROUTING_NONE, kFrameProxyRouteId, | 53 MSG_ROUTING_NONE, kFrameProxyRouteId, |
53 MSG_ROUTING_NONE, FrameReplicationState(), | 54 MSG_ROUTING_NONE, FrameReplicationState(), |
54 &compositor_deps_, widget_params); | 55 &compositor_deps_, widget_params, |
| 56 blink::WebFrameOwnerProperties()); |
55 | 57 |
56 frame_ = RenderFrameImpl::FromRoutingID(kSubframeRouteId); | 58 frame_ = RenderFrameImpl::FromRoutingID(kSubframeRouteId); |
57 EXPECT_FALSE(frame_->is_main_frame_); | 59 EXPECT_FALSE(frame_->is_main_frame_); |
58 } | 60 } |
59 | 61 |
60 void TearDown() override { | 62 void TearDown() override { |
61 #if defined(LEAK_SANITIZER) | 63 #if defined(LEAK_SANITIZER) |
62 // Do this before shutting down V8 in RenderViewTest::TearDown(). | 64 // Do this before shutting down V8 in RenderViewTest::TearDown(). |
63 // http://crbug.com/328552 | 65 // http://crbug.com/328552 |
64 __lsan_do_leak_check(); | 66 __lsan_do_leak_check(); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 RenderFrameTestObserver observer(frame()); | 150 RenderFrameTestObserver observer(frame()); |
149 | 151 |
150 ViewMsg_WasShown was_shown_message(0, true, ui::LatencyInfo()); | 152 ViewMsg_WasShown was_shown_message(0, true, ui::LatencyInfo()); |
151 frame_widget()->OnMessageReceived(was_shown_message); | 153 frame_widget()->OnMessageReceived(was_shown_message); |
152 | 154 |
153 EXPECT_FALSE(frame_widget()->is_hidden()); | 155 EXPECT_FALSE(frame_widget()->is_hidden()); |
154 EXPECT_TRUE(observer.visible()); | 156 EXPECT_TRUE(observer.visible()); |
155 } | 157 } |
156 | 158 |
157 } // namespace | 159 } // namespace |
OLD | NEW |