summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authorcmasone@google.com <cmasone@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-07 03:09:33 +0000
committercmasone@google.com <cmasone@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-07 03:09:33 +0000
commitedb7c860f97a0fadc7cda85b5a4581941a7f00bf (patch)
treea6100359380ee849545fad19bbe68db5972dbb21 /chrome/test
parent1f070f059c645668e6b0446b726f5a08613c20d0 (diff)
downloadchromium_src-edb7c860f97a0fadc7cda85b5a4581941a7f00bf.zip
chromium_src-edb7c860f97a0fadc7cda85b5a4581941a7f00bf.tar.gz
chromium_src-edb7c860f97a0fadc7cda85b5a4581941a7f00bf.tar.bz2
Adding a SIGTERM handler for OS_POSIX builds. This is needed so that Chrome can shut down gracefully when many posix-based system halt or reboot while Chrome is open.
SIGTERM may come in on any thread, so the handler creates a Task object that wraps up a call to BrowserList::CloseAllBrowsers(true) and Posts it to the message loop of the UI thread. Thus, we both get out of the signal handler quickly and can deal with the signal on any thread. BUG=23551 TEST=covered by BrowserTest.PosixSessionEnd Review URL: http://codereview.chromium.org/255036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28225 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/ui/ui_test.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index eac4367..30ed274 100644
--- a/chrome/test/ui/ui_test.cc
+++ b/chrome/test/ui/ui_test.cc
@@ -613,8 +613,6 @@ int UITest::GetBrowserProcessCount() {
return GetRunningChromeProcesses(data_dir).size();
}
-#if defined(OS_WIN)
-// TODO(port): Port GetRunningChromeProcesses and sort out one w/string issue.
static DictionaryValue* LoadDictionaryValueFromPath(const FilePath& path) {
if (path.empty())
return NULL;
@@ -634,13 +632,12 @@ DictionaryValue* UITest::GetLocalState() {
}
DictionaryValue* UITest::GetDefaultProfilePreferences() {
- std::wstring path;
- PathService::Get(chrome::DIR_USER_DATA, &path);
- file_util::AppendToPath(&path, chrome::kNotSignedInProfile);
- file_util::AppendToPath(&path, chrome::kPreferencesFilename);
- return LoadDictionaryValueFromPath(FilePath::FromWStringHack(path));
+ std::wstring path_wstring;
+ PathService::Get(chrome::DIR_USER_DATA, &path_wstring);
+ file_util::AppendToPath(&path_wstring, chrome::kNotSignedInProfile);
+ FilePath path(FilePath::FromWStringHack(path_wstring));
+ return LoadDictionaryValueFromPath(path.Append(chrome::kPreferencesFilename));
}
-#endif // OS_WIN
int UITest::GetTabCount() {
scoped_refptr<BrowserProxy> first_window(automation()->GetBrowserWindow(0));