Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: tools/battor_agent/battor_connection_impl_unittest.cc

Issue 2000743002: [battor agent] Add 'read more bytes' logic in the BattOr connection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/battor_agent/battor_connection_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/battor_agent/battor_connection_impl_unittest.cc
diff --git a/tools/battor_agent/battor_connection_impl_unittest.cc b/tools/battor_agent/battor_connection_impl_unittest.cc
index 4e19ee123c5609aa21ec1efb33f413d8450b0696..a9027942d8b91a76f77724bd195dc21a4c53a114 100644
--- a/tools/battor_agent/battor_connection_impl_unittest.cc
+++ b/tools/battor_agent/battor_connection_impl_unittest.cc
@@ -230,8 +230,9 @@ TEST_F(BattOrConnectionImplTest, ReadMessageEndsMidMessageByte) {
SendBytesRaw(data, 5);
ReadMessage(BATTOR_MESSAGE_TYPE_CONTROL);
- ASSERT_TRUE(IsReadComplete());
- ASSERT_FALSE(GetReadSuccess());
+ // The first read should recognize that a second read is necessary, but the
+ // second read will hang because no bytes ever come in.
+ ASSERT_FALSE(IsReadComplete());
}
TEST_F(BattOrConnectionImplTest, ReadMessageMissingEndByte) {
@@ -251,8 +252,9 @@ TEST_F(BattOrConnectionImplTest, ReadMessageMissingEndByte) {
SendBytesRaw(data, 6);
ReadMessage(BATTOR_MESSAGE_TYPE_CONTROL);
- ASSERT_TRUE(IsReadComplete());
- ASSERT_FALSE(GetReadSuccess());
+ // The first read should recognize that a second read is necessary, but the
+ // second read will hang because no bytes ever come in.
+ ASSERT_FALSE(IsReadComplete());
}
TEST_F(BattOrConnectionImplTest, ReadMessageWithEscapeCharacters) {
« no previous file with comments | « tools/battor_agent/battor_connection_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698