Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(540)

Unified Diff: content/browser/utility_process_host_impl_browsertest.cc

Issue 1893313003: [mojo] Use a pipe path to initialise Mojo in elevated utility processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/child_process_launcher.cc ('k') | content/child/child_thread_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f152367257fa0a2d7b4e08f7ee440b00b2735c00..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();
@@ -51,7 +55,14 @@ class UtilityProcessHostImplBrowserTest : public ContentBrowserTest {
};
IN_PROC_BROWSER_TEST_F(UtilityProcessHostImplBrowserTest, LaunchProcess) {
- RunUtilityProcess();
+ RunUtilityProcess(false);
}
+#if defined(OS_WIN)
+IN_PROC_BROWSER_TEST_F(UtilityProcessHostImplBrowserTest,
+ LaunchElevatedProcess) {
+ RunUtilityProcess(true);
+}
+#endif
+
} // namespace content
« no previous file with comments | « content/browser/child_process_launcher.cc ('k') | content/child/child_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698