This source file includes following definitions.
- setUp
- Feature
- testStartStop
- Feature
- testStartUpgradeStop
package org.chromium.content.browser;
import android.app.Activity;
import android.test.InstrumentationTestCase;
import android.test.UiThreadTest;
import android.test.suitebuilder.annotation.SmallTest;
import org.chromium.base.test.util.Feature;
public class LocationProviderTest extends InstrumentationTestCase {
private Activity mActivity;
private LocationProviderAdapter mLocationProvider;
@Override
public void setUp() {
mActivity = new Activity();
mLocationProvider =
LocationProviderAdapter.create(getInstrumentation().getTargetContext());
}
@SmallTest
@UiThreadTest
@Feature({"Location"})
public void testStartStop() throws Exception {
mLocationProvider.start(false);
assertTrue("Should be running", mLocationProvider.isRunning());
mLocationProvider.stop();
assertFalse("Should have stopped", mLocationProvider.isRunning());
}
@SmallTest
@UiThreadTest
@Feature({"Location"})
public void testStartUpgradeStop() throws Exception {
mLocationProvider.start(false);
assertTrue("Should be running", mLocationProvider.isRunning());
mLocationProvider.start(true);
assertTrue("Should be running", mLocationProvider.isRunning());
mLocationProvider.stop();
assertFalse("Should have stopped", mLocationProvider.isRunning());
}
}