summaryrefslogtreecommitdiffstats
path: root/android_webview/test
diff options
context:
space:
mode:
authordgn <dgn@chromium.org>2015-11-10 07:33:50 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-10 15:34:41 +0000
commit738fa38d347a0f3f71a41c23cb4f03618e071d7c (patch)
tree7077acf341277cc5ea55f56e671b7f1cf102e4f0 /android_webview/test
parentaf229b2ae84edd77a6c5c40adf5e34c88805d630 (diff)
downloadchromium_src-738fa38d347a0f3f71a41c23cb4f03618e071d7c.zip
chromium_src-738fa38d347a0f3f71a41c23cb4f03618e071d7c.tar.gz
chromium_src-738fa38d347a0f3f71a41c23cb4f03618e071d7c.tar.bz2
Update webview and chrome instrumentation test to use PreTestHooks for policies
- Add utilities to set policies for tests using anotation and pre test hooks - Add AwInstrumentationTestRunner and update ChromeInstrumentationTestRunner to register said hooks - Add classes to simplify building policy bundles BUG=542859 Review URL: https://codereview.chromium.org/1387633002 Cr-Commit-Position: refs/heads/master@{#358829}
Diffstat (limited to 'android_webview/test')
-rw-r--r--android_webview/test/shell/DEPS1
-rw-r--r--android_webview/test/shell/src/org/chromium/android_webview/test/AwInstrumentationTestRunner.java22
2 files changed, 23 insertions, 0 deletions
diff --git a/android_webview/test/shell/DEPS b/android_webview/test/shell/DEPS
index 0d019e1..2a76d5b 100644
--- a/android_webview/test/shell/DEPS
+++ b/android_webview/test/shell/DEPS
@@ -1,3 +1,4 @@
include_rules = [
+ "+components/policy/android/javatests",
"+content/public/android/java",
]
diff --git a/android_webview/test/shell/src/org/chromium/android_webview/test/AwInstrumentationTestRunner.java b/android_webview/test/shell/src/org/chromium/android_webview/test/AwInstrumentationTestRunner.java
new file mode 100644
index 0000000..84f9ceb
--- /dev/null
+++ b/android_webview/test/shell/src/org/chromium/android_webview/test/AwInstrumentationTestRunner.java
@@ -0,0 +1,22 @@
+// Copyright 2015 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 org.chromium.base.test.BaseInstrumentationTestRunner;
+import org.chromium.base.test.BaseTestResult;
+import org.chromium.policy.test.annotations.Policies;
+
+/**
+ * Instrumentation test runner that allows integrating features defined above base layer
+ * for webview testing.
+ */
+public class AwInstrumentationTestRunner extends BaseInstrumentationTestRunner {
+ @Override
+ protected void addTestHooks(BaseTestResult result) {
+ super.addTestHooks(result);
+
+ result.addPreTestHook(Policies.getRegistrationHook());
+ }
+}