test: firmware updateCompleted: commit(session)

Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I186865bd5178e29b3df5a122fb9b33db0b9ba6d4
diff --git a/test/firmware_state_updatecompleted_unittest.cpp b/test/firmware_state_updatecompleted_unittest.cpp
index 98b9a56..324a307 100644
--- a/test/firmware_state_updatecompleted_unittest.cpp
+++ b/test/firmware_state_updatecompleted_unittest.cpp
@@ -155,13 +155,33 @@
 }
 
 /*
+ * commit(session) - returns failure
+ */
+TEST_F(FirmwareHandlerUpdateCompletedTest,
+       CommitOnUpdateBlobAfterSuccessReturnsFailure)
+{
+    getToUpdateCompleted(ActionStatus::success);
+
+    EXPECT_CALL(*updateMockPtr, triggerUpdate()).Times(0);
+    EXPECT_FALSE(handler->commit(session, {}));
+}
+
+TEST_F(FirmwareHandlerUpdateCompletedTest,
+       CommitOnUpdateBlobAfterFailureReturnsFailure)
+{
+    getToUpdateCompleted(ActionStatus::failed);
+
+    EXPECT_CALL(*updateMockPtr, triggerUpdate()).Times(0);
+    EXPECT_FALSE(handler->commit(session, {}));
+}
+
+/*
  * There are the following calls (parameters may vary):
  * canHandleBlob(blob)
  * getBlobIds
  * deleteBlob(blob)
  * close(session)
  * read(session)
- * commit(session)
  */
 
 } // namespace