OLD | NEW |
(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 } |
OLD | NEW |