Marc-Antoine Ruel <
mar...@chromium.org> writes:
> Most tests expect to be running in a normal user context, not a service
> context. IIRC, the service handler creates the process within a job object.
> Since Chrome uses job object extensively, this doesn't work well.
>
> The workaround used is to setup the bot to "auto login" and use "Start
> Menu\Programs\Startup" to start the bot. This is the only way to run
> interactive_ui_tests successfully.
Sorry, I only managed to get back to this a few days ago.
By service context, I'm assuming you mean session 0. That's the case I
mentioned in the end of my original message, when I said all tests time
out when it's used. However, session 0 is only used if I don't configure
the task to "only run when the user is logged in". If I do, the task is
run from the user context, and that's what I'm using.
I think the problem actually comes from this excerpt in
base/process/launch_win.cc that was added in ~2010:
if (options.job_handle) {
[...]
// If this code is run under a debugger, the launched process is
// automatically associated with a job object created by the debugger.
// The CREATE_BREAKAWAY_FROM_JOB flag is used to prevent this.
flags |= CREATE_BREAKAWAY_FROM_JOB;
}
Other bits that also set this flag
(sandbox/win/{tools/launcher/launcher.cc,src/target_process.cc}, for
example) already do that only if we're on older Windows releases, and
doing the same allows me to run content_browsertests and
interactive_ui_tests from the Task Scheduler.
I'll send a CL for review to get others to take a look at this as well.
The Windows user still needs to be set up to "auto login", but the other
half of the problem is solved.