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

Unified Diff: content/test/test_blink_web_unit_test_support.cc

Issue 2362473002: Adding unit test for DrawingBuffer's bitmap recycling mechanism (Closed)
Patch Set: minor cleanup Created 4 years, 3 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
Index: content/test/test_blink_web_unit_test_support.cc
diff --git a/content/test/test_blink_web_unit_test_support.cc b/content/test/test_blink_web_unit_test_support.cc
index b353c4cae7ad04cf819e95441c0230e17686ef73..14c832ba8ff85d89e8cdba53013114e6fa251df4 100644
--- a/content/test/test_blink_web_unit_test_support.cc
+++ b/content/test/test_blink_web_unit_test_support.cc
@@ -17,6 +17,7 @@
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "cc/blink/web_layer_impl.h"
+#include "cc/test/test_shared_bitmap_manager.h"
#include "cc/trees/layer_tree_settings.h"
#include "content/child/web_url_loader_impl.h"
#include "content/test/mock_webclipboard_impl.h"
@@ -111,6 +112,7 @@ TestBlinkWebUnitTestSupport::TestBlinkWebUnitTestSupport() {
}
renderer_scheduler_ = blink::scheduler::CreateRendererSchedulerForTests();
web_thread_ = renderer_scheduler_->CreateMainThread();
+ shared_bitmap_manager_.reset(new cc::TestSharedBitmapManager);
// Set up a FeatureList instance, so that code using that API will not hit a
// an error that it's not set. Cleared by ClearInstanceForTesting() below.
@@ -193,6 +195,13 @@ blink::WebString TestBlinkWebUnitTestSupport::userAgent() {
return blink::WebString::fromUTF8("test_runner/0.0.0.0");
}
+std::unique_ptr<cc::SharedBitmap>
+TestBlinkWebUnitTestSupport::allocateSharedBitmap(
+ const blink::WebSize& size) {
+ return shared_bitmap_manager_
+ ->AllocateSharedBitmap(gfx::Size(size.width, size.height));
+}
+
blink::WebString TestBlinkWebUnitTestSupport::queryLocalizedString(
blink::WebLocalizedString::Name name) {
// Returns placeholder strings to check if they are correctly localized.

Powered by Google App Engine
This is Rietveld 408576698