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

Unified Diff: chrome/browser/chromeos/drive/drive_file_system_unittest.cc

Issue 11346006: Use 1 instead of 0 for changestamp at unittest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unnecessary setup, move EXPECT_CALL(OnDirectoryChanged) to appropriate position. Created 8 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/drive/drive_file_system_unittest.cc
diff --git a/chrome/browser/chromeos/drive/drive_file_system_unittest.cc b/chrome/browser/chromeos/drive/drive_file_system_unittest.cc
index a867e72d978c4b5cfb8526b79d22bae9a7e82d3f..c63c6829a8c2073be099c7fc73945cc5ede46b36 100644
--- a/chrome/browser/chromeos/drive/drive_file_system_unittest.cc
+++ b/chrome/browser/chromeos/drive/drive_file_system_unittest.cc
@@ -622,7 +622,7 @@ class DriveFileSystemTest : public testing::Test {
void SaveTestFileSystem(SaveTestFileSystemParam param) {
DriveRootDirectoryProto root;
root.set_version(kProtoVersion);
- root.set_largest_changestamp(param == USE_SERVER_TIMESTAMP ? 654321 : 0);
+ root.set_largest_changestamp(param == USE_SERVER_TIMESTAMP ? 654321 : 1);
DriveDirectoryProto* root_dir = root.mutable_drive_directory();
DriveEntryProto* dir_base = root_dir->mutable_drive_entry();
PlatformFileInfoProto* platform_info = dir_base->mutable_file_info();
@@ -1195,9 +1195,7 @@ TEST_F(DriveFileSystemTest, CachedFeedLoadingThenServerFeedLoading) {
// SaveTestFileSystem and "account_metadata.json" have the same changestamp,
// so no request for new feeds (i.e., call to GetDocuments) should happen.
- mock_drive_service_->set_account_metadata(
- google_apis::test_util::LoadJSONFile(
- "gdata/account_metadata.json").release());
+ // Account metadata is already set up in MockDriveService's constructor.
EXPECT_CALL(*mock_drive_service_, GetAccountMetadata(_)).Times(1);
EXPECT_CALL(*mock_webapps_registry_, UpdateFromFeed(_)).Times(1);
EXPECT_CALL(*mock_drive_service_, GetDocuments(_, _, _, _, _)).Times(0);
@@ -1221,9 +1219,7 @@ TEST_F(DriveFileSystemTest, CachedFeedLoadingThenServerFeedLoading) {
TEST_F(DriveFileSystemTest, OfflineCachedFeedLoading) {
SaveTestFileSystem(USE_OLD_TIMESTAMP);
- mock_drive_service_->set_account_metadata(
- google_apis::test_util::LoadJSONFile(
- "gdata/account_metadata.json").release());
+ // Account metadata is already set up in MockDriveService's constructor.
EXPECT_CALL(*mock_drive_service_, GetAccountMetadata(_)).Times(1);
EXPECT_CALL(*mock_webapps_registry_, UpdateFromFeed(_)).Times(1);
@@ -1246,6 +1242,10 @@ TEST_F(DriveFileSystemTest, OfflineCachedFeedLoading) {
EXPECT_CALL(*mock_drive_service_, GetDocuments(_, _, _, _, _)).Times(1);
file_system_->CheckForUpdates();
+ // Expected value from reading gdata/basic_feed.json.
+ // See MockDriveService's |feed_data_|.
+ EXPECT_CALL(*mock_directory_observer_, OnDirectoryChanged(_)).Times(2);
+
google_apis::test_util::RunBlockingPoolTask();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698