summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authoratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-21 01:46:08 +0000
committeratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-21 01:46:08 +0000
commit398206ce0943c935a8da55d382e60e7be16099cf (patch)
treef45ab7ef6f6c101b142a7d5c1393c6455caf2e70 /chrome/test
parent0965c6d6d392916a4017bce6ddf5fef8d5bcd22a (diff)
downloadchromium_src-398206ce0943c935a8da55d382e60e7be16099cf.zip
chromium_src-398206ce0943c935a8da55d382e60e7be16099cf.tar.gz
chromium_src-398206ce0943c935a8da55d382e60e7be16099cf.tar.bz2
Added BackgroundContentsService to manage lifecycle of BackgroundContents.
If --restore-background-contents flag is passed, stores the URLs of running BackgroundContents in preferences so they can be re-launched when the browser restarts. Moved logic to shutdown background contents into BackgroundContentsService so we can use this to coordinate when to keep the browser process running. BUG=43382 TEST=new tests Review URL: http://codereview.chromium.org/2104018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50329 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/testing_browser_process.h11
-rw-r--r--chrome/test/testing_profile.h3
2 files changed, 12 insertions, 2 deletions
diff --git a/chrome/test/testing_browser_process.h b/chrome/test/testing_browser_process.h
index fdfe776..bf1744f 100644
--- a/chrome/test/testing_browser_process.h
+++ b/chrome/test/testing_browser_process.h
@@ -26,6 +26,7 @@ class TestingBrowserProcess : public BrowserProcess {
public:
TestingBrowserProcess()
: shutdown_event_(new base::WaitableEvent(true, false)),
+ module_ref_count_(0),
app_locale_("en") {
}
@@ -125,10 +126,15 @@ class TestingBrowserProcess : public BrowserProcess {
}
virtual unsigned int AddRefModule() {
- return 1;
+ return ++module_ref_count_;
}
virtual unsigned int ReleaseModule() {
- return 1;
+ DCHECK(module_ref_count_ > 0);
+ return --module_ref_count_;
+ }
+
+ unsigned int module_ref_count() {
+ return module_ref_count_;
}
virtual bool IsShuttingDown() {
@@ -165,6 +171,7 @@ class TestingBrowserProcess : public BrowserProcess {
private:
NotificationService notification_service_;
scoped_ptr<base::WaitableEvent> shutdown_event_;
+ unsigned int module_ref_count_;
scoped_ptr<Clipboard> clipboard_;
std::string app_locale_;
diff --git a/chrome/test/testing_profile.h b/chrome/test/testing_profile.h
index 50bd1fe..adc8d95 100644
--- a/chrome/test/testing_profile.h
+++ b/chrome/test/testing_profile.h
@@ -265,6 +265,9 @@ class TestingProfile : public Profile {
virtual DesktopNotificationService* GetDesktopNotificationService() {
return NULL;
}
+ virtual BackgroundContentsService* GetBackgroundContentsService() {
+ return NULL;
+ }
virtual FilePath last_selected_directory() {
return last_selected_directory_;
}