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

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

Issue 642023004: Standardize usage of virtual/override/final in sync/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « sync/syncable/syncable_read_transaction.h ('k') | sync/syncable/syncable_write_transaction.h » ('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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 using base::ExpectDictBooleanValue; 44 using base::ExpectDictBooleanValue;
45 using base::ExpectDictStringValue; 45 using base::ExpectDictStringValue;
46 46
47 // An OnDiskDirectoryBackingStore that can be set to always fail SaveChanges. 47 // An OnDiskDirectoryBackingStore that can be set to always fail SaveChanges.
48 class TestBackingStore : public OnDiskDirectoryBackingStore { 48 class TestBackingStore : public OnDiskDirectoryBackingStore {
49 public: 49 public:
50 TestBackingStore(const std::string& dir_name, 50 TestBackingStore(const std::string& dir_name,
51 const base::FilePath& backing_filepath); 51 const base::FilePath& backing_filepath);
52 52
53 virtual ~TestBackingStore(); 53 ~TestBackingStore() override;
54 54
55 virtual bool SaveChanges(const Directory::SaveChangesSnapshot& snapshot) 55 bool SaveChanges(const Directory::SaveChangesSnapshot& snapshot) override;
56 override;
57 56
58 void StartFailingSaveChanges() { 57 void StartFailingSaveChanges() {
59 fail_save_changes_ = true; 58 fail_save_changes_ = true;
60 } 59 }
61 60
62 private: 61 private:
63 bool fail_save_changes_; 62 bool fail_save_changes_;
64 }; 63 };
65 64
66 TestBackingStore::TestBackingStore(const std::string& dir_name, 65 TestBackingStore::TestBackingStore(const std::string& dir_name,
(...skipping 16 matching lines...) Expand all
83 // A directory whose Save() function can be set to always fail. 82 // A directory whose Save() function can be set to always fail.
84 class TestDirectory : public Directory { 83 class TestDirectory : public Directory {
85 public: 84 public:
86 // A factory function used to work around some initialization order issues. 85 // A factory function used to work around some initialization order issues.
87 static TestDirectory* Create( 86 static TestDirectory* Create(
88 Encryptor *encryptor, 87 Encryptor *encryptor,
89 UnrecoverableErrorHandler *handler, 88 UnrecoverableErrorHandler *handler,
90 const std::string& dir_name, 89 const std::string& dir_name,
91 const base::FilePath& backing_filepath); 90 const base::FilePath& backing_filepath);
92 91
93 virtual ~TestDirectory(); 92 ~TestDirectory() override;
94 93
95 void StartFailingSaveChanges() { 94 void StartFailingSaveChanges() {
96 backing_store_->StartFailingSaveChanges(); 95 backing_store_->StartFailingSaveChanges();
97 } 96 }
98 97
99 private: 98 private:
100 TestDirectory(Encryptor* encryptor, 99 TestDirectory(Encryptor* encryptor,
101 UnrecoverableErrorHandler* handler, 100 UnrecoverableErrorHandler* handler,
102 TestBackingStore* backing_store); 101 TestBackingStore* backing_store);
103 102
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 TEST_F(SyncableClientTagTest, TestClientTagIndexDuplicateServer) { 667 TEST_F(SyncableClientTagTest, TestClientTagIndexDuplicateServer) {
669 EXPECT_TRUE(CreateWithDefaultTag(factory_.NewServerId(), true)); 668 EXPECT_TRUE(CreateWithDefaultTag(factory_.NewServerId(), true));
670 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewServerId(), true)); 669 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewServerId(), true));
671 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewServerId(), false)); 670 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewServerId(), false));
672 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewLocalId(), false)); 671 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewLocalId(), false));
673 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewLocalId(), true)); 672 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewLocalId(), true));
674 } 673 }
675 674
676 } // namespace syncable 675 } // namespace syncable
677 } // namespace syncer 676 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/syncable/syncable_read_transaction.h ('k') | sync/syncable/syncable_write_transaction.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698