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

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: fix nits 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
« no previous file with comments | « content/test/test_blink_web_unit_test_support.h ('k') | third_party/WebKit/Source/platform/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f14fa13bcf916ffea2ec8a3aa15a8cf85f94ae85..b8f549db21f7bb1b7ea3635c4f4af5ac58bf8891 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"
@@ -117,6 +118,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.
@@ -199,6 +201,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.
« no previous file with comments | « content/test/test_blink_web_unit_test_support.h ('k') | third_party/WebKit/Source/platform/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698