| 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 "components/sync/syncable/directory_backing_store.h" | 5 #include "components/sync/syncable/directory_backing_store.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 void CatastrophicErrorHandler(bool* catastrophic_error_handler_was_called) { | 34 void CatastrophicErrorHandler(bool* catastrophic_error_handler_was_called) { |
| 35 *catastrophic_error_handler_was_called = true; | 35 *catastrophic_error_handler_was_called = true; |
| 36 } | 36 } |
| 37 | 37 |
| 38 // Create a dirty EntryKernel with an ID derived from |id| + |id_suffix|. | 38 // Create a dirty EntryKernel with an ID derived from |id| + |id_suffix|. |
| 39 std::unique_ptr<EntryKernel> CreateEntry(int id, const std::string& id_suffix) { | 39 std::unique_ptr<EntryKernel> CreateEntry(int id, const std::string& id_suffix) { |
| 40 std::unique_ptr<EntryKernel> entry(new EntryKernel()); | 40 std::unique_ptr<EntryKernel> entry(new EntryKernel()); |
| 41 std::string id_string = base::Int64ToString(id) + id_suffix; | 41 std::string id_string = base::Int64ToString(id) + id_suffix; |
| 42 entry->put(ID, Id::CreateFromClientString(id_string)); | 42 entry->put(ID, Id::CreateFromClientString(id_string)); |
| 43 entry->put(META_HANDLE, id); | 43 entry->put(META_HANDLE, id); |
| 44 entry->mark_dirty(NULL); | 44 entry->mark_dirty(nullptr); |
| 45 return entry; | 45 return entry; |
| 46 } | 46 } |
| 47 | 47 |
| 48 } // namespace | 48 } // namespace |
| 49 | 49 |
| 50 extern const int32_t kCurrentPageSizeKB; | 50 extern const int32_t kCurrentPageSizeKB; |
| 51 extern const int32_t kCurrentDBVersion; | 51 extern const int32_t kCurrentDBVersion; |
| 52 | 52 |
| 53 class MigrationTest : public testing::TestWithParam<int> { | 53 class MigrationTest : public testing::TestWithParam<int> { |
| 54 public: | 54 public: |
| (...skipping 4256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4311 ASSERT_FALSE(dbs->SaveChanges(snapshot)); | 4311 ASSERT_FALSE(dbs->SaveChanges(snapshot)); |
| 4312 // At this point the handler has been posted but not executed. | 4312 // At this point the handler has been posted but not executed. |
| 4313 ASSERT_FALSE(was_called); | 4313 ASSERT_FALSE(was_called); |
| 4314 // Pump the message loop and see that it is executed. | 4314 // Pump the message loop and see that it is executed. |
| 4315 base::RunLoop().RunUntilIdle(); | 4315 base::RunLoop().RunUntilIdle(); |
| 4316 ASSERT_TRUE(was_called); | 4316 ASSERT_TRUE(was_called); |
| 4317 } | 4317 } |
| 4318 | 4318 |
| 4319 } // namespace syncable | 4319 } // namespace syncable |
| 4320 } // namespace syncer | 4320 } // namespace syncer |
| OLD | NEW |