/**
* Tests uploading from a channel in the case a redirect preserves the post
* body. Since channels can't be rewound, the request fails when we try to
* rewind it to send the second request.
*/
@SmallTest
@Feature({"Cronet"})
public void testUploadChannelWithRedirect() throws Exception {
TestHttpUrlRequestListener listener = new TestHttpUrlRequestListener();
HttpUrlRequest request = createRequest(
NativeTestServer.getRedirectToEchoBody(), listener);
setUploadChannel(request, "text/plain", UPLOAD_CHANNEL_DATA,
UPLOAD_CHANNEL_DATA.length());
request.start();
listener.blockForComplete();
assertEquals(0, listener.mHttpStatusCode);
assertEquals(
"System error: net::ERR_UPLOAD_STREAM_REWIND_NOT_SUPPORTED(-25)",
listener.mException.getMessage());
}
UploadTest.java 文件源码
java
阅读 23
收藏 0
点赞 0
评论 0
项目:chromium-net-for-android
作者:
评论列表
文章目录