fastboot: fix SocketMock send failures.

Fixes SocketMock::ExpectSendFailure() to allow unit testing of errors
during send, and adds tests for ExpectSendFailure() and
AddReceiveFailure().

Also adds missing tests to make sure ReceiveAll() continues to read
until failure or all bytes have been read.

Bug: http://b/26157893
Change-Id: I67e7d6de8e8ec4a3b62a6b7d7217f7530862edf7
diff --git a/fastboot/socket_mock.cpp b/fastboot/socket_mock.cpp
index bcb91ec..c962f30 100644
--- a/fastboot/socket_mock.cpp
+++ b/fastboot/socket_mock.cpp
@@ -55,8 +55,9 @@
         return false;
     }
 
+    bool return_value = events_.front().return_value;
     events_.pop();
-    return true;
+    return return_value;
 }
 
 // Mock out multi-buffer send to be one large send, since that's what it should looks like from
@@ -115,13 +116,12 @@
 }
 
 void SocketMock::ExpectSend(std::string message) {
-    events_.push(Event(EventType::kSend, std::move(message), 0, nullptr));
+    events_.push(Event(EventType::kSend, std::move(message), true, nullptr));
 }
 
-// TODO: make this properly return false to the caller.
-//void SocketMock::ExpectSendFailure(std::string message) {
-//    events_.push(Event(EventType::kSend, std::move(message), 0, nullptr));
-//}
+void SocketMock::ExpectSendFailure(std::string message) {
+    events_.push(Event(EventType::kSend, std::move(message), false, nullptr));
+}
 
 void SocketMock::AddReceive(std::string message) {
     ssize_t return_value = message.length();