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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/TouchActionTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 { 244 {
245 reset(); 245 reset();
246 246
247 if (!webFrameClient) 247 if (!webFrameClient)
248 webFrameClient = defaultWebFrameClient(); 248 webFrameClient = defaultWebFrameClient();
249 if (!webViewClient) 249 if (!webViewClient)
250 webViewClient = defaultWebViewClient(); 250 webViewClient = defaultWebViewClient();
251 m_webView = WebViewImpl::create(webViewClient); 251 m_webView = WebViewImpl::create(webViewClient);
252 m_webView->settings()->setJavaScriptEnabled(enableJavascript); 252 m_webView->settings()->setJavaScriptEnabled(enableJavascript);
253 m_webView->settings()->setPluginsEnabled(true); 253 m_webView->settings()->setPluginsEnabled(true);
254 // Enable (mocked) network loads of image URLs, as this simplifies
255 // the completion of resource loads upon test shutdown & helps avoid
256 // dormant loads trigger Resource leaks for image loads.
257 //
258 // Consequently, all external image resources must be mocked.
259 m_webView->settings()->setLoadsImagesAutomatically(true);
254 if (updateSettingsFunc) 260 if (updateSettingsFunc)
255 updateSettingsFunc(m_webView->settings()); 261 updateSettingsFunc(m_webView->settings());
256 else 262 else
257 m_webView->settings()->setDeviceSupportsMouse(false); 263 m_webView->settings()->setDeviceSupportsMouse(false);
258 if (m_settingOverrider) 264 if (m_settingOverrider)
259 m_settingOverrider->overrideSettings(m_webView->settings()); 265 m_settingOverrider->overrideSettings(m_webView->settings());
260 266
261 m_webView->setDefaultPageScaleLimits(1, 4); 267 m_webView->setDefaultPageScaleLimits(1, 4);
262 m_webView->setMainFrame(WebLocalFrameImpl::create(WebTreeScopeType::Document , webFrameClient)); 268 m_webView->setMainFrame(WebLocalFrameImpl::create(WebTreeScopeType::Document , webFrameClient));
263 269
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 } 345 }
340 346
341 void TestWebViewClient::initializeLayerTreeView() 347 void TestWebViewClient::initializeLayerTreeView()
342 { 348 {
343 m_layerTreeView = adoptPtr(Platform::current()->unitTestSupport()->createLay erTreeViewForTesting()); 349 m_layerTreeView = adoptPtr(Platform::current()->unitTestSupport()->createLay erTreeViewForTesting());
344 ASSERT(m_layerTreeView); 350 ASSERT(m_layerTreeView);
345 } 351 }
346 352
347 } // namespace FrameTestHelpers 353 } // namespace FrameTestHelpers
348 } // namespace blink 354 } // namespace blink
OLDNEW
« 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