Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for topPrivateDomain (0.05 sec)

  1. android-test/src/test/kotlin/okhttp/android/test/BaseOkHttpClientUnitTest.kt

          assertThat(response.cacheResponse).isNotNull()
        }
      }
    
      @Test
      open fun testPublicSuffixDb() {
        val httpUrl = "https://www.google.co.uk".toHttpUrl()
        assertThat(httpUrl.topPrivateDomain()).isEqualTo("google.co.uk")
      }
    
      private fun assumeNetwork() {
        try {
          InetAddress.getByName("www.google.com")
        } catch (uhe: UnknownHostException) {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Tue Jul 22 20:03:31 UTC 2025
    - 2.3K bytes
    - Viewed (0)
  2. android-test-app/src/androidTest/kotlin/okhttp/android/testapp/PublicSuffixDatabaseTest.kt

     */
    class PublicSuffixDatabaseTest {
      @Test
      fun testTopLevelDomain() {
        assertThat("https://www.google.com/robots.txt".toHttpUrl().topPrivateDomain()).isEqualTo("google.com")
      }
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 1K bytes
    - Viewed (0)
  3. native-image-tests/src/test/kotlin/okhttp3/nativeimage/PublicSuffixDatabaseTest.kt

    import org.junit.jupiter.api.Test
    
    class PublicSuffixDatabaseTest {
      @Test
      fun testResourcesLoaded() {
        val url = "https://api.twitter.com".toHttpUrl()
    
        assertThat(url.topPrivateDomain()).isEqualTo("twitter.com")
      }
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Fri Jul 04 08:15:11 UTC 2025
    - 964 bytes
    - Viewed (0)
  4. android-test-app/src/main/kotlin/okhttp/android/testapp/MainActivity.kt

        val client = OkHttpClient()
    
        // Ensure we are compiling against the right variant
        println(AndroidPlatform.isSupported)
    
        val url = "https://github.com/square/okhttp".toHttpUrl()
        println(url.topPrivateDomain())
    
        client.newCall(Request(url)).enqueue(
          object : Callback {
            override fun onFailure(
              call: Call,
              e: IOException,
            ) {
              println("failed: $e")
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Tue Aug 19 08:10:39 UTC 2025
    - 1.7K bytes
    - Viewed (0)
  5. android-test/src/test/kotlin/okhttp/android/test/DisabledInitialiserTest.kt

        Platform.resetForTests()
        PlatformRegistry.applicationContext = null
      }
    
      @Test
      fun testWithoutContext() {
        val httpUrl = "https://www.google.co.uk".toHttpUrl()
        assertFailure { httpUrl.topPrivateDomain() }.all {
          hasMessage("Unable to load PublicSuffixDatabase.list resource.")
          cause().isNotNull().all {
            hasMessage(
              "Platform applicationContext not initialized. " +
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 16:25:39 UTC 2025
    - 2.1K bytes
    - Viewed (0)
Back to top