diff options
author | Tobrun <tobrun.van.nuland@gmail.com> | 2016-11-09 12:56:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-09 12:56:49 +0100 |
commit | 33aa14c939cec4b732151b2f864ad84e41cbacd3 (patch) | |
tree | ea3917fa1b7924f935e444775c47b3577a29a870 /platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/espresso | |
parent | 2411ec83b12fd2457f6f22fe5a4de9122503a2e2 (diff) | |
download | qtlocation-mapboxgl-33aa14c939cec4b732151b2f864ad84e41cbacd3.tar.gz |
[android] - instrumentation tests upgrade, move view checking to utility class, remove inheritance in runtime style test (#6803)
update gitignore for generated tests
add camera move test
add realtime geojson to be excluded when generating Activity sanity tests
by default show workaround for showing a MapView in a dialog
add annotation tests
remove older camera tests, introduce tests for move, ease and animate, bring back setLatLng and getLatLng on MapView, add tests for internal camera API.
compass view tests
add tests for attribution and logo.
fix annotation tests
Rename Actiivity test class, split up annotation tests, added MarkerView tests, added infowindow tests, added MyLocationView tests
fix addRemoveLayer test by integrating map interactions inside a ViewAction
Diffstat (limited to 'platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/espresso')
-rw-r--r-- | platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/espresso/EspressoTestActivity.java | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/espresso/EspressoTestActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/espresso/EspressoTestActivity.java new file mode 100644 index 0000000000..5c6c4b7125 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/espresso/EspressoTestActivity.java @@ -0,0 +1,80 @@ +package com.mapbox.mapboxsdk.testapp.activity.espresso; + +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; + +import com.mapbox.mapboxsdk.maps.MapView; +import com.mapbox.mapboxsdk.maps.MapboxMap; +import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; +import com.mapbox.mapboxsdk.testapp.R; + +/** + * Base activity for instrumentation testing + */ +public class EspressoTestActivity extends AppCompatActivity implements OnMapReadyCallback { + + public MapView mapView; + protected MapboxMap mapboxMap; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_camera_test); + + //Initialize map as normal + mapView = (MapView) findViewById(R.id.mapView); + mapView.onCreate(savedInstanceState); + mapView.getMapAsync(this); + } + + @Override + public void onMapReady(MapboxMap map) { + mapboxMap = map; + } + + public MapboxMap getMapboxMap() { + return mapboxMap; + } + + @Override + public void onResume() { + super.onResume(); + mapView.onResume(); + } + + @Override + protected void onStart() { + super.onStart(); + mapView.onStart(); + } + + @Override + public void onPause() { + super.onPause(); + mapView.onPause(); + } + + @Override + protected void onStop() { + super.onStop(); + mapView.onStop(); + } + + @Override + protected void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + mapView.onSaveInstanceState(outState); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + mapView.onDestroy(); + } + + @Override + public void onLowMemory() { + super.onLowMemory(); + mapView.onLowMemory(); + } +} |