From edb7c860f97a0fadc7cda85b5a4581941a7f00bf Mon Sep 17 00:00:00 2001 From: "cmasone@google.com" <cmasone@google.com@0039d316-1c4b-4281-b951-d872f2087c98> Date: Wed, 7 Oct 2009 03:09:33 +0000 Subject: 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 --- chrome/test/ui/ui_test.cc | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'chrome/test') 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)); -- cgit v1.1