Merge "Consolidate proto parsing into DeviceFiles::RetrieveHashedFile"

This commit is contained in:
Rahul Frias
2016-01-19 22:58:06 +00:00
committed by Android (Google) Code Review
3 changed files with 36 additions and 66 deletions

View File

@@ -2167,8 +2167,9 @@ TEST_P(DeviceFilesUsageInfoTest, Read) {
data = kUsageInfoTestData[index].file_data;
}
if (index >= 0) {
EXPECT_CALL(file, Exists(StrEq(path))).WillOnce(Return(true));
EXPECT_CALL(file, FileSize(StrEq(path))).WillOnce(Return(data.size()));
EXPECT_CALL(file, Exists(StrEq(path))).WillRepeatedly(Return(true));
EXPECT_CALL(file, FileSize(StrEq(path)))
.WillRepeatedly(Return(data.size()));
EXPECT_CALL(file, Open(StrEq(path), IsBinaryFileFlagSet()))
.WillOnce(Return(true));
EXPECT_CALL(file, Read(NotNull(), Eq(data.size())))
@@ -2177,7 +2178,6 @@ TEST_P(DeviceFilesUsageInfoTest, Read) {
EXPECT_CALL(file, Close()).Times(1);
} else {
EXPECT_CALL(file, Exists(StrEq(path)))
.Times(2)
.WillRepeatedly(Return(false));
EXPECT_CALL(file, FileSize(_)).Times(0);
EXPECT_CALL(file, Open(_, _)).Times(0);
@@ -2230,7 +2230,7 @@ TEST_P(DeviceFilesUsageInfoTest, Store) {
.WillRepeatedly(Return(true));
EXPECT_CALL(file, CreateDirectory(_)).Times(0);
EXPECT_CALL(file, Exists(StrEq(path))).WillOnce(Return(index >= 0));
EXPECT_CALL(file, Exists(StrEq(path))).WillRepeatedly(Return(index >= 0));
if (index >= 0) {
EXPECT_CALL(file, FileSize(StrEq(path))).WillOnce(Return(data.size()));
EXPECT_CALL(file, Open(StrEq(path), IsBinaryFileFlagSet()))