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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 EXPECT_TRUE(IsTopSitesLoaded()); | 904 EXPECT_TRUE(IsTopSitesLoaded()); |
905 | 905 |
906 // Make sure the data was migrated to top sites. | 906 // Make sure the data was migrated to top sites. |
907 ASSERT_NO_FATAL_FAILURE(MigrationAssertions()); | 907 ASSERT_NO_FATAL_FAILURE(MigrationAssertions()); |
908 | 908 |
909 // We need to wait for top sites and history to finish processing requests. | 909 // We need to wait for top sites and history to finish processing requests. |
910 WaitForTopSites(); | 910 WaitForTopSites(); |
911 WaitForHistory(); | 911 WaitForHistory(); |
912 | 912 |
913 // Make sure there is no longer a Thumbnails file on disk. | 913 // Make sure there is no longer a Thumbnails file on disk. |
914 ASSERT_FALSE(file_util::PathExists( | 914 ASSERT_FALSE(base::PathExists( |
915 profile()->GetPath().Append(chrome::kThumbnailsFilename))); | 915 profile()->GetPath().Append(chrome::kThumbnailsFilename))); |
916 | 916 |
917 // Recreate top sites and make sure everything is still there. | 917 // Recreate top sites and make sure everything is still there. |
918 profile()->CreateHistoryService(false, false); | 918 profile()->CreateHistoryService(false, false); |
919 RecreateTopSitesAndBlock(); | 919 RecreateTopSitesAndBlock(); |
920 | 920 |
921 ASSERT_NO_FATAL_FAILURE(MigrationAssertions()); | 921 ASSERT_NO_FATAL_FAILURE(MigrationAssertions()); |
922 } | 922 } |
923 | 923 |
924 // Verifies that callbacks are notified correctly if requested before top sites | 924 // Verifies that callbacks are notified correctly if requested before top sites |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1259 chrome::NOTIFICATION_TOP_SITES_LOADED, | 1259 chrome::NOTIFICATION_TOP_SITES_LOADED, |
1260 content::Source<Profile>(profile())); | 1260 content::Source<Profile>(profile())); |
1261 profile()->CreateTopSites(); | 1261 profile()->CreateTopSites(); |
1262 HistoryServiceFactory::GetForProfile( | 1262 HistoryServiceFactory::GetForProfile( |
1263 profile(), Profile::EXPLICIT_ACCESS)->UnloadBackend(); | 1263 profile(), Profile::EXPLICIT_ACCESS)->UnloadBackend(); |
1264 profile()->BlockUntilHistoryProcessesPendingRequests(); | 1264 profile()->BlockUntilHistoryProcessesPendingRequests(); |
1265 observer.Wait(); | 1265 observer.Wait(); |
1266 } | 1266 } |
1267 | 1267 |
1268 } // namespace history | 1268 } // namespace history |
OLD | NEW |