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

Unified Diff: chrome/test/in_process_browser_test.cc

Issue 361002: Add support for getting the real process id from within the suid sandbox. The... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 1 month 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 | « chrome/common/sandbox_methods_linux.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/in_process_browser_test.cc
===================================================================
--- chrome/test/in_process_browser_test.cc (revision 30939)
+++ chrome/test/in_process_browser_test.cc (working copy)
@@ -34,6 +34,28 @@
#include "chrome/test/ui_test_utils.h"
#include "sandbox/src/dep.h"
+#if defined(OS_LINUX)
+#include "base/singleton.h"
+#include "chrome/browser/renderer_host/render_sandbox_host_linux.h"
+#include "chrome/browser/zygote_host_linux.h"
+
+namespace {
+
+// A helper class to do Linux-only initialization only once per process.
+class LinuxHostInit {
+ public:
+ LinuxHostInit() {
+ RenderSandboxHostLinux* shost = Singleton<RenderSandboxHostLinux>().get();
+ shost->Init("");
+ ZygoteHost* zhost = Singleton<ZygoteHost>().get();
+ zhost->Init("");
+ }
+ ~LinuxHostInit() {}
+};
+
+} // namespace
+#endif
+
extern int BrowserMain(const MainFunctionParams&);
const wchar_t kUnitTestShowWindows[] = L"show-windows";
@@ -225,6 +247,12 @@
ChromeThread::IO, FROM_HERE,
NewRunnableFunction(chrome_browser_net::SetUrlRequestMocksEnabled, true));
+#if defined(OS_LINUX)
+ // Initialize the RenderSandbox and Zygote hosts. Apparently they get used
+ // for InProcessBrowserTest, and this is not the normal browser startup path.
+ Singleton<LinuxHostInit>::get();
+#endif
+
browser_ = CreateBrowser(profile);
// Start the timeout timer to prevent hangs.
« no previous file with comments | « chrome/common/sandbox_methods_linux.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698