AU: Delta Performer: properly detect idempotent operations

Idempotent operations can be restarted after being aborted. This CL
enables the delta performer to find many idempotent operations. The
algorithm given is pretty good, tho it may incorrectly mark some
idempotent operations as non-idempotent. For example, a BSDIFF
operation may write a block that it reads with the same data; that's
idempotent, but missed by this algorithm. This function just looks to
see if the src/dst blocks are non-intersecting and, if non
intersecting, declares it idempotent.

BUG=7394
TEST=unittest

Review URL: http://codereview.chromium.org/3591019
diff --git a/delta_performer.h b/delta_performer.h
index 051d605..16073d8 100644
--- a/delta_performer.h
+++ b/delta_performer.h
@@ -10,6 +10,7 @@
 #include <vector>
 
 #include <google/protobuf/repeated_field.h>
+#include <gtest/gtest_prod.h>  // for FRIEND_TEST
 
 #include "update_engine/file_writer.h"
 #include "update_engine/omaha_hash_calculator.h"
@@ -89,6 +90,12 @@
   static bool ResetUpdateProgress(PrefsInterface* prefs, bool quick);
 
  private:
+  friend class DeltaPerformerTest;
+  FRIEND_TEST(DeltaPerformerTest, IsIdempotentOperationTest);
+
+  static bool IsIdempotentOperation(
+      const DeltaArchiveManifest_InstallOperation& op);
+
   // Returns true if enough of the delta file has been passed via Write()
   // to be able to perform a given install operation.
   bool CanPerformInstallOperation(