From 1429a095ca7e3c05baafd622e61417aed5247ab6 Mon Sep 17 00:00:00 2001 From: "jrt@chromium.org" Date: Mon, 27 Jun 2011 16:47:45 +0000 Subject: Chromium-branding bug fix and test re-enable. After revision 90141, the WorkerTest.TerminateQueuedWorkers failed on mac ui_tests. The test was disabled in revision 90152. Now the bug is resolved, the test is re-enabled and passes on mac ui_tests. BUG=87204 Review URL: http://codereview.chromium.org/7240014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90593 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/test/chrome_process_util.cc | 13 ++++++++++--- chrome/test/chrome_process_util.h | 5 ++++- content/worker/test/worker_uitest.cc | 5 ----- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/chrome/test/chrome_process_util.cc b/chrome/test/chrome_process_util.cc index 363ea95..ad54a8e 100644 --- a/chrome/test/chrome_process_util.cc +++ b/chrome/test/chrome_process_util.cc @@ -52,15 +52,22 @@ class ChildProcessFilter : public base::ProcessFilter { DISALLOW_COPY_AND_ASSIGN(ChildProcessFilter); }; -const FilePath::CharType* GetRunningExecutableName() { +const FilePath::CharType* GetRunningBrowserExecutableName() { const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); if (cmd_line->HasSwitch(switches::kEnableChromiumBranding)) return chrome::kBrowserProcessExecutableNameChromium; return chrome::kBrowserProcessExecutableName; } +const FilePath::CharType* GetRunningHelperExecutableName() { + const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + if (cmd_line->HasSwitch(switches::kEnableChromiumBranding)) + return chrome::kHelperProcessExecutableNameChromium; + return chrome::kHelperProcessExecutableName; +} + ChromeProcessList GetRunningChromeProcesses(base::ProcessId browser_pid) { - const FilePath::CharType* executable_name = GetRunningExecutableName(); + const FilePath::CharType* executable_name = GetRunningBrowserExecutableName(); ChromeProcessList result; if (browser_pid == static_cast(-1)) return result; @@ -89,7 +96,7 @@ ChromeProcessList GetRunningChromeProcesses(base::ProcessId browser_pid) { // name. We must collect them in a second pass. { ChildProcessFilter filter(browser_pid); - base::NamedProcessIterator it(executable_name, &filter); + base::NamedProcessIterator it(GetRunningHelperExecutableName(), &filter); while (const base::ProcessEntry* process_entry = it.NextProcessEntry()) result.push_back(process_entry->pid()); } diff --git a/chrome/test/chrome_process_util.h b/chrome/test/chrome_process_util.h index 88bd271..aabcb91 100644 --- a/chrome/test/chrome_process_util.h +++ b/chrome/test/chrome_process_util.h @@ -14,7 +14,10 @@ typedef std::vector ChromeProcessList; // Returns the executable name of the current Chrome browser process. -const FilePath::CharType* GetRunningExecutableName(); +const FilePath::CharType* GetRunningBrowserExecutableName(); + +// Returns the executable name of the current Chrome helper process. +const FilePath::CharType* GetRunningHelperExecutableName(); // Returns a vector of PIDs of all chrome processes (main and renderers etc) // based on |browser_pid|, the PID of the main browser process. diff --git a/content/worker/test/worker_uitest.cc b/content/worker/test/worker_uitest.cc index 5748ea6..d6b884e 100644 --- a/content/worker/test/worker_uitest.cc +++ b/content/worker/test/worker_uitest.cc @@ -190,11 +190,6 @@ TEST_F(WorkerTest, MultipleSharedWorkers) { #define TerminateQueuedWorkers FLAKY_TerminateQueuedWorkers #endif -#if defined(OS_MACOSX) -// http://crbug.com/87204 -#define TerminateQueuedWorkers DISABLED_TerminateQueuedWorkers -#endif - TEST_F(WorkerTest, TerminateQueuedWorkers) { ASSERT_TRUE(WaitForProcessCountToBe(1, 0)); RunTest(FilePath(FILE_PATH_LITERAL("terminate_queued_workers.html")), ""); -- cgit v1.1