OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 | 198 |
199 if (!web_frame_client) | 199 if (!web_frame_client) |
200 web_frame_client = DefaultWebFrameClient(); | 200 web_frame_client = DefaultWebFrameClient(); |
201 if (!web_view_client) { | 201 if (!web_view_client) { |
202 owned_test_web_view_client_ = WTF::MakeUnique<TestWebViewClient>(); | 202 owned_test_web_view_client_ = WTF::MakeUnique<TestWebViewClient>(); |
203 web_view_client = owned_test_web_view_client_.get(); | 203 web_view_client = owned_test_web_view_client_.get(); |
204 } | 204 } |
205 if (!web_widget_client) | 205 if (!web_widget_client) |
206 web_widget_client = web_view_client->WidgetClient(); | 206 web_widget_client = web_view_client->WidgetClient(); |
207 web_view_ = static_cast<WebViewBase*>( | 207 web_view_ = static_cast<WebViewBase*>( |
208 WebView::Create(web_view_client, kWebPageVisibilityStateVisible)); | 208 WebView::Create(web_view_client, kWebPageVisibilityStateVisible, |
| 209 opener ? opener->View() : nullptr)); |
209 web_view_->GetSettings()->SetJavaScriptEnabled(enable_javascript); | 210 web_view_->GetSettings()->SetJavaScriptEnabled(enable_javascript); |
210 web_view_->GetSettings()->SetPluginsEnabled(true); | 211 web_view_->GetSettings()->SetPluginsEnabled(true); |
211 // Enable (mocked) network loads of image URLs, as this simplifies | 212 // Enable (mocked) network loads of image URLs, as this simplifies |
212 // the completion of resource loads upon test shutdown & helps avoid | 213 // the completion of resource loads upon test shutdown & helps avoid |
213 // dormant loads trigger Resource leaks for image loads. | 214 // dormant loads trigger Resource leaks for image loads. |
214 // | 215 // |
215 // Consequently, all external image resources must be mocked. | 216 // Consequently, all external image resources must be mocked. |
216 web_view_->GetSettings()->SetLoadsImagesAutomatically(true); | 217 web_view_->GetSettings()->SetLoadsImagesAutomatically(true); |
217 if (update_settings_func) | 218 if (update_settings_func) |
218 update_settings_func(web_view_->GetSettings()); | 219 update_settings_func(web_view_->GetSettings()); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 test_web_view_client_->ScheduleAnimation(); | 337 test_web_view_client_->ScheduleAnimation(); |
337 } | 338 } |
338 | 339 |
339 void TestWebViewWidgetClient::DidMeaningfulLayout( | 340 void TestWebViewWidgetClient::DidMeaningfulLayout( |
340 WebMeaningfulLayout layout_type) { | 341 WebMeaningfulLayout layout_type) { |
341 test_web_view_client_->DidMeaningfulLayout(layout_type); | 342 test_web_view_client_->DidMeaningfulLayout(layout_type); |
342 } | 343 } |
343 | 344 |
344 } // namespace FrameTestHelpers | 345 } // namespace FrameTestHelpers |
345 } // namespace blink | 346 } // namespace blink |
OLD | NEW |