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

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

Issue 10873062: Fix sync unit test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698