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

Unified Diff: apps/saved_files_service_unittest.cc

Issue 23146016: Add support for directory access to the file system API. (Closed) Base URL: http://git.chromium.org/chromium/src.git@simpler-write-permissions
Patch Set: Created 7 years, 4 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 | « apps/saved_files_service.cc ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/saved_files_service_unittest.cc
diff --git a/apps/saved_files_service_unittest.cc b/apps/saved_files_service_unittest.cc
index 336049b67602c878d1c0f9ec917726ae47071681..313c97cc683592a1b03c78c2a47f15c7aea6d30b 100644
--- a/apps/saved_files_service_unittest.cc
+++ b/apps/saved_files_service_unittest.cc
@@ -71,6 +71,7 @@ class SavedFilesServiceUnitTest : public testing::Test {
ASSERT_TRUE(entry);
EXPECT_EQ(id_string, entry->id);
EXPECT_EQ(path_, entry->path);
+ EXPECT_TRUE(entry->is_directory);
EXPECT_EQ(sequence_number, entry->sequence_number);
}
@@ -89,9 +90,9 @@ class SavedFilesServiceUnitTest : public testing::Test {
};
TEST_F(SavedFilesServiceUnitTest, RetainTwoFilesTest) {
- service_->RegisterFileEntry(extension_->id(), GenerateId(1), path_);
- service_->RegisterFileEntry(extension_->id(), GenerateId(2), path_);
- service_->RegisterFileEntry(extension_->id(), GenerateId(3), path_);
+ service_->RegisterFileEntry(extension_->id(), GenerateId(1), path_, true);
+ service_->RegisterFileEntry(extension_->id(), GenerateId(2), path_, true);
+ service_->RegisterFileEntry(extension_->id(), GenerateId(3), path_, true);
// Test that no entry has a sequence number.
TRACE_CALL(CheckEntrySequenceNumber(1, 0));
@@ -151,7 +152,7 @@ TEST_F(SavedFilesServiceUnitTest, NoRetainEntriesPermissionTest) {
extension_ = env_.MakeExtension(*base::test::ParseJson(
"{\"app\": {\"background\": {\"scripts\": [\"background.js\"]}},"
"\"permissions\": [\"fileSystem\"]}"));
- service_->RegisterFileEntry(extension_->id(), GenerateId(1), path_);
+ service_->RegisterFileEntry(extension_->id(), GenerateId(1), path_, true);
TRACE_CALL(CheckEntrySequenceNumber(1, 0));
SavedFileEntry entry;
service_->EnqueueFileEntry(extension_->id(), GenerateId(1));
@@ -170,10 +171,10 @@ TEST_F(SavedFilesServiceUnitTest, NoRetainEntriesPermissionTest) {
TEST_F(SavedFilesServiceUnitTest, EvictionTest) {
SavedFilesService::SetLruSizeForTest(10);
for (int i = 0; i < 10; i++) {
- service_->RegisterFileEntry(extension_->id(), GenerateId(i), path_);
+ service_->RegisterFileEntry(extension_->id(), GenerateId(i), path_, true);
service_->EnqueueFileEntry(extension_->id(), GenerateId(i));
}
- service_->RegisterFileEntry(extension_->id(), GenerateId(10), path_);
+ service_->RegisterFileEntry(extension_->id(), GenerateId(10), path_, true);
// Expect that entries 0 to 9 are in the queue, but 10 is not.
TRACE_CALL(CheckRangeEnqueuedInOrder(0, 10));
@@ -208,7 +209,7 @@ TEST_F(SavedFilesServiceUnitTest, SequenceNumberCompactionTest) {
SavedFilesService::SetMaxSequenceNumberForTest(8);
SavedFilesService::SetLruSizeForTest(8);
for (int i = 0; i < 4; i++) {
- service_->RegisterFileEntry(extension_->id(), GenerateId(i), path_);
+ service_->RegisterFileEntry(extension_->id(), GenerateId(i), path_, true);
service_->EnqueueFileEntry(extension_->id(), GenerateId(i));
}
service_->EnqueueFileEntry(extension_->id(), GenerateId(2));
« no previous file with comments | « apps/saved_files_service.cc ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698