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" |
| 11 #include "content/common/frame_owner_properties.h" |
11 #include "content/common/view_messages.h" | 12 #include "content/common/view_messages.h" |
12 #include "content/public/renderer/document_state.h" | 13 #include "content/public/renderer/document_state.h" |
13 #include "content/public/test/frame_load_waiter.h" | 14 #include "content/public/test/frame_load_waiter.h" |
14 #include "content/public/test/render_view_test.h" | 15 #include "content/public/test/render_view_test.h" |
15 #include "content/public/test/test_utils.h" | 16 #include "content/public/test/test_utils.h" |
16 #include "content/renderer/navigation_state_impl.h" | 17 #include "content/renderer/navigation_state_impl.h" |
17 #include "content/renderer/render_frame_impl.h" | 18 #include "content/renderer/render_frame_impl.h" |
18 #include "content/renderer/render_view_impl.h" | 19 #include "content/renderer/render_view_impl.h" |
19 #include "content/test/fake_compositor_dependencies.h" | 20 #include "content/test/fake_compositor_dependencies.h" |
20 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
21 #include "third_party/WebKit/public/platform/WebEffectiveConnectionType.h" | 22 #include "third_party/WebKit/public/platform/WebEffectiveConnectionType.h" |
22 #include "third_party/WebKit/public/platform/WebString.h" | 23 #include "third_party/WebKit/public/platform/WebString.h" |
23 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 24 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
24 #include "third_party/WebKit/public/web/WebFrameOwnerProperties.h" | |
25 #include "third_party/WebKit/public/web/WebHistoryItem.h" | 25 #include "third_party/WebKit/public/web/WebHistoryItem.h" |
26 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 26 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
27 | 27 |
28 using blink::WebString; | 28 using blink::WebString; |
29 | 29 |
30 namespace { | 30 namespace { |
31 const int32_t kSubframeRouteId = 20; | 31 const int32_t kSubframeRouteId = 20; |
32 const int32_t kSubframeWidgetRouteId = 21; | 32 const int32_t kSubframeWidgetRouteId = 21; |
33 const int32_t kFrameProxyRouteId = 22; | 33 const int32_t kFrameProxyRouteId = 22; |
34 } // namespace | 34 } // namespace |
(...skipping 23 matching lines...) Expand all Loading... |
58 frame_replication_state.name = "frame"; | 58 frame_replication_state.name = "frame"; |
59 frame_replication_state.unique_name = "frame-uniqueName"; | 59 frame_replication_state.unique_name = "frame-uniqueName"; |
60 | 60 |
61 RenderFrameImpl::FromWebFrame( | 61 RenderFrameImpl::FromWebFrame( |
62 view_->GetMainRenderFrame()->GetWebFrame()->firstChild()) | 62 view_->GetMainRenderFrame()->GetWebFrame()->firstChild()) |
63 ->OnSwapOut(kFrameProxyRouteId, false, frame_replication_state); | 63 ->OnSwapOut(kFrameProxyRouteId, false, frame_replication_state); |
64 | 64 |
65 RenderFrameImpl::CreateFrame( | 65 RenderFrameImpl::CreateFrame( |
66 kSubframeRouteId, MSG_ROUTING_NONE, MSG_ROUTING_NONE, | 66 kSubframeRouteId, MSG_ROUTING_NONE, MSG_ROUTING_NONE, |
67 kFrameProxyRouteId, MSG_ROUTING_NONE, frame_replication_state, | 67 kFrameProxyRouteId, MSG_ROUTING_NONE, frame_replication_state, |
68 &compositor_deps_, widget_params, blink::WebFrameOwnerProperties()); | 68 &compositor_deps_, widget_params, FrameOwnerProperties()); |
69 | 69 |
70 frame_ = RenderFrameImpl::FromRoutingID(kSubframeRouteId); | 70 frame_ = RenderFrameImpl::FromRoutingID(kSubframeRouteId); |
71 EXPECT_FALSE(frame_->is_main_frame_); | 71 EXPECT_FALSE(frame_->is_main_frame_); |
72 } | 72 } |
73 | 73 |
74 void TearDown() override { | 74 void TearDown() override { |
75 #if defined(LEAK_SANITIZER) | 75 #if defined(LEAK_SANITIZER) |
76 // Do this before shutting down V8 in RenderViewTest::TearDown(). | 76 // Do this before shutting down V8 in RenderViewTest::TearDown(). |
77 // http://crbug.com/328552 | 77 // http://crbug.com/328552 |
78 __lsan_do_leak_check(); | 78 __lsan_do_leak_check(); |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 const std::string exceeded_data_url(1024 * 1024 * 20 + 1, 'd'); | 337 const std::string exceeded_data_url(1024 * 1024 * 20 + 1, 'd'); |
338 | 338 |
339 frame()->saveImageFromDataURL(WebString::fromUTF8(exceeded_data_url)); | 339 frame()->saveImageFromDataURL(WebString::fromUTF8(exceeded_data_url)); |
340 ProcessPendingMessages(); | 340 ProcessPendingMessages(); |
341 const IPC::Message* msg4 = render_thread_->sink().GetFirstMessageMatching( | 341 const IPC::Message* msg4 = render_thread_->sink().GetFirstMessageMatching( |
342 FrameHostMsg_SaveImageFromDataURL::ID); | 342 FrameHostMsg_SaveImageFromDataURL::ID); |
343 EXPECT_FALSE(msg4); | 343 EXPECT_FALSE(msg4); |
344 } | 344 } |
345 | 345 |
346 } // namespace | 346 } // namespace |
OLD | NEW |