update_engine: Further move Extent manipulation to extent_utils.

This patch moves more Extent manipulation functions to extent_utils.
It moves NormalizeExtents() and creates a new ExtentsSublist() function
that will be used by a follow up CL.

BUG=None
TEST=Added unittests.

Change-Id: Icf0ef0af208aa45c9f44e1a73662b3efd8bbbb45
Reviewed-on: https://chromium-review.googlesource.com/275801
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
diff --git a/test_utils.h b/test_utils.h
index a65b042..dddd563 100644
--- a/test_utils.h
+++ b/test_utils.h
@@ -9,6 +9,8 @@
 #include <sys/types.h>
 #include <unistd.h>
 
+// Streams used for gtest's PrintTo() functions.
+#include <iostream>  // NOLINT(readability/streams)
 #include <memory>
 #include <set>
 #include <string>
@@ -20,11 +22,17 @@
 
 #include "update_engine/action.h"
 #include "update_engine/subprocess.h"
+#include "update_engine/update_metadata.pb.h"
 #include "update_engine/utils.h"
 
 // These are some handy functions for unittests.
 
 namespace chromeos_update_engine {
+
+// PrintTo() functions are used by gtest to log these objects. These PrintTo()
+// functions must be defined in the same namespace as the first argument.
+void PrintTo(const Extent& extent, ::std::ostream* os);
+
 namespace test_utils {
 
 // 300 byte pseudo-random string. Not null terminated.