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

Side by Side Diff: content/public/test/android/javatests/src/org/chromium/content/browser/test/ChildProcessAllocatorSettingsHook.java

Issue 2814533002: Adding a new annotation to set ChildProcessAllocator settings in tests. (Closed)
Patch Set: Clean-up 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.content.browser.test;
6
7 import android.content.Context;
8
9 import org.chromium.base.test.BaseTestResult.PreTestHook;
10 import org.chromium.content.browser.ChildProcessLauncher;
11
12 import java.lang.reflect.Method;
13
14 /** PreTestHook used to register the ChildProcessAllocatorSettings annotation. * /
15 public final class ChildProcessAllocatorSettingsHook implements PreTestHook {
16 @Override
17 public void run(Context targetContext, Method testMethod) {
18 ChildProcessAllocatorSettings annotation =
19 testMethod.getAnnotation(ChildProcessAllocatorSettings.class);
20 if (annotation != null) {
21 ChildProcessLauncher.setSanboxServicesSettingsForTesting(
22 annotation.sandboxedServiceCount(), annotation.sandboxedServ iceName());
23 }
24 }
25 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698