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

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

Issue 343073003: Files.app: Provide detailed change information on onDirectoryChanged event (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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
Index: chrome/browser/chromeos/drive/file_system/download_operation_unittest.cc
diff --git a/chrome/browser/chromeos/drive/file_system/download_operation_unittest.cc b/chrome/browser/chromeos/drive/file_system/download_operation_unittest.cc
index 4bd8c04d58bf0fcba19f316dbcf5d5d570c44e25..0bf6835cb159b6ee5c7cc8bf1deedc76ac7dd78b 100644
--- a/chrome/browser/chromeos/drive/file_system/download_operation_unittest.cc
+++ b/chrome/browser/chromeos/drive/file_system/download_operation_unittest.cc
@@ -8,6 +8,7 @@
#include "base/task_runner_util.h"
#include "chrome/browser/chromeos/drive/fake_free_disk_space_getter.h"
#include "chrome/browser/chromeos/drive/file_cache.h"
+#include "chrome/browser/chromeos/drive/file_change.h"
#include "chrome/browser/chromeos/drive/file_system/operation_test_base.h"
#include "chrome/browser/chromeos/drive/file_system_util.h"
#include "chrome/browser/chromeos/drive/job_scheduler.h"
@@ -61,8 +62,8 @@ TEST_F(DownloadOperationTest,
// The transfered file is cached and the change of "offline available"
// attribute is notified.
- EXPECT_EQ(1U, observer()->get_changed_paths().size());
- EXPECT_EQ(1U, observer()->get_changed_paths().count(file_in_root.DirName()));
+ EXPECT_EQ(1U, observer()->get_changed_files().size());
+ EXPECT_EQ(1U, observer()->get_changed_files().count(file_in_root));
}
TEST_F(DownloadOperationTest,
@@ -135,8 +136,9 @@ TEST_F(DownloadOperationTest,
// The transfered file is cached and the change of "offline available"
// attribute is notified.
- EXPECT_EQ(1U, observer()->get_changed_paths().size());
- EXPECT_EQ(1U, observer()->get_changed_paths().count(file_in_root.DirName()));
+ EXPECT_EQ(2U, observer()->get_changed_files().size());
+ EXPECT_TRUE(observer()->get_changed_files().count(file_in_root));
+ EXPECT_TRUE(observer()->get_changed_files().count(cached_file));
// The cache for the other file should be removed in order to free up space.
ResourceEntry cached_file_entry;
@@ -266,8 +268,8 @@ TEST_F(DownloadOperationTest, EnsureFileDownloadedByLocalId) {
// The transfered file is cached and the change of "offline available"
// attribute is notified.
- EXPECT_EQ(1U, observer()->get_changed_paths().size());
- EXPECT_EQ(1U, observer()->get_changed_paths().count(file_in_root.DirName()));
+ EXPECT_EQ(1U, observer()->get_changed_files().size());
+ EXPECT_EQ(1U, observer()->get_changed_files().count(file_in_root));
}
TEST_F(DownloadOperationTest,
@@ -303,9 +305,8 @@ TEST_F(DownloadOperationTest,
// The transfered file is cached and the change of "offline available"
// attribute is notified.
- EXPECT_EQ(1U, observer()->get_changed_paths().size());
- EXPECT_EQ(1U,
- observer()->get_changed_paths().count(file_in_root.DirName()));
+ EXPECT_EQ(1U, observer()->get_changed_files().size());
+ EXPECT_EQ(1U, observer()->get_changed_files().count(file_in_root));
}
{

Powered by Google App Engine
This is Rietveld 408576698