Surface unit tests for getFrameTimestamps.

Verifies the following:

1) The timestamps and fences aren't transferred if the
   feature isn't explicitly enabled.
2) Attempts to get the timestamps will fail if not enabled.
3) Timestamps are transferred if enabled.
4) The support for Present/Retire timestamps are properly
   queried from the ISurfaceComposer.
5) Timestamps correspond to the correct frame.
6) The consumer doesn't send the acquire fence back to the
   producer and a sync call isn't made to try and get it
   from the producer.
7) A sync call isn't made when no timestamps are requested.
8) If the consumer sent the producer fences, the consumer
   can get the timestamps without a sync call.
9) If there was no GL composite performed, a sync call
   isn't made to get a non-existant fence/time.
10) When asking for the retire or release time of the most
   recent frame, a sync call isn't made.
11) Requests for unsupported timestamps return an error and
   do not result in a sync call.

Test: Test: adb shell /data/nativetest/libgui_test/libgui_test
--gtest_filter=*GetFrameTimestamps*

Change-Id: I6f728af0d4a0f431c9e47131da64584a589559e7
diff --git a/include/gui/FrameTimestamps.h b/include/gui/FrameTimestamps.h
index 8a3fa39..7d62706 100644
--- a/include/gui/FrameTimestamps.h
+++ b/include/gui/FrameTimestamps.h
@@ -116,13 +116,22 @@
 public:
     ~ProducerFrameEventHistory() override;
 
-    void updateAcquireFence(
+    // virtual for testing.
+    virtual void updateAcquireFence(
             uint64_t frameNumber, std::shared_ptr<FenceTime>&& acquire);
     void applyDelta(const FrameEventHistoryDelta& delta);
 
     void updateSignalTimes();
 
-private:
+protected:
+    void applyFenceDelta(FenceTimeline* timeline,
+            std::shared_ptr<FenceTime>* dst,
+            const FenceTime::Snapshot& src) const;
+
+    // virtual for testing.
+    virtual std::shared_ptr<FenceTime> createFenceTime(
+            const sp<Fence>& fence) const;
+
     size_t mAcquireOffset{0};
 
     // The consumer updates it's timelines in Layer and SurfaceFlinger since