Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for applyStrictMode (0.05 sec)

  1. android-test/src/androidTest/java/okhttp/android/test/StrictModeTest.kt

      @Test
      fun testNewCall() {
        Platform.resetForTests()
    
        val client = OkHttpClient()
    
        applyStrictMode()
    
        // Safe on main
        client.newCall(Request("https://google.com/robots.txt".toHttpUrl()))
    
        assertThat(violations).isEmpty()
      }
    
      private fun applyStrictMode() {
        StrictMode.setThreadPolicy(
          ThreadPolicy
            .Builder()
            .detectCustomSlowCalls()
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Thu May 22 14:39:30 UTC 2025
    - 2.1K bytes
    - Viewed (0)
Back to top