| OLD | NEW |
| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 const base::FilePath& backing_filepath) { | 108 const base::FilePath& backing_filepath) { |
| 109 TestBackingStore* backing_store = | 109 TestBackingStore* backing_store = |
| 110 new TestBackingStore(dir_name, backing_filepath); | 110 new TestBackingStore(dir_name, backing_filepath); |
| 111 return new TestDirectory(encryptor, handler, backing_store); | 111 return new TestDirectory(encryptor, handler, backing_store); |
| 112 } | 112 } |
| 113 | 113 |
| 114 TestDirectory::TestDirectory( | 114 TestDirectory::TestDirectory( |
| 115 Encryptor* encryptor, | 115 Encryptor* encryptor, |
| 116 const WeakHandle<UnrecoverableErrorHandler>& handler, | 116 const WeakHandle<UnrecoverableErrorHandler>& handler, |
| 117 TestBackingStore* backing_store) | 117 TestBackingStore* backing_store) |
| 118 : Directory(backing_store, handler, base::Closure(), NULL, NULL), | 118 : Directory(backing_store, handler, base::Closure(), nullptr, nullptr), |
| 119 backing_store_(backing_store) {} | 119 backing_store_(backing_store) {} |
| 120 | 120 |
| 121 TestDirectory::~TestDirectory() {} | 121 TestDirectory::~TestDirectory() {} |
| 122 | 122 |
| 123 // crbug.com/144422 | 123 // crbug.com/144422 |
| 124 #if defined(OS_ANDROID) | 124 #if defined(OS_ANDROID) |
| 125 #define MAYBE_FailInitialWrite DISABLED_FailInitialWrite | 125 #define MAYBE_FailInitialWrite DISABLED_FailInitialWrite |
| 126 #else | 126 #else |
| 127 #define MAYBE_FailInitialWrite FailInitialWrite | 127 #define MAYBE_FailInitialWrite FailInitialWrite |
| 128 #endif | 128 #endif |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 TestUnrecoverableErrorHandler handler_; | 549 TestUnrecoverableErrorHandler handler_; |
| 550 NullDirectoryChangeDelegate delegate_; | 550 NullDirectoryChangeDelegate delegate_; |
| 551 }; | 551 }; |
| 552 | 552 |
| 553 TEST_F(SyncableDirectoryManagement, TestFileRelease) { | 553 TEST_F(SyncableDirectoryManagement, TestFileRelease) { |
| 554 base::FilePath path = | 554 base::FilePath path = |
| 555 temp_dir_.GetPath().Append(Directory::kSyncDatabaseFilename); | 555 temp_dir_.GetPath().Append(Directory::kSyncDatabaseFilename); |
| 556 | 556 |
| 557 { | 557 { |
| 558 Directory dir(new OnDiskDirectoryBackingStore("ScopeTest", path), | 558 Directory dir(new OnDiskDirectoryBackingStore("ScopeTest", path), |
| 559 MakeWeakHandle(handler_.GetWeakPtr()), base::Closure(), NULL, | 559 MakeWeakHandle(handler_.GetWeakPtr()), base::Closure(), |
| 560 NULL); | 560 nullptr, nullptr); |
| 561 DirOpenResult result = | 561 DirOpenResult result = |
| 562 dir.Open("ScopeTest", &delegate_, NullTransactionObserver()); | 562 dir.Open("ScopeTest", &delegate_, NullTransactionObserver()); |
| 563 ASSERT_EQ(result, OPENED); | 563 ASSERT_EQ(result, OPENED); |
| 564 } | 564 } |
| 565 | 565 |
| 566 // Destroying the directory should have released the backing database file. | 566 // Destroying the directory should have released the backing database file. |
| 567 ASSERT_TRUE(base::DeleteFile(path, true)); | 567 ASSERT_TRUE(base::DeleteFile(path, true)); |
| 568 } | 568 } |
| 569 | 569 |
| 570 class SyncableClientTagTest : public SyncableDirectoryTest { | 570 class SyncableClientTagTest : public SyncableDirectoryTest { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 TEST_F(SyncableClientTagTest, TestClientTagIndexDuplicateServer) { | 656 TEST_F(SyncableClientTagTest, TestClientTagIndexDuplicateServer) { |
| 657 EXPECT_TRUE(CreateWithDefaultTag(factory_.NewServerId(), true)); | 657 EXPECT_TRUE(CreateWithDefaultTag(factory_.NewServerId(), true)); |
| 658 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewServerId(), true)); | 658 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewServerId(), true)); |
| 659 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewServerId(), false)); | 659 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewServerId(), false)); |
| 660 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewLocalId(), false)); | 660 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewLocalId(), false)); |
| 661 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewLocalId(), true)); | 661 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewLocalId(), true)); |
| 662 } | 662 } |
| 663 | 663 |
| 664 } // namespace syncable | 664 } // namespace syncable |
| 665 } // namespace syncer | 665 } // namespace syncer |
| OLD | NEW |