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

Side by Side Diff: chrome/browser/chromeos/drive/sync_client_unittest.cc

Issue 391343002: Keep sync tasks alive as long as it's not finished (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
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 "chrome/browser/chromeos/drive/sync_client.h" 5 #include "chrome/browser/chromeos/drive/sync_client.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 470
471 ResourceEntry entry2; 471 ResourceEntry entry2;
472 entry2.set_parent_local_id(local_id1); 472 entry2.set_parent_local_id(local_id1);
473 entry2.set_title(kPath2.BaseName().AsUTF8Unsafe()); 473 entry2.set_title(kPath2.BaseName().AsUTF8Unsafe());
474 entry2.mutable_file_info()->set_is_directory(true); 474 entry2.mutable_file_info()->set_is_directory(true);
475 entry2.set_metadata_edit_state(ResourceEntry::DIRTY); 475 entry2.set_metadata_edit_state(ResourceEntry::DIRTY);
476 std::string local_id2; 476 std::string local_id2;
477 EXPECT_EQ(FILE_ERROR_OK, metadata_->AddEntry(entry2, &local_id2)); 477 EXPECT_EQ(FILE_ERROR_OK, metadata_->AddEntry(entry2, &local_id2));
478 478
479 // Start syncing the child first. 479 // Start syncing the child first.
480 sync_client_->AddUpdateTask(ClientContext(USER_INITIATED), local_id2); 480 sync_client_->AddUpdateTask(ClientContext(USER_INITIATED), local_id2);
hashimoto 2014/07/16 11:05:16 In the new code, RunUntilIdle() is not called here
481 base::RunLoop().RunUntilIdle();
482 // Start syncing the parent later. 481 // Start syncing the parent later.
483 sync_client_->AddUpdateTask(ClientContext(USER_INITIATED), local_id1); 482 sync_client_->AddUpdateTask(ClientContext(USER_INITIATED), local_id1);
484 base::RunLoop().RunUntilIdle(); 483 base::RunLoop().RunUntilIdle();
485 484
486 // Both entries are synced. 485 // Both entries are synced.
487 EXPECT_EQ(FILE_ERROR_OK, metadata_->GetResourceEntryById(local_id1, &entry1)); 486 EXPECT_EQ(FILE_ERROR_OK, metadata_->GetResourceEntryById(local_id1, &entry1));
488 EXPECT_EQ(ResourceEntry::CLEAN, entry1.metadata_edit_state()); 487 EXPECT_EQ(ResourceEntry::CLEAN, entry1.metadata_edit_state());
489 EXPECT_EQ(FILE_ERROR_OK, metadata_->GetResourceEntryById(local_id2, &entry2)); 488 EXPECT_EQ(FILE_ERROR_OK, metadata_->GetResourceEntryById(local_id2, &entry2));
490 EXPECT_EQ(ResourceEntry::CLEAN, entry2.metadata_edit_state()); 489 EXPECT_EQ(ResourceEntry::CLEAN, entry2.metadata_edit_state());
491 } 490 }
492 491
493 } // namespace internal 492 } // namespace internal
494 } // namespace drive 493 } // namespace drive
OLDNEW
« chrome/browser/chromeos/drive/sync_client.cc ('K') | « chrome/browser/chromeos/drive/sync_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698