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

Unified Diff: content/public/android/javatests/src/org/chromium/content/browser/ChildProcessLauncherTest.java

Issue 2814533002: Adding a new annotation to set ChildProcessAllocator settings in tests. (Closed)
Patch Set: Introducing a new annotation to change child process allocator. Created 3 years, 8 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
Index: content/public/android/javatests/src/org/chromium/content/browser/ChildProcessLauncherTest.java
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/ChildProcessLauncherTest.java b/content/public/android/javatests/src/org/chromium/content/browser/ChildProcessLauncherTest.java
index 7e08d1ea0d8179ed27747d12859b198cd54960c9..d685c5a61cdf8e1d55b19b8aedf5857de6eae006 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/ChildProcessLauncherTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/ChildProcessLauncherTest.java
@@ -23,8 +23,8 @@ import org.chromium.base.library_loader.LibraryLoader;
import org.chromium.base.library_loader.LibraryProcessType;
import org.chromium.base.process_launcher.ChildProcessCreationParams;
import org.chromium.base.process_launcher.FileDescriptorInfo;
-import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.Feature;
+import org.chromium.content.browser.test.ChildProcessAllocatorSettings;
import org.chromium.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper;
import org.chromium.content.common.ContentSwitches;
@@ -57,7 +57,7 @@ public class ChildProcessLauncherTest extends InstrumentationTestCase {
*/
@MediumTest
@Feature({"ProcessManagement"})
- @CommandLineFlags.Add(ChildProcessLauncher.SWITCH_NUM_SANDBOXED_SERVICES_FOR_TESTING + "=4")
+ @ChildProcessAllocatorSettings(sandboxedServiceCount = 4)
public void testServiceFailedToBind() {
assertEquals(0, allocatedChromeSandboxedConnectionsCount());
assertEquals(0, ChildProcessLauncher.connectedServicesCountForTesting());
@@ -251,9 +251,8 @@ public class ChildProcessLauncherTest extends InstrumentationTestCase {
*/
@MediumTest
@Feature({"ProcessManagement"})
- @CommandLineFlags.Add({ChildProcessLauncher.SWITCH_NUM_SANDBOXED_SERVICES_FOR_TESTING + "=4",
- ChildProcessLauncher.SWITCH_SANDBOXED_SERVICES_NAME_FOR_TESTING + "="
- + DEFAULT_SANDBOXED_PROCESS_SERVICE})
+ @ChildProcessAllocatorSettings(
+ sandboxedServiceCount = 4, sandboxedServiceName = DEFAULT_SANDBOXED_PROCESS_SERVICE)
public void testServiceNumberAllocation() {
Context appContext = getInstrumentation().getTargetContext();
assertEquals(0, ChildProcessLauncher.allocatedSandboxedConnectionsCountForTesting(
@@ -286,9 +285,8 @@ public class ChildProcessLauncherTest extends InstrumentationTestCase {
*/
@MediumTest
@Feature({"ProcessManagement"})
- @CommandLineFlags.Add({ChildProcessLauncher.SWITCH_NUM_SANDBOXED_SERVICES_FOR_TESTING + "=1",
- ChildProcessLauncher.SWITCH_SANDBOXED_SERVICES_NAME_FOR_TESTING + "="
- + DEFAULT_SANDBOXED_PROCESS_SERVICE})
+ @ChildProcessAllocatorSettings(
+ sandboxedServiceCount = 1, sandboxedServiceName = DEFAULT_SANDBOXED_PROCESS_SERVICE)
public void testExceedMaximumConnectionNumber() {
Context appContext = getInstrumentation().getTargetContext();
assertEquals(0, ChildProcessLauncher.allocatedSandboxedConnectionsCountForTesting(

Powered by Google App Engine
This is Rietveld 408576698