Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(509)

Unified Diff: third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp

Issue 1415123002: Avoid image resource leaks in frame-related unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove redundant #include Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/TouchActionTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp
diff --git a/third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp b/third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp
index 5627bd81d0d19e88fffa3f8d670a5fa756015410..6360d3243fbfc05ae39dee0ada10b4b801964bd1 100644
--- a/third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp
+++ b/third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp
@@ -251,6 +251,12 @@ WebViewImpl* WebViewHelper::initialize(bool enableJavascript, TestWebFrameClient
m_webView = WebViewImpl::create(webViewClient);
m_webView->settings()->setJavaScriptEnabled(enableJavascript);
m_webView->settings()->setPluginsEnabled(true);
+ // Enable (mocked) network loads of image URLs, as this simplifies
+ // the completion of resource loads upon test shutdown & helps avoid
+ // dormant loads trigger Resource leaks for image loads.
+ //
+ // Consequently, all external image resources must be mocked.
+ m_webView->settings()->setLoadsImagesAutomatically(true);
if (updateSettingsFunc)
updateSettingsFunc(m_webView->settings());
else
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/TouchActionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698