OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.content.browser; | 5 package org.chromium.content.browser; |
6 | 6 |
7 import android.content.ComponentName; | 7 import android.content.ComponentName; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.content.Intent; | 9 import android.content.Intent; |
10 import android.content.ServiceConnection; | 10 import android.content.ServiceConnection; |
11 import android.os.Handler; | 11 import android.os.Handler; |
12 import android.os.IBinder; | 12 import android.os.IBinder; |
13 import android.os.Looper; | 13 import android.os.Looper; |
14 import android.os.Message; | 14 import android.os.Message; |
15 import android.os.Messenger; | 15 import android.os.Messenger; |
16 import android.os.RemoteException; | 16 import android.os.RemoteException; |
17 import android.support.test.filters.MediumTest; | 17 import android.support.test.filters.MediumTest; |
18 import android.test.InstrumentationTestCase; | 18 import android.test.InstrumentationTestCase; |
19 | 19 |
20 import org.chromium.base.BaseSwitches; | 20 import org.chromium.base.BaseSwitches; |
21 import org.chromium.base.library_loader.LibraryLoader; | 21 import org.chromium.base.library_loader.LibraryLoader; |
22 import org.chromium.base.library_loader.LibraryProcessType; | 22 import org.chromium.base.library_loader.LibraryProcessType; |
23 import org.chromium.base.process_launcher.ChildProcessCreationParams; | 23 import org.chromium.base.process_launcher.ChildProcessCreationParams; |
| 24 import org.chromium.base.process_launcher.FileDescriptorInfo; |
24 import org.chromium.base.test.util.CommandLineFlags; | 25 import org.chromium.base.test.util.CommandLineFlags; |
25 import org.chromium.base.test.util.Feature; | 26 import org.chromium.base.test.util.Feature; |
26 import org.chromium.content.browser.test.util.Criteria; | 27 import org.chromium.content.browser.test.util.Criteria; |
27 import org.chromium.content.browser.test.util.CriteriaHelper; | 28 import org.chromium.content.browser.test.util.CriteriaHelper; |
28 import org.chromium.content.common.ContentSwitches; | 29 import org.chromium.content.common.ContentSwitches; |
29 import org.chromium.content.common.FileDescriptorInfo; | |
30 import org.chromium.content_shell_apk.ChildProcessLauncherTestHelperService; | 30 import org.chromium.content_shell_apk.ChildProcessLauncherTestHelperService; |
31 | 31 |
32 import java.util.concurrent.Callable; | 32 import java.util.concurrent.Callable; |
33 | 33 |
34 /** | 34 /** |
35 * Instrumentation tests for ChildProcessLauncher. | 35 * Instrumentation tests for ChildProcessLauncher. |
36 */ | 36 */ |
37 public class ChildProcessLauncherTest extends InstrumentationTestCase { | 37 public class ChildProcessLauncherTest extends InstrumentationTestCase { |
38 // Pseudo command line arguments to instruct the child process to wait until
being killed. | 38 // Pseudo command line arguments to instruct the child process to wait until
being killed. |
39 // Allowing the process to continue would lead to a crash when attempting to
initialize IPC | 39 // Allowing the process to continue would lead to a crash when attempting to
initialize IPC |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 private ChildProcessCreationParams getDefaultChildProcessCreationParams(Stri
ng packageName) { | 534 private ChildProcessCreationParams getDefaultChildProcessCreationParams(Stri
ng packageName) { |
535 return new ChildProcessCreationParams(packageName, false /* isExternalSe
rvice */, | 535 return new ChildProcessCreationParams(packageName, false /* isExternalSe
rvice */, |
536 LibraryProcessType.PROCESS_CHILD); | 536 LibraryProcessType.PROCESS_CHILD); |
537 } | 537 } |
538 | 538 |
539 private void triggerConnectionSetup(ChildProcessConnectionImpl connection) { | 539 private void triggerConnectionSetup(ChildProcessConnectionImpl connection) { |
540 ChildProcessLauncher.triggerConnectionSetup(connection, sProcessWaitArgu
ments, 1, | 540 ChildProcessLauncher.triggerConnectionSetup(connection, sProcessWaitArgu
ments, 1, |
541 new FileDescriptorInfo[0], ChildProcessLauncher.CALLBACK_FOR_REN
DERER_PROCESS, 0); | 541 new FileDescriptorInfo[0], ChildProcessLauncher.CALLBACK_FOR_REN
DERER_PROCESS, 0); |
542 } | 542 } |
543 } | 543 } |
OLD | NEW |