| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 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.test; | 5 package org.chromium.content.browser.test; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 | 8 |
| 9 import org.chromium.base.test.BaseTestResult.PreTestHook; | 9 import org.chromium.base.test.BaseTestResult.PreTestHook; |
| 10 import org.chromium.content.browser.ChildProcessLauncher; | 10 import org.chromium.content.browser.ChildConnectionAllocator; |
| 11 | 11 |
| 12 import java.lang.reflect.Method; | 12 import java.lang.reflect.Method; |
| 13 | 13 |
| 14 /** PreTestHook used to register the ChildProcessAllocatorSettings annotation. *
/ | 14 /** PreTestHook used to register the ChildProcessAllocatorSettings annotation. *
/ |
| 15 public final class ChildProcessAllocatorSettingsHook implements PreTestHook { | 15 public final class ChildProcessAllocatorSettingsHook implements PreTestHook { |
| 16 @Override | 16 @Override |
| 17 public void run(Context targetContext, Method testMethod) { | 17 public void run(Context targetContext, Method testMethod) { |
| 18 ChildProcessAllocatorSettings annotation = | 18 ChildProcessAllocatorSettings annotation = |
| 19 testMethod.getAnnotation(ChildProcessAllocatorSettings.class); | 19 testMethod.getAnnotation(ChildProcessAllocatorSettings.class); |
| 20 if (annotation != null) { | 20 if (annotation != null) { |
| 21 ChildProcessLauncher.setSanboxServicesSettingsForTesting( | 21 ChildConnectionAllocator.setSanboxServicesSettingsForTesting( |
| 22 annotation.sandboxedServiceCount(), annotation.sandboxedServ
iceName()); | 22 annotation.sandboxedServiceCount(), annotation.sandboxedServ
iceName()); |
| 23 } | 23 } |
| 24 } | 24 } |
| 25 } | 25 } |
| OLD | NEW |