SdchTest.java 文件源码

java
阅读 21 收藏 0 点赞 0 评论 0

项目:chromium-net-for-android 作者:
@SmallTest
@Feature({"Cronet"})
@OnlyRunNativeCronet
public void testDictionaryNotFound() throws Exception {
    setUp(Sdch.ENABLED, Api.ASYNC);
    // Make a request to /sdch/index which advertises a bad dictionary that
    // does not exist.
    TestUrlRequestCallback callback1 = startAndWaitForComplete(mTestFramework.mCronetEngine,
            NativeTestServer.getSdchURL() + "/sdch/index?q=NotFound");
    assertEquals(200, callback1.mResponseInfo.getHttpStatusCode());
    assertEquals("This is an index page.\n", callback1.mResponseAsString);
    assertEquals(Arrays.asList("/sdch/dict/NotFound"),
            callback1.mResponseInfo.getAllHeaders().get("Get-Dictionary"));

    // Make a request to fetch /sdch/test, and make sure Sdch encoding is not used.
    TestUrlRequestCallback callback2 = startAndWaitForComplete(
            mTestFramework.mCronetEngine, NativeTestServer.getSdchURL() + "/sdch/test");
    assertEquals(200, callback2.mResponseInfo.getHttpStatusCode());
    assertEquals("Sdch is not used.\n", callback2.mResponseAsString);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号