mobile/android/base/tests/components/BaseComponent.java

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:5ee3e236d42c
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5 package org.mozilla.gecko.tests.components;
6
7 import org.mozilla.gecko.Actions;
8 import org.mozilla.gecko.tests.UITestContext;
9
10 import android.app.Activity;
11
12 import com.jayway.android.robotium.solo.Solo;
13
14 /**
15 * A base class for constructing components - an abstraction over small bits of Firefox
16 * functionality. For example, the Toolbar or the about:home screen could be considered a
17 * component. Components should not need to know about each others existences and should be
18 * combined via helpers. Helpers can also handle a series of actions taken on one component
19 * (e.g. clicking the toolbar, entering a url, and waiting for page load).
20 */
21 public abstract class BaseComponent {
22 protected final UITestContext mTestContext;
23 protected final Activity mActivity;
24 protected final Solo mSolo;
25 protected final Actions mActions;
26
27 public BaseComponent(final UITestContext testContext) {
28 mTestContext = testContext;
29 mActivity = mTestContext.getActivity();
30 mSolo = mTestContext.getSolo();
31 mActions = mTestContext.getActions();
32 }
33 }

mercurial