Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for resetForTests (0.07 sec)

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

      }
    
      @Test
      fun testInit() {
        Platform.resetForTests()
    
        applyStrictMode()
    
        // Not currently safe
        // See https://github.com/square/okhttp/pull/8248
        OkHttpClient()
    
        assertThat(violations).hasSize(1)
        assertThat(violations[0].message).isEqualTo("newSSLContext")
      }
    
      @Test
      fun testNewCall() {
        Platform.resetForTests()
    
        val client = OkHttpClient()
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Thu May 22 14:39:30 UTC 2025
    - 2.1K bytes
    - Viewed (0)
  2. android-test/src/test/kotlin/okhttp/android/test/DisabledInitialiserTest.kt

    @RunWith(RobolectricTestRunner::class)
    @Config(
      sdk = [23, 26, 30, 33, 35],
    )
    class DisabledInitialiserTest {
      @Before
      fun setContext() {
        // Ensure we aren't succeeding because of another test
        Platform.resetForTests()
        PlatformRegistry.applicationContext = null
      }
    
      @Test
      fun testWithoutContext() {
        val httpUrl = "https://www.google.co.uk".toHttpUrl()
        assertFailure { httpUrl.topPrivateDomain() }.all {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 16:25:39 UTC 2025
    - 2.1K bytes
    - Viewed (0)
  3. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/platform/Platform.kt

        private val logger = Logger.getLogger(OkHttpClient::class.java.name)
    
        @JvmStatic
        fun get(): Platform = platform
    
        fun resetForTests(platform: Platform = findPlatform()) {
          this.platform = platform
          PublicSuffixDatabase.resetForTests()
        }
    
        fun alpnProtocolNames(protocols: List<Protocol>) = protocols.filter { it != Protocol.HTTP_1_0 }.map { it.toString() }
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jul 28 07:33:49 UTC 2025
    - 8.1K bytes
    - Viewed (0)
  4. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/publicsuffix/PublicSuffixDatabase.kt

                match = this.substring(mid, mid + publicSuffixLength).string(Charsets.UTF_8)
                break
              }
            }
          }
          return match
        }
    
        internal fun resetForTests() {
          instance = PublicSuffixDatabase(PublicSuffixList.Default)
        }
      }
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jul 28 07:33:49 UTC 2025
    - 8.5K bytes
    - Viewed (0)
Back to top