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

Side by Side Diff: webkit/fileapi/syncable/local_file_sync_context_unittest.cc

Issue 11960003: Cleanup: Move more recursive operation logic from FileUtilHelper to FileUtil (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/fileapi/obfuscated_file_util_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/fileapi/syncable/local_file_sync_context.h" 5 #include "webkit/fileapi/syncable/local_file_sync_context.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 SYNC_FILE_TYPE_DIRECTORY); 565 SYNC_FILE_TYPE_DIRECTORY);
566 EXPECT_EQ(SYNC_STATUS_OK, 566 EXPECT_EQ(SYNC_STATUS_OK,
567 ApplyRemoteChange(file_system.file_system_context(), 567 ApplyRemoteChange(file_system.file_system_context(),
568 change, FilePath(), kDir, 568 change, FilePath(), kDir,
569 SYNC_FILE_TYPE_UNKNOWN)); 569 SYNC_FILE_TYPE_UNKNOWN));
570 570
571 // This should not happen, but calling ApplyRemoteChange 571 // This should not happen, but calling ApplyRemoteChange
572 // with wrong file type will result in error. 572 // with wrong file type will result in error.
573 change = FileChange(FileChange::FILE_CHANGE_ADD_OR_UPDATE, 573 change = FileChange(FileChange::FILE_CHANGE_ADD_OR_UPDATE,
574 SYNC_FILE_TYPE_FILE); 574 SYNC_FILE_TYPE_FILE);
575 EXPECT_EQ(SYNC_FILE_ERROR_FAILED, 575 EXPECT_NE(SYNC_STATUS_OK,
576 ApplyRemoteChange(file_system.file_system_context(), 576 ApplyRemoteChange(file_system.file_system_context(),
577 change, kFilePath1, kDir, 577 change, kFilePath1, kDir,
578 SYNC_FILE_TYPE_DIRECTORY)); 578 SYNC_FILE_TYPE_DIRECTORY));
579 579
580 // Creating a file/directory must have increased the usage more than 580 // Creating a file/directory must have increased the usage more than
581 // the size of kTestFileData2. 581 // the size of kTestFileData2.
582 new_usage = usage; 582 new_usage = usage;
583 EXPECT_EQ(quota::kQuotaStatusOk, 583 EXPECT_EQ(quota::kQuotaStatusOk,
584 file_system.GetUsageAndQuota(&new_usage, &quota)); 584 file_system.GetUsageAndQuota(&new_usage, &quota));
585 EXPECT_GT(new_usage, 585 EXPECT_GT(new_usage,
586 static_cast<int64>(usage + arraysize(kTestFileData2) - 1)); 586 static_cast<int64>(usage + arraysize(kTestFileData2) - 1));
587 587
588 // The changes applied by ApplyRemoteChange should not be recorded in 588 // The changes applied by ApplyRemoteChange should not be recorded in
589 // the change tracker. 589 // the change tracker.
590 urls.clear(); 590 urls.clear();
591 file_system.GetChangedURLsInTracker(&urls); 591 file_system.GetChangedURLsInTracker(&urls);
592 EXPECT_TRUE(urls.empty()); 592 EXPECT_TRUE(urls.empty());
593 593
594 // Make sure all three files/directory exist. 594 // Make sure all three files/directory exist.
595 EXPECT_EQ(base::PLATFORM_FILE_OK, file_system.FileExists(kFile1)); 595 EXPECT_EQ(base::PLATFORM_FILE_OK, file_system.FileExists(kFile1));
596 EXPECT_EQ(base::PLATFORM_FILE_OK, file_system.FileExists(kFile2)); 596 EXPECT_EQ(base::PLATFORM_FILE_OK, file_system.FileExists(kFile2));
597 EXPECT_EQ(base::PLATFORM_FILE_OK, file_system.DirectoryExists(kDir)); 597 EXPECT_EQ(base::PLATFORM_FILE_OK, file_system.DirectoryExists(kDir));
598 598
599 sync_context_->ShutdownOnUIThread(); 599 sync_context_->ShutdownOnUIThread();
600 file_system.TearDown(); 600 file_system.TearDown();
601 } 601 }
602 602
603 } // namespace fileapi 603 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/obfuscated_file_util_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698