|
1 | 1 | package io.sentry.uitest.android |
2 | 2 |
|
3 | | -import android.os.StrictMode |
4 | 3 | import androidx.lifecycle.Lifecycle |
5 | 4 | import androidx.test.core.app.launchActivity |
6 | 5 | import androidx.test.ext.junit.runners.AndroidJUnit4 |
@@ -254,54 +253,6 @@ class SdkInitTests : BaseUiTest() { |
254 | 253 | assertDefaultIntegrations() |
255 | 254 | } |
256 | 255 |
|
257 | | - @Test |
258 | | - fun initNotThrowStrictMode() { |
259 | | - StrictMode.setThreadPolicy(StrictMode.ThreadPolicy.Builder().detectAll().penaltyDeath().build()) |
260 | | - StrictMode.setVmPolicy( |
261 | | - StrictMode.VmPolicy.Builder() |
262 | | - .detectActivityLeaks() |
263 | | - // .detectCleartextNetwork() <- mockWebServer is on http, not https |
264 | | - .detectContentUriWithoutPermission() |
265 | | - .detectCredentialProtectedWhileLocked() |
266 | | - .detectFileUriExposure() |
267 | | - .detectImplicitDirectBoot() |
268 | | - .detectIncorrectContextUse() |
269 | | - .detectLeakedRegistrationObjects() |
270 | | - .detectLeakedSqlLiteObjects() |
271 | | - // .detectNonSdkApiUsage() <- thrown by leakCanary |
272 | | - // .detectUnsafeIntentLaunch() <- fails CI with java.lang.NoSuchMethodError |
273 | | - // .detectUntaggedSockets() <- thrown by mockWebServer |
274 | | - .penaltyDeath() |
275 | | - .build() |
276 | | - ) |
277 | | - initSentry(true) { it.tracesSampleRate = 1.0 } |
278 | | - val sampleScenario = launchActivity<EmptyActivity>() |
279 | | - relayIdlingResource.increment() |
280 | | - relayIdlingResource.increment() |
281 | | - Sentry.captureException(Exception("test")) |
282 | | - sampleScenario.moveToState(Lifecycle.State.DESTROYED) |
283 | | - |
284 | | - // Avoid interferences with other tests and assertion logic |
285 | | - StrictMode.setThreadPolicy(StrictMode.ThreadPolicy.LAX) |
286 | | - StrictMode.setVmPolicy(StrictMode.VmPolicy.LAX) |
287 | | - |
288 | | - relay.assert { |
289 | | - findEnvelope { |
290 | | - assertEnvelopeEvent(it.items.toList()).exceptions!!.any { it.value == "test" } |
291 | | - } |
292 | | - .assert { |
293 | | - it.assertEvent() |
294 | | - it.assertNoOtherItems() |
295 | | - } |
296 | | - findEnvelope { assertEnvelopeTransaction(it.items.toList()).transaction == "EmptyActivity" } |
297 | | - .assert { |
298 | | - it.assertTransaction() |
299 | | - it.assertNoOtherItems() |
300 | | - } |
301 | | - assertNoOtherEnvelopes() |
302 | | - } |
303 | | - } |
304 | | - |
305 | 256 | private fun assertDefaultIntegrations() { |
306 | 257 | val integrations = |
307 | 258 | mutableListOf( |
|
0 commit comments