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/format_macros.h" | 8 #include "base/format_macros.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
(...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1370 FilePath data_path; | 1370 FilePath data_path; |
1371 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_path)); | 1371 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_path)); |
1372 data_path = data_path.AppendASCII("top_sites"); | 1372 data_path = data_path.AppendASCII("top_sites"); |
1373 ASSERT_NO_FATAL_FAILURE(ExecuteSQLScript( | 1373 ASSERT_NO_FATAL_FAILURE(ExecuteSQLScript( |
1374 data_path.AppendASCII("history.19.sql"), | 1374 data_path.AppendASCII("history.19.sql"), |
1375 profile()->GetPath().Append(chrome::kHistoryFilename))); | 1375 profile()->GetPath().Append(chrome::kHistoryFilename))); |
1376 ASSERT_NO_FATAL_FAILURE(ExecuteSQLScript( | 1376 ASSERT_NO_FATAL_FAILURE(ExecuteSQLScript( |
1377 data_path.AppendASCII("thumbnails.3.sql"), | 1377 data_path.AppendASCII("thumbnails.3.sql"), |
1378 profile()->GetPath().Append(chrome::kThumbnailsFilename))); | 1378 profile()->GetPath().Append(chrome::kThumbnailsFilename))); |
1379 | 1379 |
1380 // Create history and block until its loaded. | 1380 // Create history and block until it's loaded. |
1381 profile()->CreateHistoryService(false, false); | 1381 profile()->CreateHistoryService(false, false); |
1382 profile()->BlockUntilHistoryProcessesPendingRequests(); | 1382 profile()->BlockUntilHistoryProcessesPendingRequests(); |
1383 | 1383 |
1384 // Create top sites and unload history. | 1384 // Create top sites and unload history. |
1385 ui_test_utils::WindowedNotificationObserver observer( | 1385 ui_test_utils::WindowedNotificationObserver observer( |
1386 chrome::NOTIFICATION_TOP_SITES_LOADED, | 1386 chrome::NOTIFICATION_TOP_SITES_LOADED, |
1387 content::Source<Profile>(profile())); | 1387 content::Source<Profile>(profile())); |
1388 profile()->CreateTopSites(); | 1388 profile()->CreateTopSites(); |
1389 profile()->GetHistoryService(Profile::EXPLICIT_ACCESS)->UnloadBackend(); | 1389 profile()->GetHistoryService(Profile::EXPLICIT_ACCESS)->UnloadBackend(); |
1390 profile()->BlockUntilHistoryProcessesPendingRequests(); | 1390 profile()->BlockUntilHistoryProcessesPendingRequests(); |
1391 observer.Wait(); | 1391 observer.Wait(); |
1392 } | 1392 } |
1393 | 1393 |
1394 } // namespace history | 1394 } // namespace history |
OLD | NEW |