Chromium Code Reviews| Index: android_webview/test/shell/src/org/chromium/android_webview/test/ServiceTestRunner.java |
| diff --git a/android_webview/test/shell/src/org/chromium/android_webview/test/ServiceTestRunner.java b/android_webview/test/shell/src/org/chromium/android_webview/test/ServiceTestRunner.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6cbe1838d60271002b10242334beb21bb5c70a90 |
| --- /dev/null |
| +++ b/android_webview/test/shell/src/org/chromium/android_webview/test/ServiceTestRunner.java |
| @@ -0,0 +1,30 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +package org.chromium.android_webview.test; |
| + |
| +import android.app.Service; |
| +import android.os.Messenger; |
| + |
| +import java.io.Serializable; |
| + |
| +/** |
| + * Class for running code in a separate Service. |
| + * This class is Serializable so that it can't be passed through IPC from a test process to a |
|
boliu
2016/09/15 04:57:53
"can't" or can?
gsennton
2016/09/15 10:02:04
Can :P
|
| + * service in a separate process. |
| + */ |
| +public abstract class ServiceTestRunner implements Serializable { |
|
boliu
2016/09/15 04:57:53
interface?
|
| + /** |
| + * Override this method to run code in a separate Service. |
| + * |
| + * OBS! Any child-classes of this class must be defined in the same apk where |
| + * SeparateProcessWebViewService is defined - otherwise the Service won't be able to initiate an |
| + * instance of that class. |
| + * |
| + * This method must send a message back to the test-code through the use of the Messenger |
| + * testMessenger - the test will block indefinitely waiting for a message. |
| + * service is a reference to the Service within which this code will be run. |
| + */ |
| + public abstract void runTestOnMainThread(Messenger testMessenger, Service service); |
| +} |