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 "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 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/files/scoped_temp_dir.h" | 15 #include "base/files/scoped_temp_dir.h" |
16 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
17 #include "base/run_loop.h" | 17 #include "base/run_loop.h" |
18 #include "base/stl_util.h" | 18 #include "base/stl_util.h" |
19 #include "base/strings/string_number_conversions.h" | 19 #include "base/strings/string_number_conversions.h" |
20 #include "base/strings/stringprintf.h" | 20 #include "base/strings/stringprintf.h" |
21 #include "build/build_config.h" | 21 #include "build/build_config.h" |
| 22 #include "components/sync/base/node_ordinal.h" |
| 23 #include "components/sync/base/sync_export.h" |
| 24 #include "components/sync/base/time.h" |
| 25 #include "components/sync/protocol/bookmark_specifics.pb.h" |
| 26 #include "components/sync/protocol/sync.pb.h" |
| 27 #include "components/sync/syncable/directory.h" |
| 28 #include "components/sync/syncable/on_disk_directory_backing_store.h" |
| 29 #include "components/sync/syncable/syncable-inl.h" |
| 30 #include "components/sync/test/directory_backing_store_corruption_testing.h" |
| 31 #include "components/sync/test/test_directory_backing_store.h" |
22 #include "sql/connection.h" | 32 #include "sql/connection.h" |
23 #include "sql/statement.h" | 33 #include "sql/statement.h" |
24 #include "sql/test/test_helpers.h" | 34 #include "sql/test/test_helpers.h" |
25 #include "sync/base/sync_export.h" | |
26 #include "sync/internal_api/public/base/node_ordinal.h" | |
27 #include "sync/protocol/bookmark_specifics.pb.h" | |
28 #include "sync/protocol/sync.pb.h" | |
29 #include "sync/syncable/directory.h" | |
30 #include "sync/syncable/on_disk_directory_backing_store.h" | |
31 #include "sync/syncable/syncable-inl.h" | |
32 #include "sync/test/directory_backing_store_corruption_testing.h" | |
33 #include "sync/test/test_directory_backing_store.h" | |
34 #include "sync/util/time.h" | |
35 #include "testing/gtest/include/gtest/gtest-param-test.h" | 35 #include "testing/gtest/include/gtest/gtest-param-test.h" |
36 #include "testing/gtest/include/gtest/gtest.h" | 36 #include "testing/gtest/include/gtest/gtest.h" |
37 | 37 |
38 namespace syncer { | 38 namespace syncer { |
39 namespace syncable { | 39 namespace syncable { |
40 namespace { | 40 namespace { |
41 | 41 |
42 // A handler that simply sets |catastrophic_error_handler_was_called| to true. | 42 // A handler that simply sets |catastrophic_error_handler_was_called| to true. |
43 void CatastrophicErrorHandler(bool* catastrophic_error_handler_was_called) { | 43 void CatastrophicErrorHandler(bool* catastrophic_error_handler_was_called) { |
44 *catastrophic_error_handler_was_called = true; | 44 *catastrophic_error_handler_was_called = true; |
(...skipping 4219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4264 ASSERT_FALSE(dbs->SaveChanges(snapshot)); | 4264 ASSERT_FALSE(dbs->SaveChanges(snapshot)); |
4265 // At this point the handler has been posted but not executed. | 4265 // At this point the handler has been posted but not executed. |
4266 ASSERT_FALSE(was_called); | 4266 ASSERT_FALSE(was_called); |
4267 // Pump the message loop and see that it is executed. | 4267 // Pump the message loop and see that it is executed. |
4268 base::RunLoop().RunUntilIdle(); | 4268 base::RunLoop().RunUntilIdle(); |
4269 ASSERT_TRUE(was_called); | 4269 ASSERT_TRUE(was_called); |
4270 } | 4270 } |
4271 | 4271 |
4272 } // namespace syncable | 4272 } // namespace syncable |
4273 } // namespace syncer | 4273 } // namespace syncer |
OLD | NEW |