Lines Matching refs:MockRead
137 void KeepAliveConnectionResendRequestTest(const MockRead& read_failure);
145 SimpleGetHelperResult SimpleGetHelper(MockRead data_reads[],
205 void ConnectStatusHelperWithExpectedStatus(const MockRead& status,
208 void ConnectStatusHelper(const MockRead& status);
343 MockRead data_reads[] = {
344 MockRead("HTTP/1.0 200 OK\r\n\r\n"),
345 MockRead("hello world"),
346 MockRead(false, OK),
357 MockRead data_reads[] = {
358 MockRead("hello world"),
359 MockRead(false, OK),
370 MockRead data_reads[] = {
371 MockRead("xxxHTTP/1.0 404 Not Found\nServer: blah\n\nDATA"),
372 MockRead(false, OK),
383 MockRead data_reads[] = {
384 MockRead("\n\nQJHTTP/1.0 404 Not Found\nServer: blah\n\nDATA"),
385 MockRead(false, OK),
396 MockRead data_reads[] = {
397 MockRead("xxxxxHTTP/1.1 404 Not Found\nServer: blah"),
398 MockRead(false, OK),
409 MockRead data_reads[] = {
410 MockRead("\n"),
411 MockRead("\n"),
412 MockRead("Q"),
413 MockRead("J"),
414 MockRead("HTTP/1.0 404 Not Found\nServer: blah\n\nDATA"),
415 MockRead(false, OK),
426 MockRead data_reads[] = {
427 MockRead("HTT"),
428 MockRead(false, OK),
441 MockRead data_reads[] = {
442 MockRead("HTTP/1.1 204 No Content\r\n\r\n"),
443 MockRead("junk"), // Should not be read!!
444 MockRead(false, OK),
456 MockRead data_reads[] = {
457 MockRead
458 MockRead("5\r\nHello\r\n"),
459 MockRead("1\r\n"),
460 MockRead(" \r\n"),
461 MockRead("5\r\nworld\r\n"),
462 MockRead("0\r\n\r\nHTTP/1.1 200 OK\r\n"),
463 MockRead(false, OK),
476 MockRead data_reads[] = {
477 MockRead("HTTP/1.1 200 OK\r\n"),
478 MockRead("Content-Length: 10\r\n"),
479 MockRead("Content-Length: 5\r\n\r\n"),
488 MockRead data_reads[] = {
489 MockRead("HTTP/1.1 200 OK\r\n"),
490 MockRead("Content-Length: 5\r\n"),
491 MockRead("Content-Length: 5\r\n\r\n"),
492 MockRead("Hello"),
505 MockRead data_reads[] = {
506 MockRead("HTTP/1.1 200 OK\r\n"),
507 MockRead("Content-Length: 5\r\n"),
508 MockRead("Content-Length: 5\r\n"),
509 MockRead("Content-Length: 5\r\n\r\n"),
510 MockRead("Hello"),
520 MockRead data_reads[] = {
521 MockRead("HTTP/1.0 200 OK\r\n"),
522 MockRead("Content-Length: 5\r\n"),
523 MockRead("Content-Length: 5\r\n"),
524 MockRead("Content-Length: 5\r\n\r\n"),
525 MockRead("Hello"),
535 MockRead data_reads[] = {
536 MockRead("HTTP/1.1 200 OK\r\n"),
537 MockRead("Content-Length: 10\r\n"),
538 MockRead("Content-Length: 10\r\n"),
539 MockRead("Content-Length: 5\r\n\r\n"),
549 MockRead data_reads[] = {
550 MockRead("HTTP/1.1 200 OK\r\n"),
551 MockRead("Content-Length: 666\r\n"),
552 MockRead("Content-Length: 1337\r\n"),
553 MockRead("Transfer-Encoding: chunked\r\n\r\n"),
554 MockRead("5\r\nHello\r\n"),
555 MockRead("1\r\n"),
556 MockRead(" \r\n"),
557 MockRead("5\r\nworld\r\n"),
558 MockRead("0\r\n\r\nHTTP/1.1 200 OK\r\n"),
559 MockRead(false, OK),
586 MockRead data_reads1[] = {
587 MockRead("HTTP/1.1 404 Not Found\r\n"),
588 MockRead("Server: Blah\r\n"),
589 MockRead("Content-Length: 1234\r\n\r\n"),
592 MockRead(false, ERR_UNEXPECTED), // Should not be reached.
634 MockRead data_reads[] = {
635 MockRead("HTTP/1.1 200 OK\r\nContent-Length: 5\r\n\r\n"),
636 MockRead("hello"),
637 MockRead("HTTP/1.1 200 OK\r\nContent-Length: 5\r\n\r\n"),
638 MockRead("world"),
639 MockRead(false, OK),
689 MockRead data_reads[] = {
690 MockRead("HTTP/1.0 100 Continue\r\n\r\n"),
691 MockRead("HTTP/1.0 200 OK\r\n\r\n"),
692 MockRead("hello world"),
693 MockRead(false, OK),
731 MockRead data_reads[] = {
732 MockRead("HTTP/1.1 102 Unspecified status code\r\n\r\n"
734 MockRead("hello world"),
735 MockRead(false, OK),
770 MockRead data_reads[] = {
771 MockRead(false, "HTTP/1.0 100 Continue\r\n"),
772 MockRead(true, 0),
801 MockRead data_reads[] = {
802 MockRead(true, 0),
819 const MockRead& read_failure) {
828 MockRead data1_reads[] = {
829 MockRead("HTTP/1.1 200 OK\r\nContent-Length: 5\r\n\r\n"),
830 MockRead("hello"),
836 MockRead data2_reads[] = {
837 MockRead("HTTP/1.1 200 OK\r\nContent-Length: 5\r\n\r\n"),
838 MockRead("world"),
839 MockRead(true, OK),
873 MockRead read_failure(true, ERR_CONNECTION_RESET);
878 MockRead read_failure(false, OK); // EOF
892 MockRead data_reads[] = {
893 MockRead(true, ERR_CONNECTION_RESET),
894 MockRead("HTTP/1.0 200 OK\r\n\r\n"), // Should not be used
895 MockRead("hello world"),
896 MockRead(false, OK),
923 MockRead data_reads[] = {
924 MockRead(false, OK), // EOF
925 MockRead("HTTP/1.0 200 OK\r\n\r\n"), // Should not be used
926 MockRead("hello world"),
927 MockRead(false, OK),
948 MockRead data1_reads[] = {
949 MockRead("HTTP/1.1 204 No Content\r\n\r\n"),
950 MockRead("HTTP/1.1 205 Reset Content\r\n\r\n"),
951 MockRead("HTTP/1.1 304 Not Modified\r\n\r\n"),
952 MockRead("HTTP/1.1 302 Found\r\n"
954 MockRead("HTTP/1.1 302 Found\r\n"
957 MockRead("HTTP/1.1 301 Moved Permanently\r\n"
959 MockRead("HTTP/1.1 301 Moved Permanently\r\n"
962 MockRead("HTTP/1.1 200 OK\r\nContent-Length: 5\r\n\r\n"),
963 MockRead("hello"),
968 MockRead data2_reads[] = {
969 MockRead(false, ERR_UNEXPECTED), // Should not be reached.
1047 MockRead data_reads1[] = {
1048 MockRead("HTTP/1.0 401 Unauthorized\r\n"),
1051 MockRead("WWW-Authenticate: Basic invalid\r\n"), // Malformed.
1052 MockRead("WWW-Authenticate: Basic realm=\"MyRealm1\"\r\n"),
1053 MockRead("WWW-Authenticate: UNSUPPORTED realm=\"FOO\"\r\n"),
1054 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
1056 MockRead("Content-Length: 10000\r\n\r\n"),
1057 MockRead(false, ERR_FAILED),
1070 MockRead data_reads2[] = {
1071 MockRead("HTTP/1.0 200 OK\r\n"),
1072 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
1073 MockRead("Content-Length: 100\r\n\r\n"),
1074 MockRead(false, OK),
1132 MockRead data_reads[] = {
1133 MockRead("HTTP/1.0 401 Unauthorized\r\n"),
1134 MockRead("WWW-Authenticate: Basic realm=\"MyRealm1\"\r\n"),
1135 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
1137 MockRead("Content-Length: 10000\r\n\r\n"),
1138 MockRead(false, ERR_FAILED),
1181 MockRead data_reads1[] = {
1182 MockRead("HTTP/1.1 401 Unauthorized\r\n"),
1183 MockRead("WWW-Authenticate: Basic realm=\"MyRealm1\"\r\n"),
1184 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
1185 MockRead("Content-Length: 14\r\n\r\n"),
1186 MockRead("Unauthorized\r\n"),
1189 MockRead("HTTP/1.1 200 OK\r\n"),
1190 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
1191 MockRead("Content-Length: 5\r\n\r\n"),
1192 MockRead("Hello"),
1197 MockRead data_reads2[] = {
1198 MockRead(false, ERR_FAILED),
1265 MockRead data_reads1[] = {
1266 MockRead("HTTP/1.1 401 Unauthorized\r\n"),
1267 MockRead("WWW-Authenticate: Basic realm=\"MyRealm1\"\r\n"),
1268 MockRead("Content-Length: 0\r\n\r\n"), // No response body.
1271 MockRead("HTTP/1.1 200 OK\r\n"),
1272 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
1273 MockRead("Content-Length: 5\r\n\r\n"),
1274 MockRead("hello"),
1278 MockRead data_reads2[] = {
1279 MockRead(false, ERR_FAILED),
1351 MockRead data_reads1[] = {
1352 MockRead("HTTP/1.1 401 Unauthorized\r\n"),
1353 MockRead("WWW-Authenticate: Basic realm=\"MyRealm1\"\r\n"),
1354 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
1356 MockRead("Content-Length: 5134\r\n\r\n"),
1357 MockRead(true, large_body_string.data(), large_body_string.size()),
1360 MockRead("HTTP/1.1 200 OK\r\n"),
1361 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
1362 MockRead("Content-Length: 5\r\n\r\n"),
1363 MockRead("hello"),
1367 MockRead data_reads2[] = {
1368 MockRead(false, ERR_FAILED),
1434 MockRead data_reads1[] = {
1435 MockRead("HTTP/1.1 401 Unauthorized\r\n"),
1436 MockRead("WWW-Authenticate: Basic realm=\"MyRealm1\"\r\n"),
1437 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
1438 MockRead("Content-Length: 14\r\n\r\n"),
1440 MockRead(false, ERR_TEST_PEER_CLOSE_AFTER_NEXT_MOCK_READ),
1441 MockRead("Unauthorized\r\n"),
1442 MockRead(false, OK), // The server closes the connection.
1455 MockRead data_reads2[] = {
1456 MockRead("HTTP/1.1 200 OK\r\n"),
1457 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
1458 MockRead("Content-Length: 5\r\n\r\n"),
1459 MockRead("hello"),
1537 MockRead data_reads1[] = {
1539 MockRead("HTTP/1.1 407 Proxy Authentication Required\r\n"),
1540 MockRead("Proxy-Authenticate: Basic realm=\"MyRealm1\"\r\n"),
1541 MockRead("Proxy-Connection: close\r\n\r\n"),
1543 MockRead("HTTP/1.1 200 Connection Established\r\n\r\n"),
1545 MockRead("HTTP/1.1 200 OK\r\n"),
1546 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
1547 MockRead("Content-Length: 5\r\n\r\n"),
1548 MockRead(false, "hello"),
1646 MockRead data_reads1[] = {
1648 MockRead("HTTP/1.1 407 Proxy Authentication Required\r\n"),
1649 MockRead("Proxy-Authenticate: Basic realm=\"MyRealm1\"\r\n"),
1650 MockRead("Content-Length: 10\r\n\r\n"),
1651 MockRead("0123456789"),
1654 MockRead("HTTP/1.1 407 Proxy Authentication Required\r\n"),
1655 MockRead("Proxy-Authenticate: Basic realm=\"MyRealm1\"\r\n"),
1656 MockRead("Content-Length: 10\r\n\r\n"),
1658 MockRead(false, ERR_UNEXPECTED), // Should not be reached.
1749 MockRead data_reads[] = {
1750 MockRead("HTTP/1.1 407 Proxy Authentication Required\r\n"),
1751 MockRead("Proxy-Authenticate: Basic realm=\"MyRealm1\"\r\n"),
1752 MockRead("Content-Length: 10\r\n\r\n"),
1753 MockRead(false, ERR_UNEXPECTED), // Should not be reached.
1803 MockRead data_reads1[] = {
1804 MockRead("HTTP/1.0 407 Proxy Auth required\r\n"),
1805 MockRead("Proxy-Authenticate: Basic realm=\"MyRealm1\"\r\n"),
1807 MockRead("Content-Length: 10000\r\n\r\n"),
1808 MockRead(false, ERR_FAILED),
1852 MockRead data_reads1[] = {
1853 MockRead("HTTP/1.1 200 Connection Established\r\n\r\n"),
1855 MockRead("HTTP/1.1 407 Unauthorized\r\n"),
1856 MockRead("Proxy-Authenticate: Basic realm=\"MyRealm1\"\r\n"),
1857 MockRead("\r\n"),
1858 MockRead(false, OK),
1906 MockRead data_reads1[] = {
1907 MockRead("HTTP/1.1 200 OK\r\n"),
1908 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
1909 MockRead("Content-Length: 100\r\n\r\n"),
1910 MockRead(false, OK),
1961 MockRead spdy_reads[] = {
1964 MockRead(true, 0, 0),
2047 MockRead spdy_reads[] = {
2052 MockRead(true, 0, 7),
2144 MockRead spdy_reads[] = {
2149 MockRead(true, 0, 7),
2217 MockRead spdy_reads[] = {
2221 MockRead(true, 0, 1),
2285 MockRead spdy_reads[] = {
2287 MockRead(true, 0, 4),
2350 MockRead data_reads1[] = {
2352 MockRead("HTTP/1.1 407 Proxy Authentication Required\r\n"),
2353 MockRead("Proxy-Authenticate: Basic realm=\"MyRealm1\"\r\n"),
2354 MockRead("Proxy-Connection: keep-alive\r\n"),
2355 MockRead("Content-Length: 0\r\n\r\n"),
2357 MockRead("HTTP/1.1 200 OK\r\n"),
2358 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
2359 MockRead("Content-Length: 100\r\n\r\n"),
2360 MockRead(false, OK),
2413 const MockRead& status, int expected_status) {
2431 MockRead data_reads[] = {
2433 MockRead("Content-Length: 10\r\n\r\n"),
2435 MockRead(false, ERR_UNEXPECTED), // Should not be reached.
2453 void HttpNetworkTransactionTest::ConnectStatusHelper(const MockRead& status) {
2459 ConnectStatusHelper(MockRead("HTTP/1.1 100 Continue\r\n"));
2463 ConnectStatusHelper(MockRead("HTTP/1.1 101 Switching Protocols\r\n"));
2467 ConnectStatusHelper(MockRead("HTTP/1.1 201 Created\r\n"));
2471 ConnectStatusHelper(MockRead("HTTP/1.1 202 Accepted\r\n"));
2476 MockRead("HTTP/1.1 203 Non-Authoritative Information\r\n"));
2480 ConnectStatusHelper(MockRead("HTTP/1.1 204 No Content\r\n"));
2484 ConnectStatusHelper(MockRead("HTTP/1.1 205 Reset Content\r\n"));
2488 ConnectStatusHelper(MockRead("HTTP/1.1 206 Partial Content\r\n"));
2492 ConnectStatusHelper(MockRead("HTTP/1.1 300 Multiple Choices\r\n"));
2496 ConnectStatusHelper(MockRead("HTTP/1.1 301 Moved Permanently\r\n"));
2500 ConnectStatusHelper(MockRead("HTTP/1.1 302 Found\r\n"));
2504 ConnectStatusHelper(MockRead("HTTP/1.1 303 See Other\r\n"));
2508 ConnectStatusHelper(MockRead("HTTP/1.1 304 Not Modified\r\n"));
2512 ConnectStatusHelper(MockRead("HTTP/1.1 305 Use Proxy\r\n"));
2516 ConnectStatusHelper(MockRead("HTTP/1.1 306\r\n"));
2520 ConnectStatusHelper(MockRead("HTTP/1.1 307 Temporary Redirect\r\n"));
2524 ConnectStatusHelper(MockRead("HTTP/1.1 400 Bad Request\r\n"));
2528 ConnectStatusHelper(MockRead("HTTP/1.1 401 Unauthorized\r\n"));
2532 ConnectStatusHelper(MockRead("HTTP/1.1 402 Payment Required\r\n"));
2536 ConnectStatusHelper(MockRead("HTTP/1.1 403 Forbidden\r\n"));
2540 ConnectStatusHelper(MockRead("HTTP/1.1 404 Not Found\r\n"));
2544 ConnectStatusHelper(MockRead("HTTP/1.1 405 Method Not Allowed\r\n"));
2548 ConnectStatusHelper(MockRead("HTTP/1.1 406 Not Acceptable\r\n"));
2553 MockRead("HTTP/1.1 407 Proxy Authentication Required\r\n"),
2558 ConnectStatusHelper(MockRead("HTTP/1.1 408 Request Timeout\r\n"));
2562 ConnectStatusHelper(MockRead("HTTP/1.1 409 Conflict\r\n"));
2566 ConnectStatusHelper(MockRead("HTTP/1.1 410 Gone\r\n"));
2570 ConnectStatusHelper(MockRead("HTTP/1.1 411 Length Required\r\n"));
2574 ConnectStatusHelper(MockRead("HTTP/1.1 412 Precondition Failed\r\n"));
2578 ConnectStatusHelper(MockRead("HTTP/1.1 413 Request Entity Too Large\r\n"));
2582 ConnectStatusHelper(MockRead("HTTP/1.1 414 Request-URI Too Long\r\n"));
2586 ConnectStatusHelper(MockRead("HTTP/1.1 415 Unsupported Media Type\r\n"));
2591 MockRead("HTTP/1.1 416 Requested Range Not Satisfiable\r\n"));
2595 ConnectStatusHelper(MockRead("HTTP/1.1 417 Expectation Failed\r\n"));
2599 ConnectStatusHelper(MockRead("HTTP/1.1 500 Internal Server Error\r\n"));
2603 ConnectStatusHelper(MockRead("HTTP/1.1 501 Not Implemented\r\n"));
2607 ConnectStatusHelper(MockRead("HTTP/1.1 502 Bad Gateway\r\n"));
2611 ConnectStatusHelper(MockRead("HTTP/1.1 503 Service Unavailable\r\n"));
2615 ConnectStatusHelper(MockRead("HTTP/1.1 504 Gateway Timeout\r\n"));
2619 ConnectStatusHelper(MockRead("HTTP/1.1 505 HTTP Version Not Supported\r\n"));
2643 MockRead data_reads1[] = {
2644 MockRead("HTTP/1.0 407 Unauthorized\r\n"),
2647 MockRead("Proxy-Authenticate: Basic invalid\r\n"), // Malformed.
2648 MockRead("Proxy-Authenticate: Basic realm=\"MyRealm1\"\r\n"),
2649 MockRead("Proxy-Authenticate: UNSUPPORTED realm=\"FOO\"\r\n"),
2650 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
2652 MockRead("Content-Length: 10000\r\n\r\n"),
2653 MockRead(false, ERR_FAILED),
2668 MockRead data_reads2[] = {
2669 MockRead("HTTP/1.0 401 Unauthorized\r\n"),
2672 MockRead("WWW-Authenticate: Basic realm=\"MyRealm1\"\r\n"),
2673 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
2674 MockRead("Content-Length: 2000\r\n\r\n"),
2675 MockRead(false, ERR_FAILED), // Won't be reached.
2689 MockRead data_reads3[] = {
2690 MockRead("HTTP/1.0 200 OK\r\n"),
2691 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
2692 MockRead("Content-Length: 100\r\n\r\n"),
2693 MockRead(false, OK),
2779 MockRead data_reads1[] = {
2780 MockRead("HTTP/1.1 401 Access Denied\r\n"),
2784 MockRead("WWW-Authenticate: NTLM\r\n"),
2785 MockRead("Connection: close\r\n"),
2786 MockRead("Content-Length: 42\r\n"),
2787 MockRead("Content-Type: text/html\r\n\r\n"),
2789 MockRead(false, ERR_UNEXPECTED),
2815 MockRead data_reads2[] = {
2817 MockRead("HTTP/1.1 401 Access Denied\r\n"),
2818 MockRead("WWW-Authenticate: NTLM "
2826 MockRead("Content-Length: 42\r\n"),
2827 MockRead("Content-Type: text/html\r\n\r\n"),
2828 MockRead("You are not authorized to view this page\r\n"),
2831 MockRead("HTTP/1.1 200 OK\r\n"),
2832 MockRead("Content-Type: text/html; charset=utf-8\r\n"),
2833 MockRead("Content-Length: 13\r\n\r\n"),
2834 MockRead("Please Login\r\n"),
2835 MockRead(false, OK),
2915 MockRead data_reads1[] = {
2916 MockRead("HTTP/1.1 401 Access Denied\r\n"),
2920 MockRead("WWW-Authenticate: NTLM\r\n"),
2921 MockRead("Connection: close\r\n"),
2922 MockRead("Content-Length: 42\r\n"),
2923 MockRead("Content-Type: text/html\r\n\r\n"),
2925 MockRead(false, ERR_UNEXPECTED),
2951 MockRead data_reads2[] = {
2953 MockRead("HTTP/1.1 401 Access Denied\r\n"),
2954 MockRead("WWW-Authenticate: NTLM "
2962 MockRead("Content-Length: 42\r\n"),
2963 MockRead("Content-Type: text/html\r\n\r\n"),
2964 MockRead("You are not authorized to view this page\r\n"),
2967 MockRead("HTTP/1.1 401 Access Denied\r\n"),
2968 MockRead("WWW-Authenticate: NTLM\r\n"),
2969 MockRead("Connection: close\r\n"),
2970 MockRead("Content-Length: 42\r\n"),
2971 MockRead("Content-Type: text/html\r\n\r\n"),
2973 MockRead(false, ERR_UNEXPECTED),
2999 MockRead data_reads3[] = {
3001 MockRead("HTTP/1.1 401 Access Denied\r\n"),
3002 MockRead("WWW-Authenticate: NTLM "
3010 MockRead("Content-Length: 42\r\n"),
3011 MockRead("Content-Type: text/html\r\n\r\n"),
3012 MockRead("You are not authorized to view this page\r\n"),
3015 MockRead("HTTP/1.1 200 OK\r\n"),
3016 MockRead("Content-Type: text/html; charset=utf-8\r\n"),
3017 MockRead("Content-Length: 13\r\n\r\n"),
3018 MockRead("Please Login\r\n"),
3019 MockRead(false, OK),
3124 MockRead data_reads[] = {
3125 MockRead("HTTP/1.0 200 OK\r\n"),
3126 MockRead(true, large_headers_string.data(), large_headers_string.size()),
3127 MockRead("\r\nBODY"),
3128 MockRead(false, OK),
3171 MockRead data_reads1[] = {
3172 MockRead("HTTP/1.1 404 Not Found\r\n"),
3173 MockRead("Content-Length: 10\r\n\r\n"),
3174 MockRead(false, ERR_UNEXPECTED), // Should not be reached.
3217 MockRead data_reads[] = {
3219 MockRead("HTTP/1.1 200 OK\r\nContent-Length: 11\r\n\r\nhel"),
3221 MockRead("lo"),
3222 MockRead(" world"),
3223 MockRead("junk"), // Should not be read!!
3224 MockRead(false, OK),
3275 MockRead data_reads[] = {
3276 MockRead("HTTP/1.1 200 OK\r\n"),
3277 MockRead("Content-Length: 11\r\n\r\n"),
3278 MockRead("hello world"),
3279 MockRead(false, OK),
3337 MockRead data_reads[] = {
3338 MockRead("HTTP/1.1 200 OK\r\n"),
3339 MockRead("Content-Length: 11\r\n\r\n"),
3340 MockRead(false, ERR_TEST_PEER_CLOSE_AFTER_NEXT_MOCK_READ),
3341 MockRead("hello world"),
3342 MockRead(true, 0, 0) // EOF
3430 MockRead data_reads[] = {
3431 MockRead("HTTP/1.1 204 No Content\r\n"
3434 MockRead("junk"), // Should not be read!!
3435 MockRead(false, OK),
3495 MockRead data_reads1[] = {
3496 MockRead("HTTP/1.1 200 OK\r\nContent-Length: 11\r\n\r\n"),
3497 MockRead("hello world"),
3498 MockRead(false, OK),
3513 MockRead data_reads2[] = {
3514 MockRead("HTTP/1.1 200 OK\r\nContent-Length: 7\r\n\r\n"),
3515 MockRead("welcome"),
3516 MockRead(false, OK),
3583 MockRead data_reads1[] = {
3584 MockRead("HTTP/1.0 401 Unauthorized\r\n"),
3585 MockRead("WWW-Authenticate: Basic realm=\"MyRealm1\"\r\n"),
3586 MockRead("Content-Length: 10\r\n\r\n"),
3587 MockRead(false, ERR_FAILED),
3599 MockRead data_reads2[] = {
3600 MockRead("HTTP/1.0 200 OK\r\n"),
3601 MockRead("Content-Length: 100\r\n\r\n"),
3602 MockRead(false, OK),
3662 MockRead data_reads1[] = {
3663 MockRead("HTTP/1.0 401 Unauthorized\r\n"),
3664 MockRead("WWW-Authenticate: Basic realm=\"MyRealm1\"\r\n"),
3665 MockRead("Content-Length: 10\r\n\r\n"),
3666 MockRead(false, ERR_FAILED),
3678 MockRead data_reads2[] = {
3679 MockRead("HTTP/1.0 401 Unauthorized\r\n"),
3680 MockRead("WWW-Authenticate: Basic realm=\"MyRealm1\"\r\n"),
3681 MockRead("Content-Length: 10\r\n\r\n"),
3682 MockRead(false, ERR_FAILED),
3694 MockRead data_reads3[] = {
3695 MockRead("HTTP/1.0 200 OK\r\n"),
3696 MockRead("Content-Length: 100\r\n\r\n"),
3697 MockRead(false, OK),
3774 MockRead data_reads1[] = {
3775 MockRead("HTTP/1.0 401 Unauthorized\r\n"),
3776 MockRead("WWW-Authenticate: Basic realm=\"MyRealm1\"\r\n"),
3777 MockRead("Content-Length: 10000\r\n\r\n"),
3778 MockRead(false, ERR_FAILED),
3790 MockRead data_reads2[] = {
3791 MockRead("HTTP/1.0 200 OK\r\n"),
3792 MockRead("Content-Length: 100\r\n\r\n"),
3793 MockRead(false, OK),
3859 MockRead data_reads1[] = {
3860 MockRead("HTTP/1.0 401 Unauthorized\r\n"),
3861 MockRead("WWW-Authenticate: Basic realm=\"MyRealm2\"\r\n"),
3862 MockRead("Content-Length: 10000\r\n\r\n"),
3863 MockRead(false, ERR_FAILED),
3875 MockRead data_reads2[] = {
3876 MockRead("HTTP/1.0 200 OK\r\n"),
3877 MockRead("Content-Length: 100\r\n\r\n"),
3878 MockRead(false, OK),
3943 MockRead data_reads1[] = {
3944 MockRead("HTTP/1.0 200 OK\r\n"),
3945 MockRead("Content-Length: 100\r\n\r\n"),
3946 MockRead(false, OK),
3986 MockRead data_reads1[] = {
3987 MockRead("HTTP/1.0 401 Unauthorized\r\n"),
3988 MockRead("WWW-Authenticate: Basic realm=\"MyRealm1\"\r\n"),
3989 MockRead("Content-Length: 10000\r\n\r\n"),
3990 MockRead(false, ERR_FAILED),
4002 MockRead data_reads2[] = {
4003 MockRead("HTTP/1.0 200 OK\r\n"),
4004 MockRead("Content-Length: 100\r\n\r\n"),
4005 MockRead(false, OK),
4055 MockRead data_reads1[] = {
4056 MockRead("HTTP/1.0 401 Unauthorized\r\n"),
4057 MockRead("WWW-Authenticate: Basic realm=\"MyRealm1\"\r\n"),
4058 MockRead("Content-Length: 10000\r\n\r\n"),
4059 MockRead(false, ERR_FAILED),
4071 MockRead
4072 MockRead("HTTP/1.0 401 Unauthorized\r\n"),
4073 MockRead("WWW-Authenticate: Basic realm=\"MyRealm1\"\r\n"),
4074 MockRead("Content-Length: 10000\r\n\r\n"),
4075 MockRead(false, ERR_FAILED),
4088 MockRead data_reads3[] = {
4089 MockRead("HTTP/1.0 200 OK\r\n"),
4090 MockRead("Content-Length: 100\r\n\r\n"),
4091 MockRead(false, OK),
4173 MockRead data_reads1[] = {
4174 MockRead("HTTP/1.0 401 Unauthorized\r\n"),
4175 MockRead("WWW-Authenticate: Digest realm=\"digestive\", nonce=\"OU812\", "
4177 MockRead(false, OK),
4192 MockRead data_reads2[] = {
4193 MockRead("HTTP/1.0 200 OK\r\n"),
4194 MockRead(false, OK),
4262 MockRead data_reads1[] = {
4263 MockRead("HTTP/1.0 200 OK\r\n"),
4264 MockRead("Content-Length: 100\r\n\r\n"),
4265 MockRead(false, OK),
4346 MockRead data_reads[] = {
4347 MockRead("HTTP/1.0 200 OK\r\n"),
4348 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
4349 MockRead("Content-Length: 100\r\n\r\n"),
4350 MockRead(false, OK),
4400 MockRead proxy_reads[] = {
4401 MockRead("HTTP/1.0 200 Connected\r\n\r\n"),
4402 MockRead(false, OK)
4414 MockRead data_reads[] = {
4415 MockRead("HTTP/1.0 200 Connected\r\n\r\n"),
4416 MockRead("HTTP/1.0 200 OK\r\n"),
4417 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
4418 MockRead("Content-Length: 100\r\n\r\n"),
4419 MockRead(false, OK),
4481 MockRead data_reads[] = {
4482 MockRead("HTTP/1.0 200 Connected\r\n\r\n"),
4483 MockRead("HTTP/1.1 200 OK\r\n"),
4484 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
4485 MockRead("Content-Length: 100\r\n\r\n"),
4486 MockRead(false, OK),
4534 MockRead data_reads[] = {
4535 MockRead("HTTP/1.1 302 Redirect\r\n"),
4536 MockRead("Location: http://login.example.com/\r\n"),
4537 MockRead("Content-Length: 0\r\n\r\n"),
4538 MockRead(false, OK),
4591 MockRead data_reads[] = {
4593 MockRead(true, 0, 2), // EOF
4645 MockRead data_reads[] = {
4646 MockRead("HTTP/1.1 404 Not Found\r\n"),
4647 MockRead("Content-Length: 23\r\n\r\n"),
4648 MockRead("The host does not exist"),
4649 MockRead(false, OK),
4709 MockRead data_reads[] = {
4712 MockRead(true, 0, 3), // EOF
4767 MockRead bad_cert_reads[] = {
4768 MockRead("HTTP/1.0 200 Connected\r\n\r\n"),
4769 MockRead(false, OK)
4782 MockRead good_cert_reads[] = {
4783 MockRead("HTTP/1.0 200 Connected\r\n\r\n"),
4784 MockRead("HTTP/1.0 200 OK\r\n"),
4785 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
4786 MockRead("Content-Length: 100\r\n\r\n"),
4787 MockRead(false, OK),
4850 MockRead data_reads[] = {
4851 MockRead("HTTP/1.0 200 OK\r\n"),
4852 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
4853 MockRead("Content-Length: 100\r\n\r\n"),
4854 MockRead(false, OK),
4887 MockRead data_reads[] = {
4890 MockRead("HTTP/1.1 407 Proxy Authentication Required\r\n"),
4891 MockRead("Proxy-Authenticate: Basic realm=\"MyRealm1\"\r\n"),
4892 MockRead("Proxy-Connection: close\r\n\r\n"),
4927 MockRead data_reads[] = {
4928 MockRead("HTTP/1.0 200 OK\r\n"),
4929 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
4930 MockRead("Content-Length: 100\r\n\r\n"),
4931 MockRead(false, OK),
4964 MockRead data_reads[] = {
4965 MockRead("HTTP/1.0 200 OK\r\n"),
4966 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
4967 MockRead("Content-Length: 100\r\n\r\n"),
4968 MockRead(false, OK),
5001 MockRead data_reads[] = {
5002 MockRead("HTTP/1.0 200 OK\r\n"),
5003 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
5004 MockRead("Content-Length: 100\r\n\r\n"),
5005 MockRead(false, OK),
5038 MockRead data_reads[] = {
5039 MockRead("HTTP/1.0 200 OK\r\n"),
5040 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
5041 MockRead("Content-Length: 100\r\n\r\n"),
5042 MockRead(false, OK),
5077 MockRead data_reads[] = {
5078 MockRead("HTTP/1.0 200 OK\r\n"),
5079 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
5080 MockRead("Content-Length: 100\r\n\r\n"),
5081 MockRead(false, OK),
5116 MockRead data_reads[] = {
5117 MockRead("HTTP/1.0 200 OK\r\n"),
5118 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
5119 MockRead("Content-Length: 100\r\n\r\n"),
5120 MockRead(false, OK),
5154 MockRead data_reads[] = {
5155 MockRead("HTTP/1.0 200 OK\r\n"),
5156 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
5157 MockRead("Content-Length: 100\r\n\r\n"),
5158 MockRead(false, OK),
5195 MockRead data_reads[] = {
5196 MockRead("HTTP/1.0 200 OK\r\n"),
5197 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
5198 MockRead("Content-Length: 100\r\n\r\n"),
5199 MockRead(false, OK),
5237 MockRead data_reads[] = {
5238 MockRead(true, read_buffer, arraysize(read_buffer)),
5239 MockRead("HTTP/1.0 200 OK\r\n"),
5240 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n\r\n"),
5241 MockRead("Payload"),
5242 MockRead(false, OK)
5289 MockRead data_reads[] = {
5292 MockRead("HTTP/1.0 200 OK\r\n"),
5293 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n\r\n"),
5294 MockRead("Payload"),
5295 MockRead(false, OK)
5357 MockRead data_reads[] = {
5360 MockRead("HTTP/1.0 200 OK\r\n"),
5361 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n\r\n"),
5362 MockRead("Payload"),
5363 MockRead(false, OK)
5424 MockRead data_reads[] = {
5427 MockRead("HTTP/1.0 200 OK\r\n"),
5428 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n\r\n"),
5429 MockRead("Payload"),
5430 MockRead(false, OK)
5771 MockRead data_reads[] = {
5772 MockRead(false, ERR_FAILED),
5828 MockRead data_reads[] = { MockRead(false, ERR_UNEXPECTED) };
5896 MockRead data_reads[] = {
5897 MockRead("HTTP/1."),
5898 MockRead(false, OK),
5944 MockRead data_reads1[] = {
5945 MockRead("HTTP/1.1 401 Unauthorized\r\n"),
5946 MockRead("WWW-Authenticate: Basic realm=\"MyRealm1\"\r\n"),
5947 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
5948 MockRead("Content-Length: 14\r\n\r\n"),
5949 MockRead("Unauth"),
5950 MockRead(true, ERR_CONNECTION_RESET),
5967 MockRead data_reads2[] = {
5968 MockRead("HTTP/1.1 200 OK\r\n"),
5969 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
5970 MockRead("Content-Length: 100\r\n\r\n"),
5971 MockRead(false, OK),
6021 MockRead proxy_reads[] = {
6022 MockRead("HTTP/1.0 200 Connected\r\n\r\nExtra data"),
6023 MockRead(false, OK)
6056 MockRead data_reads[] = {
6057 MockRead("HTTP/1.0 200 OK\r\nContent-Length:6719476739\r\n\r\n"),
6058 MockRead(false, OK),
6105 MockRead data_reads[] = {
6106 MockRead("HTTP/1.0 200 OK\r\n\r\n"),
6107 MockRead("hello world"),
6108 MockRead(false, OK),
6161 MockRead data_reads[] = {
6162 MockRead("HTTP/1.0 200 OK\r\n\r\n"),
6163 MockRead(false, OK),
6216 MockRead data_reads[] = {
6217 MockRead("HTTP/1.1 401 Unauthorized\r\n"),
6218 MockRead("WWW-Authenticate: Basic realm=\"MyRealm1\"\r\n"),
6219 MockRead("Content-Length: 0\r\n\r\n"), // No response body.
6221 MockRead("HTTP/1.1 200 OK\r\n"),
6222 MockRead("Content-Length: 0\r\n\r\n"),
6223 MockRead(false, OK),
6300 MockRead data_reads1[] = {
6301 MockRead("HTTP/1.1 401 Unauthorized\r\n"
6316 MockRead data_reads2[] = {
6317 MockRead("HTTP/1.1 401 Unauthorized\r\n"
6331 MockRead data_reads3[] = {
6332 MockRead("HTTP/1.1 401 Unauthorized\r\n"
6345 MockRead data_reads4[] = {
6346 MockRead("HTTP/1.1 200 OK\r\n"
6433 MockRead data_reads[] = {
6434 MockRead("HTTP/1.1 200 OK\r\n"),
6435 MockRead(kAlternateProtocolHttpHeader),
6436 MockRead("hello world"),
6437 MockRead(false, OK),
6502 MockRead data_reads[] = {
6503 MockRead("HTTP/1.1 200 OK\r\n\r\n"),
6504 MockRead("hello world"),
6505 MockRead(true, OK),
6555 MockRead data_reads[] = {
6556 MockRead("HTTP/1.1 200 OK\r\n"),
6557 MockRead(kAlternateProtocolHttpHeader),
6558 MockRead("hello world"),
6559 MockRead(true, OK),
6577 MockRead spdy_reads[] = {
6580 MockRead(true, 0, 0),
6646 MockRead data_reads[] = {
6647 MockRead("HTTP/1.1 200 OK\r\n"),
6648 MockRead(kAlternateProtocolHttpHeader),
6649 MockRead("hello world"),
6650 MockRead(true, OK),
6683 MockRead spdy_reads[] = {
6688 MockRead(true, 0, 0),
6764 MockRead data_reads[] = {
6765 MockRead("HTTP/1.1 200 OK\r\n"),
6766 MockRead(kAlternateProtocolHttpHeader),
6767 MockRead("hello world"),
6768 MockRead(true, OK),
6887 MockRead data_reads[] = {
6888 MockRead("HTTP/1.1 200 OK\r\n"),
6889 MockRead(kAlternateProtocolHttpHeader),
6890 MockRead("hello world"),
6891 MockRead(true, OK),
6916 MockRead spdy_reads[] = {
6917 MockRead(true, kCONNECTResponse, arraysize(kCONNECTResponse) - 1, 1), // 1
6920 MockRead(true, 0, 0, 4), // 6
6993 MockRead data_reads[] = {
6994 MockRead("HTTP/1.1 200 OK\r\n"),
6995 MockRead(kAlternateProtocolHttpHeader),
6996 MockRead("hello world"),
6997 MockRead(true, OK),
7017 MockRead spdy_reads[] = {
7020 MockRead(true, 0, 0),
7166 const MockRead kSuccess(
7171 const MockRead kFailure(
7173 const MockRead kServerChallenge(
7179 const MockRead kProxyChallenge(
7186 const MockRead kProxyConnected(
7199 TestRound(const MockWrite& write_arg, const MockRead& read_arg,
7207 TestRound(const MockWrite& write_arg, const MockRead& read_arg,
7217 MockRead read;
7220 const MockRead* extra_read;
7456 MockRead reads[2];
7567 const MockRead kServerChallenge(
7573 const MockRead kSuccess(
7591 MockRead reads[] = {
7699 virtual MockRead GetNextRead() {
7701 return MockRead(false /* async */, ERR_SSL_DECOMPRESSION_FAILURE_ALERT);
7703 return MockRead(false /* async */,
7823 MockRead data_reads[] = {
7824 MockRead("HTTP/1.1 200 OK\r\n"),
7825 MockRead(kAlternateProtocolHttpHeader),
7826 MockRead("hello world"),
7827 MockRead(false, OK),
7888 MockRead spdy_reads[] = {
7889 MockRead(false, 0, 0) // Not async - return 0 immediately.
7939 MockRead data_reads_1[] = {
7940 MockRead(false, ERR_TEST_PEER_CLOSE_AFTER_NEXT_MOCK_READ),
7941 MockRead("HTTP/1.1 200 OK\r\n"
7992 MockRead data_reads_2[] = {
7994 MockRead(false, ERR_TEST_PEER_CLOSE_AFTER_NEXT_MOCK_READ, 1),
7995 MockRead(true, kRejectConnectResponse,
7999 MockRead(true, kAcceptConnectResponse,
8005 MockRead(true, 0, 0, 6),
8071 MockRead data_reads[] = {
8072 MockRead(false, "HTTP/1.0 200 OK\r\n\r\n"),
8073 MockRead(false, "hello world"),
8074 MockRead(false, OK),
8118 MockRead data_reads1[] = {
8119 MockRead("HTTP/1.1 200 OK\r\n"),
8120 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
8121 MockRead("Content-Length: 100\r\n\r\n"),
8122 MockRead(false, OK),
8171 MockRead data_reads1[] = {
8172 MockRead("HTTP/1.1 200 Connection Established\r\n\r\n"),
8174 MockRead("HTTP/1.1 200 OK\r\n"),
8175 MockRead("Content-Type: text/html; charset=iso-8859-1\r\n"),
8176 MockRead("Content-Length: 100\r\n\r\n"),
8177 MockRead(false, OK),
8238 MockRead data_reads1[] = {
8239 MockRead(false, ERR_TEST_PEER_CLOSE_AFTER_NEXT_MOCK_READ),
8240 MockRead("HTTP/1.1 200 Connection Established\r\n\r\n"),
8241 MockRead(true, 0, 0), // EOF
8280 MockRead spdy_reads[] = {
8283 MockRead(true, 0, 0),
8517 net::MockRead data2_reads[] = {
8518 net::MockRead(true /* async */, net::ERR_SSL_PROTOCOL_ERROR),