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

Side by Side Diff: sync/syncable/syncable_unittest.cc

Issue 1057663002: [Sync] Eliminate friends from Directory by exposing kernel via accessor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes from review. Created 5 years, 8 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
« no previous file with comments | « sync/syncable/syncable_base_transaction.cc ('k') | sync/syncable/syncable_write_transaction.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 <string> 5 #include <string>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 base::ScopedTempDir temp_dir_; 554 base::ScopedTempDir temp_dir_;
555 FakeEncryptor encryptor_; 555 FakeEncryptor encryptor_;
556 TestUnrecoverableErrorHandler handler_; 556 TestUnrecoverableErrorHandler handler_;
557 NullDirectoryChangeDelegate delegate_; 557 NullDirectoryChangeDelegate delegate_;
558 }; 558 };
559 559
560 TEST_F(SyncableDirectoryManagement, TestFileRelease) { 560 TEST_F(SyncableDirectoryManagement, TestFileRelease) {
561 base::FilePath path = 561 base::FilePath path =
562 temp_dir_.path().Append(Directory::kSyncDatabaseFilename); 562 temp_dir_.path().Append(Directory::kSyncDatabaseFilename);
563 563
564 Directory dir(new OnDiskDirectoryBackingStore("ScopeTest", path), 564 {
565 &handler_, 565 Directory dir(new OnDiskDirectoryBackingStore("ScopeTest", path), &handler_,
566 NULL, 566 NULL, NULL, NULL);
567 NULL, 567 DirOpenResult result =
568 NULL); 568 dir.Open("ScopeTest", &delegate_, NullTransactionObserver());
569 DirOpenResult result = 569 ASSERT_EQ(result, OPENED);
570 dir.Open("ScopeTest", &delegate_, NullTransactionObserver()); 570 }
571 ASSERT_EQ(result, OPENED);
572 dir.Close();
573 571
574 // Closing the directory should have released the backing database file. 572 // Destroying the directory should have released the backing database file.
575 ASSERT_TRUE(base::DeleteFile(path, true)); 573 ASSERT_TRUE(base::DeleteFile(path, true));
576 } 574 }
577 575
578 class SyncableClientTagTest : public SyncableDirectoryTest { 576 class SyncableClientTagTest : public SyncableDirectoryTest {
579 public: 577 public:
580 static const int kBaseVersion = 1; 578 static const int kBaseVersion = 1;
581 const char* test_name_; 579 const char* test_name_;
582 const char* test_tag_; 580 const char* test_tag_;
583 581
584 SyncableClientTagTest() : test_name_("test_name"), test_tag_("dietcoke") {} 582 SyncableClientTagTest() : test_name_("test_name"), test_tag_("dietcoke") {}
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 TEST_F(SyncableClientTagTest, TestClientTagIndexDuplicateServer) { 663 TEST_F(SyncableClientTagTest, TestClientTagIndexDuplicateServer) {
666 EXPECT_TRUE(CreateWithDefaultTag(factory_.NewServerId(), true)); 664 EXPECT_TRUE(CreateWithDefaultTag(factory_.NewServerId(), true));
667 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewServerId(), true)); 665 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewServerId(), true));
668 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewServerId(), false)); 666 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewServerId(), false));
669 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewLocalId(), false)); 667 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewLocalId(), false));
670 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewLocalId(), true)); 668 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewLocalId(), true));
671 } 669 }
672 670
673 } // namespace syncable 671 } // namespace syncable
674 } // namespace syncer 672 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/syncable/syncable_base_transaction.cc ('k') | sync/syncable/syncable_write_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698