| Index: content/browser/utility_process_host_impl_browsertest.cc
|
| diff --git a/content/browser/utility_process_host_impl_browsertest.cc b/content/browser/utility_process_host_impl_browsertest.cc
|
| index 740070e8f7dcc22588912ba3d696af7b88b562a8..b8a496be6a50515b27418984714749cc2b0e74e0 100644
|
| --- a/content/browser/utility_process_host_impl_browsertest.cc
|
| +++ b/content/browser/utility_process_host_impl_browsertest.cc
|
| @@ -17,21 +17,25 @@ namespace content {
|
|
|
| class UtilityProcessHostImplBrowserTest : public ContentBrowserTest {
|
| public:
|
| - void RunUtilityProcess() {
|
| + void RunUtilityProcess(bool elevated) {
|
| base::RunLoop run_loop;
|
| done_closure_ = run_loop.QuitClosure();
|
| BrowserThread::PostTask(
|
| BrowserThread::IO, FROM_HERE,
|
| base::Bind(
|
| &UtilityProcessHostImplBrowserTest::RunUtilityProcessOnIOThread,
|
| - base::Unretained(this)));
|
| + base::Unretained(this), elevated));
|
| run_loop.Run();
|
| }
|
|
|
| protected:
|
| - void RunUtilityProcessOnIOThread() {
|
| + void RunUtilityProcessOnIOThread(bool elevated) {
|
| UtilityProcessHost* host = UtilityProcessHost::Create(nullptr, nullptr);
|
| host->SetName(base::ASCIIToUTF16("TestProcess"));
|
| +#if defined(OS_WIN)
|
| + if (elevated)
|
| + host->ElevatePrivileges();
|
| +#endif
|
| EXPECT_TRUE(host->Start());
|
|
|
| ServiceRegistry* service_registry = host->GetServiceRegistry();
|
| @@ -54,4 +58,11 @@ IN_PROC_BROWSER_TEST_F(UtilityProcessHostImplBrowserTest, LaunchProcess) {
|
| RunUtilityProcess(false);
|
| }
|
|
|
| +#if defined(OS_WIN)
|
| +IN_PROC_BROWSER_TEST_F(UtilityProcessHostImplBrowserTest,
|
| + LaunchElevatedProcess) {
|
| + RunUtilityProcess(true);
|
| +}
|
| +#endif
|
| +
|
| } // namespace content
|
|
|