Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: chrome/browser/history/top_sites_unittest.cc

Issue 10807047: Create content\public\test\test_utils.h to hold common test classes that are used by unit and brows… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
11 #include "base/string_util.h" 11 #include "base/string_util.h"
12 #include "base/utf_string_conversions.h" 12 #include "base/utf_string_conversions.h"
13 #include "base/values.h" 13 #include "base/values.h"
14 #include "chrome/browser/history/history_backend.h" 14 #include "chrome/browser/history/history_backend.h"
15 #include "chrome/browser/history/history_database.h" 15 #include "chrome/browser/history/history_database.h"
16 #include "chrome/browser/history/history_marshaling.h" 16 #include "chrome/browser/history/history_marshaling.h"
17 #include "chrome/browser/history/history_notifications.h" 17 #include "chrome/browser/history/history_notifications.h"
18 #include "chrome/browser/history/history_service_factory.h" 18 #include "chrome/browser/history/history_service_factory.h"
19 #include "chrome/browser/history/history_unittest_base.h" 19 #include "chrome/browser/history/history_unittest_base.h"
20 #include "chrome/browser/history/top_sites.h" 20 #include "chrome/browser/history/top_sites.h"
21 #include "chrome/browser/history/top_sites_backend.h" 21 #include "chrome/browser/history/top_sites_backend.h"
22 #include "chrome/browser/history/top_sites_cache.h" 22 #include "chrome/browser/history/top_sites_cache.h"
23 #include "chrome/browser/history/top_sites_database.h" 23 #include "chrome/browser/history/top_sites_database.h"
24 #include "chrome/browser/ui/webui/ntp/most_visited_handler.h" 24 #include "chrome/browser/ui/webui/ntp/most_visited_handler.h"
25 #include "chrome/common/chrome_constants.h" 25 #include "chrome/common/chrome_constants.h"
26 #include "chrome/common/chrome_notification_types.h" 26 #include "chrome/common/chrome_notification_types.h"
27 #include "chrome/common/chrome_paths.h" 27 #include "chrome/common/chrome_paths.h"
28 #include "chrome/common/chrome_switches.h" 28 #include "chrome/common/chrome_switches.h"
29 #include "chrome/test/base/testing_profile.h" 29 #include "chrome/test/base/testing_profile.h"
30 #include "chrome/test/base/ui_test_utils.h"
31 #include "chrome/tools/profiles/thumbnail-inl.h" 30 #include "chrome/tools/profiles/thumbnail-inl.h"
32 #include "content/public/test/test_browser_thread.h" 31 #include "content/public/test/test_browser_thread.h"
32 #include "content/public/test/test_utils.h"
33 #include "googleurl/src/gurl.h" 33 #include "googleurl/src/gurl.h"
34 #include "grit/chromium_strings.h" 34 #include "grit/chromium_strings.h"
35 #include "grit/generated_resources.h" 35 #include "grit/generated_resources.h"
36 #include "grit/locale_settings.h" 36 #include "grit/locale_settings.h"
37 #include "testing/gtest/include/gtest/gtest.h" 37 #include "testing/gtest/include/gtest/gtest.h"
38 #include "third_party/skia/include/core/SkBitmap.h" 38 #include "third_party/skia/include/core/SkBitmap.h"
39 #include "ui/base/l10n/l10n_util.h" 39 #include "ui/base/l10n/l10n_util.h"
40 #include "ui/gfx/codec/jpeg_codec.h" 40 #include "ui/gfx/codec/jpeg_codec.h"
41 41
42 using content::BrowserThread; 42 using content::BrowserThread;
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after
1231 profile()->GetPath().Append(chrome::kHistoryFilename))); 1231 profile()->GetPath().Append(chrome::kHistoryFilename)));
1232 ASSERT_NO_FATAL_FAILURE(ExecuteSQLScript( 1232 ASSERT_NO_FATAL_FAILURE(ExecuteSQLScript(
1233 data_path.AppendASCII("thumbnails.3.sql"), 1233 data_path.AppendASCII("thumbnails.3.sql"),
1234 profile()->GetPath().Append(chrome::kThumbnailsFilename))); 1234 profile()->GetPath().Append(chrome::kThumbnailsFilename)));
1235 1235
1236 // Create history and block until it's loaded. 1236 // Create history and block until it's loaded.
1237 profile()->CreateHistoryService(false, false); 1237 profile()->CreateHistoryService(false, false);
1238 profile()->BlockUntilHistoryProcessesPendingRequests(); 1238 profile()->BlockUntilHistoryProcessesPendingRequests();
1239 1239
1240 // Create top sites and unload history. 1240 // Create top sites and unload history.
1241 ui_test_utils::WindowedNotificationObserver observer( 1241 content::WindowedNotificationObserver observer(
1242 chrome::NOTIFICATION_TOP_SITES_LOADED, 1242 chrome::NOTIFICATION_TOP_SITES_LOADED,
1243 content::Source<Profile>(profile())); 1243 content::Source<Profile>(profile()));
1244 profile()->CreateTopSites(); 1244 profile()->CreateTopSites();
1245 HistoryServiceFactory::GetForProfile( 1245 HistoryServiceFactory::GetForProfile(
1246 profile(), Profile::EXPLICIT_ACCESS)->UnloadBackend(); 1246 profile(), Profile::EXPLICIT_ACCESS)->UnloadBackend();
1247 profile()->BlockUntilHistoryProcessesPendingRequests(); 1247 profile()->BlockUntilHistoryProcessesPendingRequests();
1248 observer.Wait(); 1248 observer.Wait();
1249 } 1249 }
1250 1250
1251 } // namespace history 1251 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/geolocation/geolocation_browsertest.cc ('k') | chrome/browser/infobars/infobars_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698