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

Unified Diff: tests/FlattenDrawableTest.cpp

Issue 1917183002: Remove redundant test (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/FlattenDrawableTest.cpp
diff --git a/tests/FlattenDrawableTest.cpp b/tests/FlattenDrawableTest.cpp
index 8285cb7beaebe1bdc41d20383cf01bb8f03aac11..c7fff12326e2548c61eef954b15f42808aec13df 100644
--- a/tests/FlattenDrawableTest.cpp
+++ b/tests/FlattenDrawableTest.cpp
@@ -246,34 +246,3 @@ DEF_TEST(FlattenDrawable, r) {
REPORTER_ASSERT(r, 3 == integer->c());
REPORTER_ASSERT(r, 4 == integer->d());
}
-
-static sk_sp<SkFlattenable> custom_create_proc(SkReadBuffer& buffer) {
- sk_sp<SkFlattenable> drawable = IntDrawable::CreateProc(buffer);
- IntDrawable* intDrawable = (IntDrawable*) drawable.get();
- return sk_sp<IntDrawable>(new IntDrawable(intDrawable->a() + 1, intDrawable->b() + 1,
- intDrawable->c() + 1, intDrawable->d() + 1));
-}
-
-DEF_TEST(FlattenCustomDrawable, r) {
- // Create and serialize the test drawable
- SkAutoTUnref<SkDrawable> drawable(new IntDrawable(1, 2, 3, 4));
- SkWriteBuffer writeBuffer;
- writeBuffer.writeFlattenable(drawable);
-
- // Copy the contents of the write buffer into a read buffer
- sk_sp<SkData> data = SkData::MakeUninitialized(writeBuffer.bytesWritten());
- writeBuffer.writeToMemory(data->writable_data());
- SkReadBuffer readBuffer(data->data(), data->size());
-
- // Register a custom factory with the read buffer
- readBuffer.setCustomFactory(SkString("IntDrawable"), &custom_create_proc);
-
- // Deserialize and verify the drawable
- SkAutoTUnref<IntDrawable> out((IntDrawable*)
- readBuffer.readFlattenable(SkFlattenable::kSkDrawable_Type));
- REPORTER_ASSERT(r, out);
- REPORTER_ASSERT(r, 2 == out->a());
- REPORTER_ASSERT(r, 3 == out->b());
- REPORTER_ASSERT(r, 4 == out->c());
- REPORTER_ASSERT(r, 5 == out->d());
-}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698