Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for bodyDelay (0.04 sec)

  1. mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/DeprecationBridge.kt

        SocketPolicy.RESET_STREAM_AT_START -> result.onRequestStart(CloseStream(http2ErrorCode))
      }
    
      result.throttleBody(throttleBytesPerPeriod, getThrottlePeriod(MILLISECONDS), MILLISECONDS)
      result.bodyDelay(getBodyDelay(MILLISECONDS), MILLISECONDS)
      result.headersDelay(getHeadersDelay(MILLISECONDS), MILLISECONDS)
      return result.build()
    }
    
    private fun PushPromise.wrap(): mockwebserver3.PushPromise =
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Thu Jul 03 13:16:34 UTC 2025
    - 4.1K bytes
    - Viewed (1)
  2. okhttp/src/jvmTest/kotlin/okhttp3/EventListenerTest.kt

      @Test
      fun successfulChunkedHttpsCallEventSequence() {
        enableTlsWithTunnel()
        server.protocols = Arrays.asList(Protocol.HTTP_1_1)
        server.enqueue(
          MockResponse
            .Builder()
            .bodyDelay(100, TimeUnit.MILLISECONDS)
            .chunkedBody("Hello!", 2)
            .build(),
        )
        assertSuccessfulEventOrder(anyResponse)
        assertBytesReadWritten(
          eventRecorder,
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Wed Nov 05 18:28:35 UTC 2025
    - 70.5K bytes
    - Viewed (0)
  3. okhttp-sse/src/test/java/okhttp3/sse/internal/EventSourceHttpTest.kt

        client =
          client
            .newBuilder()
            .callTimeout(250, TimeUnit.MILLISECONDS)
            .build()
        server.enqueue(
          MockResponse
            .Builder()
            .bodyDelay(500, TimeUnit.MILLISECONDS)
            .setHeader("content-type", "text/event-stream")
            .body("data: hey\n\n")
            .build(),
        )
        val source = newEventSource()
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Tue Nov 04 19:13:52 UTC 2025
    - 8.8K bytes
    - Viewed (0)
  4. okhttp/src/jvmTest/kotlin/okhttp3/internal/http2/HttpOverHttp2Test.kt

        dispatcher.enqueue(
          MockResponse
            .Builder()
            .bodyDelay(10, TimeUnit.SECONDS)
            .body("abc")
            .build(),
        )
        dispatcher.enqueue(
          MockResponse
            .Builder()
            .bodyDelay(10, TimeUnit.SECONDS)
            .body("def")
            .build(),
        )
        dispatcher.enqueue(
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Sat Nov 01 12:18:11 UTC 2025
    - 67.4K bytes
    - Viewed (0)
  5. okhttp/src/jvmTest/kotlin/okhttp3/TrailersTest.kt

        enableProtocol(protocol)
    
        server.enqueue(
          MockResponse
            .Builder()
            .trailers(headersOf("t1", "v2"))
            .bodyDelay(1, TimeUnit.SECONDS)
            .body(protocol, "Hello")
            .build(),
        )
    
        val call = client.newCall(Request(server.url("/")))
        call.execute().use { response ->
          response.close()
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Sat Nov 08 21:45:04 UTC 2025
    - 18.8K bytes
    - Viewed (0)
  6. okhttp/src/jvmTest/kotlin/okhttp3/DuplexTest.kt

      @Test
      fun bodyReadTimeoutDoesNotStartUntilLastRequestBodyByteFire() {
        enableProtocol(Protocol.HTTP_2)
        server.enqueue(
          MockResponse
            .Builder()
            .bodyDelay(1500, TimeUnit.MILLISECONDS)
            .body("this should never be received")
            .build(),
        )
        val request =
          Request
            .Builder()
            .url(server.url("/"))
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Tue Nov 04 19:13:52 UTC 2025
    - 25.8K bytes
    - Viewed (0)
  7. okhttp/src/jvmTest/kotlin/okhttp3/internal/ws/WebSocketHttpTest.kt

      @Test
      @Throws(InterruptedException::class)
      fun reconnectingToNonWebSocket() {
        for (i in 0..29) {
          webServer.enqueue(
            MockResponse
              .Builder()
              .bodyDelay(100, TimeUnit.MILLISECONDS)
              .body("Wrong endpoint")
              .code(401)
              .build(),
          )
        }
        val request =
          Request
            .Builder()
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Tue Nov 04 19:13:52 UTC 2025
    - 35.5K bytes
    - Viewed (0)
  8. okhttp/src/jvmTest/kotlin/okhttp3/KotlinSourceModernTest.kt

        throttleBytesPerPeriod = mockResponse.throttleBytesPerPeriod
        var throttlePeriod: Long = mockResponse.getThrottlePeriod(TimeUnit.SECONDS)
        mockResponse = mockResponse.setBodyDelay(0L, TimeUnit.SECONDS)
        val bodyDelay: Long = mockResponse.getBodyDelay(TimeUnit.SECONDS)
        mockResponse = mockResponse.setHeadersDelay(0L, TimeUnit.SECONDS)
        val headersDelay: Long = mockResponse.getHeadersDelay(TimeUnit.SECONDS)
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Wed Nov 05 18:28:35 UTC 2025
    - 47K bytes
    - Viewed (0)
  9. mockwebserver/src/test/java/mockwebserver3/MockWebServerTest.kt

      /** Delay the response body by sleeping 1s.  */
      @Test
      fun delayResponse() {
        assumeNotWindows()
        server.enqueue(
          MockResponse
            .Builder()
            .body("ABCDEF")
            .bodyDelay(1, TimeUnit.SECONDS)
            .build(),
        )
        val startNanos = System.nanoTime()
        val connection = server.url("/").toUrl().openConnection()
        val inputStream = connection!!.getInputStream()
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Sun Aug 03 22:38:00 UTC 2025
    - 28K bytes
    - Viewed (0)
Back to top