mobile/android/base/tests/UITestContext.java

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mobile/android/base/tests/UITestContext.java	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,50 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +package org.mozilla.gecko.tests;
     1.9 +
    1.10 +import org.mozilla.gecko.Actions;
    1.11 +import org.mozilla.gecko.Assert;
    1.12 +import org.mozilla.gecko.Driver;
    1.13 +import org.mozilla.gecko.tests.components.BaseComponent;
    1.14 +
    1.15 +import android.app.Activity;
    1.16 +import android.app.Instrumentation;
    1.17 +
    1.18 +import com.jayway.android.robotium.solo.Solo;
    1.19 +
    1.20 +/**
    1.21 + * Interface to the global information about a UITest environment.
    1.22 + */
    1.23 +public interface UITestContext {
    1.24 +
    1.25 +    public static enum ComponentType {
    1.26 +        ABOUTHOME,
    1.27 +        APPMENU,
    1.28 +        GECKOVIEW,
    1.29 +        TOOLBAR
    1.30 +    }
    1.31 +
    1.32 +    public Activity getActivity();
    1.33 +    public Solo getSolo();
    1.34 +    public Assert getAsserter();
    1.35 +    public Driver getDriver();
    1.36 +    public Actions getActions();
    1.37 +    public Instrumentation getInstrumentation();
    1.38 +
    1.39 +    public void dumpLog(final String logtag, final String message);
    1.40 +    public void dumpLog(final String logtag, final String message, final Throwable t);
    1.41 +
    1.42 +    /**
    1.43 +     * Returns the absolute version of the given URL using the host's hostname.
    1.44 +     */
    1.45 +    public String getAbsoluteHostnameUrl(final String url);
    1.46 +
    1.47 +    /**
    1.48 +     * Returns the absolute version of the given URL using the host's IP address.
    1.49 +     */
    1.50 +    public String getAbsoluteIpUrl(final String url);
    1.51 +
    1.52 +    public BaseComponent getComponent(final ComponentType type);
    1.53 +}

mercurial