| 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 #include <stdint.h> | |
| 9 | 8 |
| 10 #include <map> | 9 #include <map> |
| 11 #include <memory> | |
| 12 #include <string> | |
| 13 | 10 |
| 14 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 15 #include "base/files/scoped_temp_dir.h" | 12 #include "base/files/scoped_temp_dir.h" |
| 16 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 17 #include "base/run_loop.h" | 14 #include "base/run_loop.h" |
| 18 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
| 19 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
| 20 #include "build/build_config.h" | 17 #include "build/build_config.h" |
| 21 #include "components/sync/base/node_ordinal.h" | 18 #include "components/sync/base/node_ordinal.h" |
| 22 #include "components/sync/base/time.h" | 19 #include "components/sync/base/time.h" |
| 23 #include "components/sync/protocol/bookmark_specifics.pb.h" | 20 #include "components/sync/protocol/bookmark_specifics.pb.h" |
| 24 #include "components/sync/protocol/sync.pb.h" | 21 #include "components/sync/protocol/sync.pb.h" |
| 25 #include "components/sync/syncable/directory.h" | |
| 26 #include "components/sync/syncable/on_disk_directory_backing_store.h" | 22 #include "components/sync/syncable/on_disk_directory_backing_store.h" |
| 27 #include "components/sync/test/directory_backing_store_corruption_testing.h" | 23 #include "components/sync/test/directory_backing_store_corruption_testing.h" |
| 28 #include "components/sync/test/test_directory_backing_store.h" | 24 #include "components/sync/test/test_directory_backing_store.h" |
| 29 #include "sql/connection.h" | |
| 30 #include "sql/statement.h" | |
| 31 #include "sql/test/test_helpers.h" | 25 #include "sql/test/test_helpers.h" |
| 32 #include "testing/gtest/include/gtest/gtest-param-test.h" | 26 #include "testing/gtest/include/gtest/gtest-param-test.h" |
| 33 #include "testing/gtest/include/gtest/gtest.h" | 27 #include "testing/gtest/include/gtest/gtest.h" |
| 34 | 28 |
| 35 namespace syncer { | 29 namespace syncer { |
| 36 namespace syncable { | 30 namespace syncable { |
| 37 namespace { | 31 namespace { |
| 38 | 32 |
| 39 // A handler that simply sets |catastrophic_error_handler_was_called| to true. | 33 // A handler that simply sets |catastrophic_error_handler_was_called| to true. |
| 40 void CatastrophicErrorHandler(bool* catastrophic_error_handler_was_called) { | 34 void CatastrophicErrorHandler(bool* catastrophic_error_handler_was_called) { |
| (...skipping 4276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4317 ASSERT_FALSE(dbs->SaveChanges(snapshot)); | 4311 ASSERT_FALSE(dbs->SaveChanges(snapshot)); |
| 4318 // At this point the handler has been posted but not executed. | 4312 // At this point the handler has been posted but not executed. |
| 4319 ASSERT_FALSE(was_called); | 4313 ASSERT_FALSE(was_called); |
| 4320 // Pump the message loop and see that it is executed. | 4314 // Pump the message loop and see that it is executed. |
| 4321 base::RunLoop().RunUntilIdle(); | 4315 base::RunLoop().RunUntilIdle(); |
| 4322 ASSERT_TRUE(was_called); | 4316 ASSERT_TRUE(was_called); |
| 4323 } | 4317 } |
| 4324 | 4318 |
| 4325 } // namespace syncable | 4319 } // namespace syncable |
| 4326 } // namespace syncer | 4320 } // namespace syncer |
| OLD | NEW |