summaryrefslogtreecommitdiffstats
path: root/chrome/test/testing_profile.cc
diff options
context:
space:
mode:
authornkostylev@google.com <nkostylev@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-08 16:02:56 +0000
committernkostylev@google.com <nkostylev@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-08 16:02:56 +0000
commitd2879af4320bd17bd9082bf724f5222f6060f3d0 (patch)
treea3a9a853909b4bb332d22ab4db0e01ff5a6e28c0 /chrome/test/testing_profile.cc
parent1e6e3c99f8ca2ef9d8e86ddddec20dadc0fbf467 (diff)
downloadchromium_src-d2879af4320bd17bd9082bf724f5222f6060f3d0.zip
chromium_src-d2879af4320bd17bd9082bf724f5222f6060f3d0.tar.gz
chromium_src-d2879af4320bd17bd9082bf724f5222f6060f3d0.tar.bz2
Export bookmark favicon (base64 encoded png).
Code for importing icons from bookmarks HTML file is already in place. BUG=11362 TEST=Export bookmarks to HTML file, delete all existing bookmarks, import file. Review URL: http://codereview.chromium.org/543202 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38362 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/testing_profile.cc')
-rw-r--r--chrome/test/testing_profile.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/chrome/test/testing_profile.cc b/chrome/test/testing_profile.cc
index c6238c0..f412d90 100644
--- a/chrome/test/testing_profile.cc
+++ b/chrome/test/testing_profile.cc
@@ -12,6 +12,7 @@
#include "chrome/browser/net/url_request_context_getter.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/common/chrome_constants.h"
+#include "chrome/common/notification_service.h"
#include "net/url_request/url_request_context.h"
#include "webkit/database/database_tracker.h"
@@ -133,11 +134,22 @@ TestingProfile::TestingProfile(int count)
}
TestingProfile::~TestingProfile() {
+ NotificationService::current()->Notify(
+ NotificationType::PROFILE_DESTROYED,
+ Source<Profile>(this),
+ NotificationService::NoDetails());
DestroyHistoryService();
+ // FaviconService depends on HistoryServce so destroying it later.
+ DestroyFaviconService();
DestroyWebDataService();
file_util::Delete(path_, true);
}
+void TestingProfile::CreateFaviconService() {
+ favicon_service_ = NULL;
+ favicon_service_ = new FaviconService(this);
+}
+
void TestingProfile::CreateHistoryService(bool delete_file, bool no_db) {
if (history_service_.get())
history_service_->Cleanup();
@@ -153,6 +165,12 @@ void TestingProfile::CreateHistoryService(bool delete_file, bool no_db) {
history_service_->Init(GetPath(), bookmark_bar_model_.get(), no_db);
}
+void TestingProfile::DestroyFaviconService() {
+ if (!favicon_service_.get())
+ return;
+ favicon_service_ = NULL;
+}
+
void TestingProfile::DestroyHistoryService() {
if (!history_service_.get())
return;