update_engine: Merge contiguous operations (reprise).
This is reapplying CL:269604 with a small fix that prevents it from
adding spurious src_length fields when merging payload operations. This
also revises relevant unit tests to catch the said error. The original
change is described below.
Merges operations of type SOURCE_COPY, REPLACE, or REPLACE_BZ if they
have the same type, are contiguous, have only one destination extent,
and their combined block count does not exceed the chunk size.
BUG=chromium:461651
BUG=chromium:486497
TEST=Unit test (fails before fix, passes after)
TEST=Trybot
Change-Id: I9f3d7f653454e27177428f2d7c0e6485184a7f8b
Reviewed-on: https://chromium-review.googlesource.com/270268
Trybot-Ready: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
diff --git a/delta_performer_unittest.cc b/delta_performer_unittest.cc
index a72061b..381f777 100644
--- a/delta_performer_unittest.cc
+++ b/delta_performer_unittest.cc
@@ -111,9 +111,6 @@
kValidOperationData,
};
-// Chuck size used for full payloads during test.
-size_t kDefaultFullChunkSize = 1024 * 1024;
-
} // namespace
class DeltaPerformerTest : public ::testing::Test {
@@ -543,7 +540,7 @@
} else {
if (payload_config.chunk_size == -1)
- payload_config.chunk_size = kDefaultFullChunkSize;
+ payload_config.chunk_size = kDefaultChunkSize;
}
payload_config.target.rootfs_part = state->b_img;
payload_config.target.rootfs_mountpt = b_mnt;