Commit bdcab12f authored by Trent Apted's avatar Trent Apted Committed by Commit Bot

Verify file contents in MediaAppIntegrationWithFilesAppTest.RenameFile

This makes the test a bit more compelling than just ensuring the file
name changes. There is no "rename" in the WritableFiles API, so the
implementation must actually copy bytes over. This ensures the bytes
are copied correctly.

Bug: b/153021155
Change-Id: Iba73a146b4643f6dba1f89c8e1b4f6302b848777
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2397477
Commit-Queue: Trent Apted <tapted@chromium.org>
Reviewed-by: default avatarBugs Nash <bugsnash@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805124}
parent e93196c4
......@@ -441,6 +441,16 @@ IN_PROC_BROWSER_TEST_P(MediaAppIntegrationWithFilesAppTest, RenameFile) {
EXPECT_EQ(1u, folder.files().size());
EXPECT_EQ("x.jpg", folder.files()[0].BaseName().value());
std::string expected_contents, renamed_contents;
base::ScopedAllowBlockingForTesting allow_blocking;
EXPECT_TRUE(
base::ReadFileToString(TestFile(kFileJpeg640x480), &expected_contents));
// Consistency check against the file size (2108 bytes) of image3.jpg in the
// test data directory.
EXPECT_EQ(2108u, expected_contents.size());
EXPECT_TRUE(base::ReadFileToString(folder.files()[0], &renamed_contents));
EXPECT_EQ(expected_contents, renamed_contents);
}
INSTANTIATE_TEST_SUITE_P(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment