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

Unified Diff: webkit/fileapi/syncable/syncable_file_operation_runner_unittest.cc

Issue 11238054: Add OnSyncEnabled/OnWriteEnabled notification handling to operation runner (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: webkit/fileapi/syncable/syncable_file_operation_runner_unittest.cc
diff --git a/webkit/fileapi/syncable/syncable_file_operation_runner_unittest.cc b/webkit/fileapi/syncable/syncable_file_operation_runner_unittest.cc
index f577e91e03b58c2dd9f9c32a3481067027405957..7df22e6e154b3f2aaa68781281b71f220472fb50 100644
--- a/webkit/fileapi/syncable/syncable_file_operation_runner_unittest.cc
+++ b/webkit/fileapi/syncable/syncable_file_operation_runner_unittest.cc
@@ -74,16 +74,8 @@ class SyncableFileOperationRunnerTest : public testing::Test {
return file_system_.URL(path);
}
- LocalFileSyncContext* sync_context() {
- return file_system_.file_system_context()->sync_context();
- }
-
- SyncableFileOperationRunner* operation_runner() {
- return sync_context()->operation_runner().get();
- }
-
LocalFileSyncStatus* sync_status() {
- return operation_runner()->sync_status();
+ return file_system_.file_system_context()->sync_context()->sync_status();
}
void ResetCallbackStatus() {
@@ -163,7 +155,6 @@ TEST_F(SyncableFileOperationRunnerTest, SimpleQueue) {
ASSERT_TRUE(sync_status()->IsWritable(URL(kFile)));
ResetCallbackStatus();
- operation_runner()->RunNextRunnableTask();
MessageLoop::current()->RunAllPending();
EXPECT_EQ(2, callback_count_);
@@ -184,14 +175,11 @@ TEST_F(SyncableFileOperationRunnerTest, WriteToParentAndChild) {
sync_status()->StartSyncing(URL(kDir));
ASSERT_FALSE(sync_status()->IsWritable(URL(kDir)));
- // Writes to kParent, kDir and kChild should be all queued up.
+ // Writes to kParent and kChild should be all queued up.
ResetCallbackStatus();
file_system_.NewOperation()->Truncate(
URL(kChild), 1, ExpectStatus(FROM_HERE, base::PLATFORM_FILE_OK));
file_system_.NewOperation()->Remove(
- URL(kDir), true /* recursive */,
- ExpectStatus(FROM_HERE, base::PLATFORM_FILE_OK));
- file_system_.NewOperation()->Remove(
URL(kParent), true /* recursive */,
ExpectStatus(FROM_HERE, base::PLATFORM_FILE_OK));
MessageLoop::current()->RunAllPending();
@@ -216,9 +204,8 @@ TEST_F(SyncableFileOperationRunnerTest, WriteToParentAndChild) {
ASSERT_TRUE(sync_status()->IsWritable(URL(kDir)));
ResetCallbackStatus();
- operation_runner()->RunNextRunnableTask();
MessageLoop::current()->RunAllPending();
- EXPECT_EQ(3, callback_count_);
+ EXPECT_EQ(2, callback_count_);
}
TEST_F(SyncableFileOperationRunnerTest, CopyAndMove) {
@@ -261,7 +248,6 @@ TEST_F(SyncableFileOperationRunnerTest, CopyAndMove) {
// Finish syncing the "dest-copy2" directory to unlock Copy.
sync_status()->EndSyncing(URL("dest-copy2"));
ResetCallbackStatus();
- operation_runner()->RunNextRunnableTask();
MessageLoop::current()->RunAllPending();
EXPECT_EQ(1, callback_count_);
@@ -272,7 +258,6 @@ TEST_F(SyncableFileOperationRunnerTest, CopyAndMove) {
// Finish syncing the kParent to unlock Move.
sync_status()->EndSyncing(URL(kParent));
ResetCallbackStatus();
- operation_runner()->RunNextRunnableTask();
MessageLoop::current()->RunAllPending();
EXPECT_EQ(1, callback_count_);
@@ -298,7 +283,6 @@ TEST_F(SyncableFileOperationRunnerTest, Write) {
sync_status()->EndSyncing(URL(kFile));
ResetCallbackStatus();
- operation_runner()->RunNextRunnableTask();
while (!write_complete_)
MessageLoop::current()->RunAllPending();

Powered by Google App Engine
This is Rietveld 408576698