OLD | NEW |
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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1417 : Directory(encryptor, handler, NULL, backing_store), | 1417 : Directory(encryptor, handler, NULL, backing_store), |
1418 backing_store_(backing_store) { | 1418 backing_store_(backing_store) { |
1419 } | 1419 } |
1420 | 1420 |
1421 TestDirectory::~TestDirectory() { } | 1421 TestDirectory::~TestDirectory() { } |
1422 | 1422 |
1423 TEST(OnDiskSyncableDirectory, FailInitialWrite) { | 1423 TEST(OnDiskSyncableDirectory, FailInitialWrite) { |
1424 FakeEncryptor encryptor; | 1424 FakeEncryptor encryptor; |
1425 TestUnrecoverableErrorHandler handler; | 1425 TestUnrecoverableErrorHandler handler; |
1426 ScopedTempDir temp_dir; | 1426 ScopedTempDir temp_dir; |
| 1427 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); |
1427 FilePath file_path = temp_dir.path().Append( | 1428 FilePath file_path = temp_dir.path().Append( |
1428 FILE_PATH_LITERAL("Test.sqlite3")); | 1429 FILE_PATH_LITERAL("Test.sqlite3")); |
1429 std::string name = "user@x.com"; | 1430 std::string name = "user@x.com"; |
1430 NullDirectoryChangeDelegate delegate; | 1431 NullDirectoryChangeDelegate delegate; |
1431 | 1432 |
1432 scoped_ptr<TestDirectory> test_dir( | 1433 scoped_ptr<TestDirectory> test_dir( |
1433 TestDirectory::Create(&encryptor, &handler, name, file_path)); | 1434 TestDirectory::Create(&encryptor, &handler, name, file_path)); |
1434 | 1435 |
1435 test_dir->StartFailingSaveChanges(); | 1436 test_dir->StartFailingSaveChanges(); |
1436 ASSERT_EQ(FAILED_INITIAL_WRITE, test_dir->Open(name, &delegate, | 1437 ASSERT_EQ(FAILED_INITIAL_WRITE, test_dir->Open(name, &delegate, |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2039 EXPECT_TRUE(CreateWithDefaultTag(factory_.NewServerId(), true)); | 2040 EXPECT_TRUE(CreateWithDefaultTag(factory_.NewServerId(), true)); |
2040 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewServerId(), true)); | 2041 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewServerId(), true)); |
2041 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewServerId(), false)); | 2042 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewServerId(), false)); |
2042 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewLocalId(), false)); | 2043 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewLocalId(), false)); |
2043 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewLocalId(), true)); | 2044 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewLocalId(), true)); |
2044 } | 2045 } |
2045 | 2046 |
2046 } // namespace | 2047 } // namespace |
2047 } // namespace syncable | 2048 } // namespace syncable |
2048 } // namespace syncer | 2049 } // namespace syncer |
OLD | NEW |