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

Unified Diff: cc/playback/recording_source_unittest.cc

Issue 1982893002: [blimp] Add SkPicture caching support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git merge origin/master Created 4 years, 7 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: cc/playback/recording_source_unittest.cc
diff --git a/cc/playback/recording_source_unittest.cc b/cc/playback/recording_source_unittest.cc
index 878242db4d39fe3f8914b606a6ba61906a8add1a..bab1a9394a00af9f7e1b59ebe0d4f0681c3c9ee6 100644
--- a/cc/playback/recording_source_unittest.cc
+++ b/cc/playback/recording_source_unittest.cc
@@ -10,6 +10,7 @@
#include "cc/proto/recording_source.pb.h"
#include "cc/test/fake_content_layer_client.h"
#include "cc/test/fake_image_serialization_processor.h"
+#include "cc/test/fake_picture_cache.h"
#include "cc/test/fake_recording_source.h"
#include "cc/test/skia_common.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -37,12 +38,21 @@ void ValidateRecordingSourceSerialization(FakeRecordingSource* source) {
std::unique_ptr<FakeImageSerializationProcessor>
fake_image_serialization_processor =
base::WrapUnique(new FakeImageSerializationProcessor);
-
+ std::unique_ptr<EnginePictureCache> fake_engine_picture_cache =
+ fake_image_serialization_processor->CreateEnginePictureCache();
+ std::unique_ptr<ClientPictureCache> fake_client_picture_cache =
+ fake_image_serialization_processor->CreateClientPictureCache();
proto::RecordingSource proto;
- source->ToProtobuf(&proto, fake_image_serialization_processor.get());
+ source->ToProtobuf(&proto);
+
+ source->set_engine_picture_cache(fake_engine_picture_cache.get());
+ // Forcefully mark the full RecordingSource for registration to ensure that
+ // all data is made available to the client.
+ source->MarkForRegistration();
FakeRecordingSource new_source;
- new_source.FromProtobuf(proto, fake_image_serialization_processor.get());
+ new_source.set_client_picture_cache(fake_client_picture_cache.get());
+ new_source.FromProtobuf(proto);
EXPECT_TRUE(source->EqualsTo(new_source));
}

Powered by Google App Engine
This is Rietveld 408576698