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

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: added export 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 | « webkit/fileapi/syncable/syncable_file_operation_runner.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2e7a160bc58ccbc32c91439bf847cffe87d7765d..f72cfbb9b0c0af58325d866351eb962ce51b29fe 100644
--- a/webkit/fileapi/syncable/syncable_file_operation_runner_unittest.cc
+++ b/webkit/fileapi/syncable/syncable_file_operation_runner_unittest.cc
@@ -75,16 +75,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() {
@@ -164,7 +156,6 @@ TEST_F(SyncableFileOperationRunnerTest, SimpleQueue) {
ASSERT_TRUE(sync_status()->IsWritable(URL(kFile)));
ResetCallbackStatus();
- operation_runner()->RunNextRunnableTask();
MessageLoop::current()->RunAllPending();
EXPECT_EQ(2, callback_count_);
@@ -185,14 +176,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();
@@ -217,9 +205,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) {
@@ -262,7 +249,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_);
@@ -273,7 +259,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_);
@@ -299,7 +284,6 @@ TEST_F(SyncableFileOperationRunnerTest, Write) {
sync_status()->EndSyncing(URL(kFile));
ResetCallbackStatus();
- operation_runner()->RunNextRunnableTask();
while (!write_complete_)
MessageLoop::current()->RunAllPending();
« no previous file with comments | « webkit/fileapi/syncable/syncable_file_operation_runner.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698