| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <fstream> | 6 #include <fstream> |
| 7 | 7 |
| 8 #include "base/auto_reset.h" | 8 #include "base/auto_reset.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1045 EXPECT_TRUE(restore_observer.succeeded()); | 1045 EXPECT_TRUE(restore_observer.succeeded()); |
| 1046 | 1046 |
| 1047 URLIndexPrivateData& new_data(*GetPrivateData()); | 1047 URLIndexPrivateData& new_data(*GetPrivateData()); |
| 1048 | 1048 |
| 1049 // Make sure the data we have was reloaded from cache. (Version 0 | 1049 // Make sure the data we have was reloaded from cache. (Version 0 |
| 1050 // means rebuilt from history; anything else means restored from | 1050 // means rebuilt from history; anything else means restored from |
| 1051 // a cache version.) | 1051 // a cache version.) |
| 1052 EXPECT_GT(new_data.restored_cache_version_, 0); | 1052 EXPECT_GT(new_data.restored_cache_version_, 0); |
| 1053 | 1053 |
| 1054 // Compare the captured and restored for equality. | 1054 // Compare the captured and restored for equality. |
| 1055 ExpectPrivateDataEqual(*old_data, new_data); | 1055 ExpectPrivateDataEqual(*old_data.get(), new_data); |
| 1056 } | 1056 } |
| 1057 | 1057 |
| 1058 class InMemoryURLIndexCacheTest : public testing::Test { | 1058 class InMemoryURLIndexCacheTest : public testing::Test { |
| 1059 public: | 1059 public: |
| 1060 InMemoryURLIndexCacheTest() {} | 1060 InMemoryURLIndexCacheTest() {} |
| 1061 | 1061 |
| 1062 protected: | 1062 protected: |
| 1063 virtual void SetUp() OVERRIDE; | 1063 virtual void SetUp() OVERRIDE; |
| 1064 | 1064 |
| 1065 // Pass-through functions to simplify our friendship with InMemoryURLIndex. | 1065 // Pass-through functions to simplify our friendship with InMemoryURLIndex. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1099 full_file_path.GetComponents(&actual_parts); | 1099 full_file_path.GetComponents(&actual_parts); |
| 1100 ASSERT_EQ(expected_parts.size(), actual_parts.size()); | 1100 ASSERT_EQ(expected_parts.size(), actual_parts.size()); |
| 1101 size_t count = expected_parts.size(); | 1101 size_t count = expected_parts.size(); |
| 1102 for (size_t i = 0; i < count; ++i) | 1102 for (size_t i = 0; i < count; ++i) |
| 1103 EXPECT_EQ(expected_parts[i], actual_parts[i]); | 1103 EXPECT_EQ(expected_parts[i], actual_parts[i]); |
| 1104 // Must clear the history_dir_ to satisfy the dtor's DCHECK. | 1104 // Must clear the history_dir_ to satisfy the dtor's DCHECK. |
| 1105 set_history_dir(base::FilePath()); | 1105 set_history_dir(base::FilePath()); |
| 1106 } | 1106 } |
| 1107 | 1107 |
| 1108 } // namespace history | 1108 } // namespace history |
| OLD | NEW |