1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Copyright (c) 2013 Intel Corporation. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
6 package org.xwalk.test.util;
8 import android.app.Activity;
9 import android.content.Context;
10 import android.test.ActivityInstrumentationTestCase2;
12 import org.xwalk.app.runtime.XWalkRuntimeView;
13 import org.xwalk.app.XWalkRuntimeActivityBase;
14 import org.xwalk.test.util.XWalkRuntimeClientTestUtilBase.PageStatusCallback;
16 public class XWalkRuntimeClientTestGeneric<T extends XWalkRuntimeActivityBase>
17 extends ActivityInstrumentationTestCase2<T> {
18 private XWalkRuntimeView mRuntimeView;
19 XWalkRuntimeClientTestUtilBase mTestUtil;
22 protected void setUp() throws Exception {
25 final XWalkRuntimeActivityBase activity = getActivity();
26 getInstrumentation().runOnMainSync(new Runnable() {
29 if (mRuntimeView == null) {
30 mRuntimeView = activity.getRuntimeView();
32 mTestUtil = new XWalkRuntimeClientTestUtilBase(mRuntimeView,
33 getInstrumentation());
34 PageStatusCallback callback = mTestUtil.new PageStatusCallback();
35 mRuntimeView.setCallbackForTest((Object)callback);
41 public void postSetUp() {
44 public XWalkRuntimeClientTestGeneric(Class<T> activityClass) {
48 public XWalkRuntimeClientTestUtilBase getTestUtil() {