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

Unified Diff: chrome/browser/chromeos/drive/file_system/open_file_operation_unittest.cc

Issue 23606018: drive: Move some of FileSystemTest tests to lower layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | « no previous file | chrome/browser/chromeos/drive/file_system_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/drive/file_system/open_file_operation_unittest.cc
diff --git a/chrome/browser/chromeos/drive/file_system/open_file_operation_unittest.cc b/chrome/browser/chromeos/drive/file_system/open_file_operation_unittest.cc
index 8b8ef04364aad6d7aa0563e65c782634f5ecdfef..6770af5ae17efb4f144ae24d7143693787e08576 100644
--- a/chrome/browser/chromeos/drive/file_system/open_file_operation_unittest.cc
+++ b/chrome/browser/chromeos/drive/file_system/open_file_operation_unittest.cc
@@ -116,6 +116,9 @@ TEST_F(OpenFileOperationTest, CreateNonExistingFile) {
&error, &file_path, &close_callback));
test_util::RunBlockingPoolTask();
+ EXPECT_EQ(1U, observer()->get_changed_paths().size());
+ EXPECT_TRUE(observer()->get_changed_paths().count(file_in_root.DirName()));
+
EXPECT_EQ(FILE_ERROR_OK, error);
ASSERT_TRUE(base::PathExists(file_path));
int64 local_file_size;
@@ -147,6 +150,10 @@ TEST_F(OpenFileOperationTest, OpenOrCreateExistingFile) {
&error, &file_path, &close_callback));
test_util::RunBlockingPoolTask();
+ // Notified because 'available offline' status of the existing file changes.
+ EXPECT_EQ(1U, observer()->get_changed_paths().size());
+ EXPECT_TRUE(observer()->get_changed_paths().count(file_in_root.DirName()));
+
EXPECT_EQ(FILE_ERROR_OK, error);
ASSERT_TRUE(base::PathExists(file_path));
int64 local_file_size;
@@ -158,6 +165,16 @@ TEST_F(OpenFileOperationTest, OpenOrCreateExistingFile) {
EXPECT_EQ(
1U,
observer()->upload_needed_local_ids().count(src_entry.resource_id()));
+
+ bool success = false;
+ FileCacheEntry cache_entry;
+ cache()->GetCacheEntryOnUIThread(
+ src_entry.resource_id(),
+ google_apis::test_util::CreateCopyResultCallback(&success, &cache_entry));
+ test_util::RunBlockingPoolTask();
+ EXPECT_TRUE(success);
+ EXPECT_TRUE(cache_entry.is_present());
+ EXPECT_TRUE(cache_entry.is_dirty());
}
TEST_F(OpenFileOperationTest, OpenOrCreateNonExistingFile) {
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/file_system_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698