This repository has been archived by the owner on Jun 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[map] expose getter for the view used for rendering OpenGL on
- Loading branch information
Showing
3 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...SDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/maps/RenderViewGetterTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package com.mapbox.mapboxsdk.testapp.maps | ||
|
||
import android.opengl.GLSurfaceView | ||
import android.support.test.annotation.UiThreadTest | ||
import android.support.test.rule.ActivityTestRule | ||
import android.support.test.runner.AndroidJUnit4 | ||
import android.view.TextureView | ||
import android.view.ViewGroup | ||
import com.mapbox.mapboxsdk.AppCenter | ||
import com.mapbox.mapboxsdk.maps.MapView | ||
import com.mapbox.mapboxsdk.maps.MapboxMapOptions | ||
import com.mapbox.mapboxsdk.testapp.activity.FeatureOverviewActivity | ||
import java.util.concurrent.CountDownLatch | ||
import junit.framework.Assert.assertNotNull | ||
import junit.framework.Assert.assertTrue | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
@RunWith(AndroidJUnit4::class) | ||
class RenderViewGetterTest : AppCenter() { | ||
|
||
@Rule | ||
@JvmField | ||
var rule = ActivityTestRule(FeatureOverviewActivity::class.java) | ||
|
||
private lateinit var rootView: ViewGroup | ||
private lateinit var mapView: MapView | ||
private val latch: CountDownLatch = CountDownLatch(1) | ||
|
||
@Test | ||
@UiThreadTest | ||
fun testGLSurfaceView() { | ||
rootView = rule.activity.findViewById(android.R.id.content) | ||
mapView = MapView(rule.activity) | ||
assertNotNull(mapView.renderView) | ||
assertTrue(mapView.renderView is GLSurfaceView) | ||
} | ||
|
||
@Test | ||
@UiThreadTest | ||
fun testTextureView() { | ||
rootView = rule.activity.findViewById(android.R.id.content) | ||
mapView = MapView(rule.activity, | ||
MapboxMapOptions.createFromAttributes(rule.activity, null) | ||
.textureMode(true) | ||
) | ||
assertNotNull(mapView.renderView) | ||
assertTrue(mapView.renderView is TextureView) | ||
} | ||
} |