| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/http/http_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "net/spdy/spdy_test_utils.h" | 30 #include "net/spdy/spdy_test_utils.h" |
| 31 #include "net/url_request/url_request_test_util.h" | 31 #include "net/url_request/url_request_test_util.h" |
| 32 #include "testing/platform_test.h" | 32 #include "testing/platform_test.h" |
| 33 | 33 |
| 34 using namespace net::test_spdy2; | 34 using namespace net::test_spdy2; |
| 35 | 35 |
| 36 //----------------------------------------------------------------------------- | 36 //----------------------------------------------------------------------------- |
| 37 | 37 |
| 38 namespace net { | 38 namespace net { |
| 39 | 39 |
| 40 namespace { |
| 41 const char kRequestUrl[] = "http://www.google.com/"; |
| 42 } // namespace |
| 43 |
| 40 enum SpdyNetworkTransactionSpdy2TestTypes { | 44 enum SpdyNetworkTransactionSpdy2TestTypes { |
| 41 SPDYNPN, | 45 SPDYNPN, |
| 42 SPDYNOSSL, | 46 SPDYNOSSL, |
| 43 SPDYSSL, | 47 SPDYSSL, |
| 44 }; | 48 }; |
| 45 | 49 |
| 46 class SpdyNetworkTransactionSpdy2Test | 50 class SpdyNetworkTransactionSpdy2Test |
| 47 : public ::testing::TestWithParam<SpdyNetworkTransactionSpdy2TestTypes> { | 51 : public ::testing::TestWithParam<SpdyNetworkTransactionSpdy2TestTypes> { |
| 48 protected: | 52 protected: |
| 49 | 53 |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 rv = callback.WaitForResult(); | 529 rv = callback.WaitForResult(); |
| 526 | 530 |
| 527 // Request the pushed path. | 531 // Request the pushed path. |
| 528 scoped_ptr<HttpNetworkTransaction> trans2( | 532 scoped_ptr<HttpNetworkTransaction> trans2( |
| 529 new HttpNetworkTransaction(helper.session())); | 533 new HttpNetworkTransaction(helper.session())); |
| 530 rv = trans2->Start( | 534 rv = trans2->Start( |
| 531 &CreateGetPushRequest(), callback.callback(), BoundNetLog()); | 535 &CreateGetPushRequest(), callback.callback(), BoundNetLog()); |
| 532 EXPECT_EQ(ERR_IO_PENDING, rv); | 536 EXPECT_EQ(ERR_IO_PENDING, rv); |
| 533 MessageLoop::current()->RunUntilIdle(); | 537 MessageLoop::current()->RunUntilIdle(); |
| 534 | 538 |
| 535 // The data for the pushed path may be coming in more than 1 packet. Compile | 539 // The data for the pushed path may be coming in more than 1 frame. Compile |
| 536 // the results into a single string. | 540 // the results into a single string. |
| 537 | 541 |
| 538 // Read the server push body. | 542 // Read the server push body. |
| 539 std::string result2; | 543 std::string result2; |
| 540 ReadResult(trans2.get(), data, &result2); | 544 ReadResult(trans2.get(), data, &result2); |
| 541 // Read the response body. | 545 // Read the response body. |
| 542 std::string result; | 546 std::string result; |
| 543 ReadResult(trans, data, &result); | 547 ReadResult(trans, data, &result); |
| 544 | 548 |
| 545 // Verify that we consumed all test data. | 549 // Verify that we consumed all test data. |
| (...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1496 DATA_FLAG_NONE // Data Flags | 1500 DATA_FLAG_NONE // Data Flags |
| 1497 }; | 1501 }; |
| 1498 const char* const kPutHeaders[] = { | 1502 const char* const kPutHeaders[] = { |
| 1499 "method", "PUT", | 1503 "method", "PUT", |
| 1500 "url", "/", | 1504 "url", "/", |
| 1501 "host", "www.google.com", | 1505 "host", "www.google.com", |
| 1502 "scheme", "http", | 1506 "scheme", "http", |
| 1503 "version", "HTTP/1.1", | 1507 "version", "HTTP/1.1", |
| 1504 "content-length", "0" | 1508 "content-length", "0" |
| 1505 }; | 1509 }; |
| 1506 scoped_ptr<SpdyFrame> req(ConstructSpdyPacket(kSynStartHeader, NULL, 0, | 1510 scoped_ptr<SpdyFrame> req(ConstructSpdyFrame(kSynStartHeader, NULL, 0, |
| 1507 kPutHeaders, arraysize(kPutHeaders) / 2)); | 1511 kPutHeaders, arraysize(kPutHeaders) / 2)); |
| 1508 MockWrite writes[] = { | 1512 MockWrite writes[] = { |
| 1509 CreateMockWrite(*req) | 1513 CreateMockWrite(*req) |
| 1510 }; | 1514 }; |
| 1511 | 1515 |
| 1512 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); | 1516 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); |
| 1513 const SpdyHeaderInfo kSynReplyHeader = { | 1517 const SpdyHeaderInfo kSynReplyHeader = { |
| 1514 SYN_REPLY, // Kind = SynReply | 1518 SYN_REPLY, // Kind = SynReply |
| 1515 1, // Stream ID | 1519 1, // Stream ID |
| 1516 0, // Associated stream ID | 1520 0, // Associated stream ID |
| 1517 ConvertRequestPriorityToSpdyPriority(LOWEST, 2), // Priority | 1521 ConvertRequestPriorityToSpdyPriority(LOWEST, 2), // Priority |
| 1518 CONTROL_FLAG_NONE, // Control Flags | 1522 CONTROL_FLAG_NONE, // Control Flags |
| 1519 false, // Compressed | 1523 false, // Compressed |
| 1520 RST_STREAM_INVALID, // Status | 1524 RST_STREAM_INVALID, // Status |
| 1521 NULL, // Data | 1525 NULL, // Data |
| 1522 0, // Length | 1526 0, // Length |
| 1523 DATA_FLAG_NONE // Data Flags | 1527 DATA_FLAG_NONE // Data Flags |
| 1524 }; | 1528 }; |
| 1525 static const char* const kStandardGetHeaders[] = { | 1529 static const char* const kStandardGetHeaders[] = { |
| 1526 "status", "200", | 1530 "status", "200", |
| 1527 "version", "HTTP/1.1" | 1531 "version", "HTTP/1.1" |
| 1528 "content-length", "1234" | 1532 "content-length", "1234" |
| 1529 }; | 1533 }; |
| 1530 scoped_ptr<SpdyFrame> resp(ConstructSpdyPacket(kSynReplyHeader, | 1534 scoped_ptr<SpdyFrame> resp(ConstructSpdyFrame(kSynReplyHeader, |
| 1531 NULL, 0, kStandardGetHeaders, arraysize(kStandardGetHeaders) / 2)); | 1535 NULL, 0, kStandardGetHeaders, arraysize(kStandardGetHeaders) / 2)); |
| 1532 MockRead reads[] = { | 1536 MockRead reads[] = { |
| 1533 CreateMockRead(*resp), | 1537 CreateMockRead(*resp), |
| 1534 CreateMockRead(*body), | 1538 CreateMockRead(*body), |
| 1535 MockRead(ASYNC, 0, 0) // EOF | 1539 MockRead(ASYNC, 0, 0) // EOF |
| 1536 }; | 1540 }; |
| 1537 | 1541 |
| 1538 DelayedSocketData data(1, reads, arraysize(reads), | 1542 DelayedSocketData data(1, reads, arraysize(reads), |
| 1539 writes, arraysize(writes)); | 1543 writes, arraysize(writes)); |
| 1540 NormalSpdyTransactionHelper helper(request, | 1544 NormalSpdyTransactionHelper helper(request, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1566 DATA_FLAG_NONE // Data Flags | 1570 DATA_FLAG_NONE // Data Flags |
| 1567 }; | 1571 }; |
| 1568 const char* const kHeadHeaders[] = { | 1572 const char* const kHeadHeaders[] = { |
| 1569 "method", "HEAD", | 1573 "method", "HEAD", |
| 1570 "url", "/", | 1574 "url", "/", |
| 1571 "host", "www.google.com", | 1575 "host", "www.google.com", |
| 1572 "scheme", "http", | 1576 "scheme", "http", |
| 1573 "version", "HTTP/1.1", | 1577 "version", "HTTP/1.1", |
| 1574 "content-length", "0" | 1578 "content-length", "0" |
| 1575 }; | 1579 }; |
| 1576 scoped_ptr<SpdyFrame> req(ConstructSpdyPacket(kSynStartHeader, NULL, 0, | 1580 scoped_ptr<SpdyFrame> req(ConstructSpdyFrame(kSynStartHeader, NULL, 0, |
| 1577 kHeadHeaders, arraysize(kHeadHeaders) / 2)); | 1581 kHeadHeaders, arraysize(kHeadHeaders) / 2)); |
| 1578 MockWrite writes[] = { | 1582 MockWrite writes[] = { |
| 1579 CreateMockWrite(*req) | 1583 CreateMockWrite(*req) |
| 1580 }; | 1584 }; |
| 1581 | 1585 |
| 1582 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); | 1586 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); |
| 1583 const SpdyHeaderInfo kSynReplyHeader = { | 1587 const SpdyHeaderInfo kSynReplyHeader = { |
| 1584 SYN_REPLY, // Kind = SynReply | 1588 SYN_REPLY, // Kind = SynReply |
| 1585 1, // Stream ID | 1589 1, // Stream ID |
| 1586 0, // Associated stream ID | 1590 0, // Associated stream ID |
| 1587 ConvertRequestPriorityToSpdyPriority(LOWEST, 2), // Priority | 1591 ConvertRequestPriorityToSpdyPriority(LOWEST, 2), // Priority |
| 1588 CONTROL_FLAG_NONE, // Control Flags | 1592 CONTROL_FLAG_NONE, // Control Flags |
| 1589 false, // Compressed | 1593 false, // Compressed |
| 1590 RST_STREAM_INVALID, // Status | 1594 RST_STREAM_INVALID, // Status |
| 1591 NULL, // Data | 1595 NULL, // Data |
| 1592 0, // Length | 1596 0, // Length |
| 1593 DATA_FLAG_NONE // Data Flags | 1597 DATA_FLAG_NONE // Data Flags |
| 1594 }; | 1598 }; |
| 1595 static const char* const kStandardGetHeaders[] = { | 1599 static const char* const kStandardGetHeaders[] = { |
| 1596 "status", "200", | 1600 "status", "200", |
| 1597 "version", "HTTP/1.1" | 1601 "version", "HTTP/1.1" |
| 1598 "content-length", "1234" | 1602 "content-length", "1234" |
| 1599 }; | 1603 }; |
| 1600 scoped_ptr<SpdyFrame> resp(ConstructSpdyPacket(kSynReplyHeader, | 1604 scoped_ptr<SpdyFrame> resp(ConstructSpdyFrame(kSynReplyHeader, |
| 1601 NULL, 0, kStandardGetHeaders, arraysize(kStandardGetHeaders) / 2)); | 1605 NULL, 0, kStandardGetHeaders, arraysize(kStandardGetHeaders) / 2)); |
| 1602 MockRead reads[] = { | 1606 MockRead reads[] = { |
| 1603 CreateMockRead(*resp), | 1607 CreateMockRead(*resp), |
| 1604 CreateMockRead(*body), | 1608 CreateMockRead(*body), |
| 1605 MockRead(ASYNC, 0, 0) // EOF | 1609 MockRead(ASYNC, 0, 0) // EOF |
| 1606 }; | 1610 }; |
| 1607 | 1611 |
| 1608 DelayedSocketData data(1, reads, arraysize(reads), | 1612 DelayedSocketData data(1, reads, arraysize(reads), |
| 1609 writes, arraysize(writes)); | 1613 writes, arraysize(writes)); |
| 1610 NormalSpdyTransactionHelper helper(request, | 1614 NormalSpdyTransactionHelper helper(request, |
| 1611 BoundNetLog(), GetParam(), NULL); | 1615 BoundNetLog(), GetParam(), NULL); |
| 1612 helper.RunToCompletion(&data); | 1616 helper.RunToCompletion(&data); |
| 1613 TransactionHelperResult out = helper.output(); | 1617 TransactionHelperResult out = helper.output(); |
| 1614 | 1618 |
| 1615 EXPECT_EQ(OK, out.rv); | 1619 EXPECT_EQ(OK, out.rv); |
| 1616 EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); | 1620 EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); |
| 1617 } | 1621 } |
| 1618 | 1622 |
| 1619 // Test that a simple POST works. | 1623 // Test that a simple POST works. |
| 1620 TEST_P(SpdyNetworkTransactionSpdy2Test, Post) { | 1624 TEST_P(SpdyNetworkTransactionSpdy2Test, Post) { |
| 1621 scoped_ptr<SpdyFrame> req(ConstructSpdyPost(kUploadDataSize, NULL, 0)); | 1625 scoped_ptr<SpdyFrame> req( |
| 1626 ConstructSpdyPost(kRequestUrl, kUploadDataSize, NULL, 0)); |
| 1622 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); | 1627 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); |
| 1623 MockWrite writes[] = { | 1628 MockWrite writes[] = { |
| 1624 CreateMockWrite(*req), | 1629 CreateMockWrite(*req), |
| 1625 CreateMockWrite(*body), // POST upload frame | 1630 CreateMockWrite(*body), // POST upload frame |
| 1626 }; | 1631 }; |
| 1627 | 1632 |
| 1628 scoped_ptr<SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); | 1633 scoped_ptr<SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); |
| 1629 MockRead reads[] = { | 1634 MockRead reads[] = { |
| 1630 CreateMockRead(*resp), | 1635 CreateMockRead(*resp), |
| 1631 CreateMockRead(*body), | 1636 CreateMockRead(*body), |
| 1632 MockRead(ASYNC, 0, 0) // EOF | 1637 MockRead(ASYNC, 0, 0) // EOF |
| 1633 }; | 1638 }; |
| 1634 | 1639 |
| 1635 DelayedSocketData data(2, reads, arraysize(reads), | 1640 DelayedSocketData data(2, reads, arraysize(reads), |
| 1636 writes, arraysize(writes)); | 1641 writes, arraysize(writes)); |
| 1637 NormalSpdyTransactionHelper helper(CreatePostRequest(), | 1642 NormalSpdyTransactionHelper helper(CreatePostRequest(), |
| 1638 BoundNetLog(), GetParam(), NULL); | 1643 BoundNetLog(), GetParam(), NULL); |
| 1639 helper.RunToCompletion(&data); | 1644 helper.RunToCompletion(&data); |
| 1640 TransactionHelperResult out = helper.output(); | 1645 TransactionHelperResult out = helper.output(); |
| 1641 EXPECT_EQ(OK, out.rv); | 1646 EXPECT_EQ(OK, out.rv); |
| 1642 EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); | 1647 EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); |
| 1643 EXPECT_EQ("hello!", out.response_data); | 1648 EXPECT_EQ("hello!", out.response_data); |
| 1644 } | 1649 } |
| 1645 | 1650 |
| 1646 // Test that a POST with a file works. | 1651 // Test that a POST with a file works. |
| 1647 TEST_P(SpdyNetworkTransactionSpdy2Test, FilePost) { | 1652 TEST_P(SpdyNetworkTransactionSpdy2Test, FilePost) { |
| 1648 scoped_ptr<SpdyFrame> req(ConstructSpdyPost(kUploadDataSize, NULL, 0)); | 1653 scoped_ptr<SpdyFrame> req( |
| 1654 ConstructSpdyPost(kRequestUrl, kUploadDataSize, NULL, 0)); |
| 1649 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); | 1655 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); |
| 1650 MockWrite writes[] = { | 1656 MockWrite writes[] = { |
| 1651 CreateMockWrite(*req), | 1657 CreateMockWrite(*req), |
| 1652 CreateMockWrite(*body), // POST upload frame | 1658 CreateMockWrite(*body), // POST upload frame |
| 1653 }; | 1659 }; |
| 1654 | 1660 |
| 1655 scoped_ptr<SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); | 1661 scoped_ptr<SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); |
| 1656 MockRead reads[] = { | 1662 MockRead reads[] = { |
| 1657 CreateMockRead(*resp), | 1663 CreateMockRead(*resp), |
| 1658 CreateMockRead(*body), | 1664 CreateMockRead(*body), |
| 1659 MockRead(ASYNC, 0, 0) // EOF | 1665 MockRead(ASYNC, 0, 0) // EOF |
| 1660 }; | 1666 }; |
| 1661 | 1667 |
| 1662 DelayedSocketData data(2, reads, arraysize(reads), | 1668 DelayedSocketData data(2, reads, arraysize(reads), |
| 1663 writes, arraysize(writes)); | 1669 writes, arraysize(writes)); |
| 1664 NormalSpdyTransactionHelper helper(CreateFilePostRequest(), | 1670 NormalSpdyTransactionHelper helper(CreateFilePostRequest(), |
| 1665 BoundNetLog(), GetParam(), NULL); | 1671 BoundNetLog(), GetParam(), NULL); |
| 1666 helper.RunToCompletion(&data); | 1672 helper.RunToCompletion(&data); |
| 1667 TransactionHelperResult out = helper.output(); | 1673 TransactionHelperResult out = helper.output(); |
| 1668 EXPECT_EQ(OK, out.rv); | 1674 EXPECT_EQ(OK, out.rv); |
| 1669 EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); | 1675 EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); |
| 1670 EXPECT_EQ("hello!", out.response_data); | 1676 EXPECT_EQ("hello!", out.response_data); |
| 1671 } | 1677 } |
| 1672 | 1678 |
| 1673 // Test that a complex POST works. | 1679 // Test that a complex POST works. |
| 1674 TEST_P(SpdyNetworkTransactionSpdy2Test, ComplexPost) { | 1680 TEST_P(SpdyNetworkTransactionSpdy2Test, ComplexPost) { |
| 1675 scoped_ptr<SpdyFrame> req(ConstructSpdyPost(kUploadDataSize, NULL, 0)); | 1681 scoped_ptr<SpdyFrame> req( |
| 1682 ConstructSpdyPost(kRequestUrl, kUploadDataSize, NULL, 0)); |
| 1676 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); | 1683 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); |
| 1677 MockWrite writes[] = { | 1684 MockWrite writes[] = { |
| 1678 CreateMockWrite(*req), | 1685 CreateMockWrite(*req), |
| 1679 CreateMockWrite(*body), // POST upload frame | 1686 CreateMockWrite(*body), // POST upload frame |
| 1680 }; | 1687 }; |
| 1681 | 1688 |
| 1682 scoped_ptr<SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); | 1689 scoped_ptr<SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); |
| 1683 MockRead reads[] = { | 1690 MockRead reads[] = { |
| 1684 CreateMockRead(*resp), | 1691 CreateMockRead(*resp), |
| 1685 CreateMockRead(*body), | 1692 CreateMockRead(*body), |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1785 EXPECT_EQ(OK, out.rv); | 1792 EXPECT_EQ(OK, out.rv); |
| 1786 EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); | 1793 EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); |
| 1787 EXPECT_EQ(expected_response, out.response_data); | 1794 EXPECT_EQ(expected_response, out.response_data); |
| 1788 } | 1795 } |
| 1789 | 1796 |
| 1790 // Test that a POST without any post data works. | 1797 // Test that a POST without any post data works. |
| 1791 TEST_P(SpdyNetworkTransactionSpdy2Test, NullPost) { | 1798 TEST_P(SpdyNetworkTransactionSpdy2Test, NullPost) { |
| 1792 // Setup the request | 1799 // Setup the request |
| 1793 HttpRequestInfo request; | 1800 HttpRequestInfo request; |
| 1794 request.method = "POST"; | 1801 request.method = "POST"; |
| 1795 request.url = GURL("http://www.google.com/"); | 1802 request.url = GURL(kRequestUrl); |
| 1796 // Create an empty UploadData. | 1803 // Create an empty UploadData. |
| 1797 request.upload_data_stream = NULL; | 1804 request.upload_data_stream = NULL; |
| 1798 | 1805 |
| 1799 // When request.upload_data_stream is NULL for post, content-length is | 1806 // When request.upload_data_stream is NULL for post, content-length is |
| 1800 // expected to be 0. | 1807 // expected to be 0. |
| 1801 scoped_ptr<SpdyFrame> req(ConstructSpdyPost(0, NULL, 0)); | 1808 scoped_ptr<SpdyFrame> req(ConstructSpdyPost(kRequestUrl, 0, NULL, 0)); |
| 1802 // Set the FIN bit since there will be no body. | 1809 // Set the FIN bit since there will be no body. |
| 1803 test::SetFrameFlags(req.get(), CONTROL_FLAG_FIN, kSpdyVersion2); | 1810 test::SetFrameFlags(req.get(), CONTROL_FLAG_FIN, kSpdyVersion2); |
| 1804 MockWrite writes[] = { | 1811 MockWrite writes[] = { |
| 1805 CreateMockWrite(*req), | 1812 CreateMockWrite(*req), |
| 1806 }; | 1813 }; |
| 1807 | 1814 |
| 1808 scoped_ptr<SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); | 1815 scoped_ptr<SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); |
| 1809 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); | 1816 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); |
| 1810 MockRead reads[] = { | 1817 MockRead reads[] = { |
| 1811 CreateMockRead(*resp), | 1818 CreateMockRead(*resp), |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1827 | 1834 |
| 1828 // Test that a simple POST works. | 1835 // Test that a simple POST works. |
| 1829 TEST_P(SpdyNetworkTransactionSpdy2Test, EmptyPost) { | 1836 TEST_P(SpdyNetworkTransactionSpdy2Test, EmptyPost) { |
| 1830 // Create an empty UploadDataStream. | 1837 // Create an empty UploadDataStream. |
| 1831 ScopedVector<UploadElementReader> element_readers; | 1838 ScopedVector<UploadElementReader> element_readers; |
| 1832 UploadDataStream stream(&element_readers, 0); | 1839 UploadDataStream stream(&element_readers, 0); |
| 1833 | 1840 |
| 1834 // Setup the request | 1841 // Setup the request |
| 1835 HttpRequestInfo request; | 1842 HttpRequestInfo request; |
| 1836 request.method = "POST"; | 1843 request.method = "POST"; |
| 1837 request.url = GURL("http://www.google.com/"); | 1844 request.url = GURL(kRequestUrl); |
| 1838 request.upload_data_stream = &stream; | 1845 request.upload_data_stream = &stream; |
| 1839 | 1846 |
| 1840 const uint64 kContentLength = 0; | 1847 const uint64 kContentLength = 0; |
| 1841 scoped_ptr<SpdyFrame> req(ConstructSpdyPost(kContentLength, NULL, 0)); | 1848 scoped_ptr<SpdyFrame> req( |
| 1849 ConstructSpdyPost(kRequestUrl, kContentLength, NULL, 0)); |
| 1842 // Set the FIN bit since there will be no body. | 1850 // Set the FIN bit since there will be no body. |
| 1843 test::SetFrameFlags(req.get(), CONTROL_FLAG_FIN, kSpdyVersion2); | 1851 test::SetFrameFlags(req.get(), CONTROL_FLAG_FIN, kSpdyVersion2); |
| 1844 MockWrite writes[] = { | 1852 MockWrite writes[] = { |
| 1845 CreateMockWrite(*req), | 1853 CreateMockWrite(*req), |
| 1846 }; | 1854 }; |
| 1847 | 1855 |
| 1848 scoped_ptr<SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); | 1856 scoped_ptr<SpdyFrame> resp(ConstructSpdyPostSynReply(NULL, 0)); |
| 1849 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); | 1857 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); |
| 1850 MockRead reads[] = { | 1858 MockRead reads[] = { |
| 1851 CreateMockRead(*resp), | 1859 CreateMockRead(*resp), |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1867 TEST_P(SpdyNetworkTransactionSpdy2Test, PostWithEarlySynReply) { | 1875 TEST_P(SpdyNetworkTransactionSpdy2Test, PostWithEarlySynReply) { |
| 1868 static const char upload[] = { "hello!" }; | 1876 static const char upload[] = { "hello!" }; |
| 1869 ScopedVector<UploadElementReader> element_readers; | 1877 ScopedVector<UploadElementReader> element_readers; |
| 1870 element_readers.push_back( | 1878 element_readers.push_back( |
| 1871 new UploadBytesElementReader(upload, sizeof(upload))); | 1879 new UploadBytesElementReader(upload, sizeof(upload))); |
| 1872 UploadDataStream stream(&element_readers, 0); | 1880 UploadDataStream stream(&element_readers, 0); |
| 1873 | 1881 |
| 1874 // Setup the request | 1882 // Setup the request |
| 1875 HttpRequestInfo request; | 1883 HttpRequestInfo request; |
| 1876 request.method = "POST"; | 1884 request.method = "POST"; |
| 1877 request.url = GURL("http://www.google.com/"); | 1885 request.url = GURL(kRequestUrl); |
| 1878 request.upload_data_stream = &stream; | 1886 request.upload_data_stream = &stream; |
| 1879 | 1887 |
| 1880 scoped_ptr<SpdyFrame> stream_reply(ConstructSpdyPostSynReply(NULL, 0)); | 1888 scoped_ptr<SpdyFrame> stream_reply(ConstructSpdyPostSynReply(NULL, 0)); |
| 1881 scoped_ptr<SpdyFrame> stream_body(ConstructSpdyBodyFrame(1, true)); | 1889 scoped_ptr<SpdyFrame> stream_body(ConstructSpdyBodyFrame(1, true)); |
| 1882 MockRead reads[] = { | 1890 MockRead reads[] = { |
| 1883 CreateMockRead(*stream_reply, 1), | 1891 CreateMockRead(*stream_reply, 1), |
| 1884 MockRead(ASYNC, 0, 3) // EOF | 1892 MockRead(ASYNC, 0, 3) // EOF |
| 1885 }; | 1893 }; |
| 1886 | 1894 |
| 1887 scoped_ptr<SpdyFrame> req(ConstructSpdyPost(kUploadDataSize, NULL, 0)); | 1895 scoped_ptr<SpdyFrame> req( |
| 1896 ConstructSpdyPost(kRequestUrl, kUploadDataSize, NULL, 0)); |
| 1888 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); | 1897 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); |
| 1889 MockWrite writes[] = { | 1898 MockWrite writes[] = { |
| 1890 CreateMockWrite(*req, 0), | 1899 CreateMockWrite(*req, 0), |
| 1891 CreateMockWrite(*body, 2), | 1900 CreateMockWrite(*body, 2), |
| 1892 }; | 1901 }; |
| 1893 | 1902 |
| 1894 DeterministicSocketData data(reads, arraysize(reads), | 1903 DeterministicSocketData data(reads, arraysize(reads), |
| 1895 writes, arraysize(writes)); | 1904 writes, arraysize(writes)); |
| 1896 NormalSpdyTransactionHelper helper(CreatePostRequest(), | 1905 NormalSpdyTransactionHelper helper(CreatePostRequest(), |
| 1897 BoundNetLog(), GetParam(), NULL); | 1906 BoundNetLog(), GetParam(), NULL); |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2162 } | 2171 } |
| 2163 | 2172 |
| 2164 // Verify that the client can correctly deal with the user callback attempting | 2173 // Verify that the client can correctly deal with the user callback attempting |
| 2165 // to start another transaction on a session that is closing down. See | 2174 // to start another transaction on a session that is closing down. See |
| 2166 // http://crbug.com/47455 | 2175 // http://crbug.com/47455 |
| 2167 TEST_P(SpdyNetworkTransactionSpdy2Test, StartTransactionOnReadCallback) { | 2176 TEST_P(SpdyNetworkTransactionSpdy2Test, StartTransactionOnReadCallback) { |
| 2168 scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); | 2177 scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); |
| 2169 MockWrite writes[] = { CreateMockWrite(*req) }; | 2178 MockWrite writes[] = { CreateMockWrite(*req) }; |
| 2170 MockWrite writes2[] = { CreateMockWrite(*req) }; | 2179 MockWrite writes2[] = { CreateMockWrite(*req) }; |
| 2171 | 2180 |
| 2172 // The indicated length of this packet is longer than its actual length. When | 2181 // The indicated length of this frame is longer than its actual length. When |
| 2173 // the session receives an empty packet after this one, it shuts down the | 2182 // the session receives an empty frame after this one, it shuts down the |
| 2174 // session, and calls the read callback with the incomplete data. | 2183 // session, and calls the read callback with the incomplete data. |
| 2175 const uint8 kGetBodyFrame2[] = { | 2184 const uint8 kGetBodyFrame2[] = { |
| 2176 0x00, 0x00, 0x00, 0x01, | 2185 0x00, 0x00, 0x00, 0x01, |
| 2177 0x01, 0x00, 0x00, 0x07, | 2186 0x01, 0x00, 0x00, 0x07, |
| 2178 'h', 'e', 'l', 'l', 'o', '!', | 2187 'h', 'e', 'l', 'l', 'o', '!', |
| 2179 }; | 2188 }; |
| 2180 | 2189 |
| 2181 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); | 2190 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); |
| 2182 MockRead reads[] = { | 2191 MockRead reads[] = { |
| 2183 CreateMockRead(*resp, 2), | 2192 CreateMockRead(*resp, 2), |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2301 "http", | 2310 "http", |
| 2302 "url", | 2311 "url", |
| 2303 "/index.php", | 2312 "/index.php", |
| 2304 "user-agent", | 2313 "user-agent", |
| 2305 "", | 2314 "", |
| 2306 "version", | 2315 "version", |
| 2307 "HTTP/1.1" | 2316 "HTTP/1.1" |
| 2308 }; | 2317 }; |
| 2309 | 2318 |
| 2310 // Setup writes/reads to www.google.com | 2319 // Setup writes/reads to www.google.com |
| 2311 scoped_ptr<SpdyFrame> req(ConstructSpdyPacket( | 2320 scoped_ptr<SpdyFrame> req(ConstructSpdyFrame( |
| 2312 kSynStartHeader, kExtraHeaders, arraysize(kExtraHeaders) / 2, | 2321 kSynStartHeader, kExtraHeaders, arraysize(kExtraHeaders) / 2, |
| 2313 kStandardGetHeaders, arraysize(kStandardGetHeaders) / 2)); | 2322 kStandardGetHeaders, arraysize(kStandardGetHeaders) / 2)); |
| 2314 scoped_ptr<SpdyFrame> req2(ConstructSpdyPacket( | 2323 scoped_ptr<SpdyFrame> req2(ConstructSpdyFrame( |
| 2315 kSynStartHeader, kExtraHeaders, arraysize(kExtraHeaders) / 2, | 2324 kSynStartHeader, kExtraHeaders, arraysize(kExtraHeaders) / 2, |
| 2316 kStandardGetHeaders2, arraysize(kStandardGetHeaders2) / 2)); | 2325 kStandardGetHeaders2, arraysize(kStandardGetHeaders2) / 2)); |
| 2317 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReplyRedirect(1)); | 2326 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReplyRedirect(1)); |
| 2318 MockWrite writes[] = { | 2327 MockWrite writes[] = { |
| 2319 CreateMockWrite(*req, 1), | 2328 CreateMockWrite(*req, 1), |
| 2320 }; | 2329 }; |
| 2321 MockRead reads[] = { | 2330 MockRead reads[] = { |
| 2322 CreateMockRead(*resp, 2), | 2331 CreateMockRead(*resp, 2), |
| 2323 MockRead(ASYNC, 0, 0, 3) // EOF | 2332 MockRead(ASYNC, 0, 0, 3) // EOF |
| 2324 }; | 2333 }; |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2514 "url", | 2523 "url", |
| 2515 "/", | 2524 "/", |
| 2516 "user-agent", | 2525 "user-agent", |
| 2517 "", | 2526 "", |
| 2518 "version", | 2527 "version", |
| 2519 "HTTP/1.1" | 2528 "HTTP/1.1" |
| 2520 }; | 2529 }; |
| 2521 | 2530 |
| 2522 // Setup writes/reads to www.google.com | 2531 // Setup writes/reads to www.google.com |
| 2523 scoped_ptr<SpdyFrame> req( | 2532 scoped_ptr<SpdyFrame> req( |
| 2524 ConstructSpdyPacket(kSynStartHeader, | 2533 ConstructSpdyFrame(kSynStartHeader, |
| 2525 kExtraHeaders, | 2534 kExtraHeaders, |
| 2526 arraysize(kExtraHeaders) / 2, | 2535 arraysize(kExtraHeaders) / 2, |
| 2527 kStandardGetHeaders, | 2536 kStandardGetHeaders, |
| 2528 arraysize(kStandardGetHeaders) / 2)); | 2537 arraysize(kStandardGetHeaders) / 2)); |
| 2529 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); | 2538 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); |
| 2530 scoped_ptr<SpdyFrame> rep( | 2539 scoped_ptr<SpdyFrame> rep( |
| 2531 ConstructSpdyPush(NULL, | 2540 ConstructSpdyPush(NULL, |
| 2532 0, | 2541 0, |
| 2533 2, | 2542 2, |
| 2534 1, | 2543 1, |
| 2535 "http://www.google.com/foo.dat", | 2544 "http://www.google.com/foo.dat", |
| 2536 "301 Moved Permanently", | 2545 "301 Moved Permanently", |
| 2537 "http://www.foo.com/index.php")); | 2546 "http://www.foo.com/index.php")); |
| 2538 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); | 2547 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2558 "scheme", | 2567 "scheme", |
| 2559 "http", | 2568 "http", |
| 2560 "url", | 2569 "url", |
| 2561 "/index.php", | 2570 "/index.php", |
| 2562 "user-agent", | 2571 "user-agent", |
| 2563 "", | 2572 "", |
| 2564 "version", | 2573 "version", |
| 2565 "HTTP/1.1" | 2574 "HTTP/1.1" |
| 2566 }; | 2575 }; |
| 2567 scoped_ptr<SpdyFrame> req2( | 2576 scoped_ptr<SpdyFrame> req2( |
| 2568 ConstructSpdyPacket(kSynStartHeader, | 2577 ConstructSpdyFrame(kSynStartHeader, |
| 2569 kExtraHeaders, | 2578 kExtraHeaders, |
| 2570 arraysize(kExtraHeaders) / 2, | 2579 arraysize(kExtraHeaders) / 2, |
| 2571 kStandardGetHeaders2, | 2580 kStandardGetHeaders2, |
| 2572 arraysize(kStandardGetHeaders2) / 2)); | 2581 arraysize(kStandardGetHeaders2) / 2)); |
| 2573 scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 1)); | 2582 scoped_ptr<SpdyFrame> resp2(ConstructSpdyGetSynReply(NULL, 0, 1)); |
| 2574 scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(1, true)); | 2583 scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(1, true)); |
| 2575 MockWrite writes2[] = { | 2584 MockWrite writes2[] = { |
| 2576 CreateMockWrite(*req2, 1), | 2585 CreateMockWrite(*req2, 1), |
| 2577 }; | 2586 }; |
| 2578 MockRead reads2[] = { | 2587 MockRead reads2[] = { |
| 2579 CreateMockRead(*resp2, 2), | 2588 CreateMockRead(*resp2, 2), |
| 2580 CreateMockRead(*body2, 3), | 2589 CreateMockRead(*body2, 3), |
| 2581 MockRead(ASYNC, 0, 0, 5) // EOF | 2590 MockRead(ASYNC, 0, 0, 5) // EOF |
| 2582 }; | 2591 }; |
| (...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3376 ConstructSpdyGet(test_cases[i].extra_headers[0], | 3385 ConstructSpdyGet(test_cases[i].extra_headers[0], |
| 3377 test_cases[i].num_headers[0], | 3386 test_cases[i].num_headers[0], |
| 3378 false, 1, LOWEST)); | 3387 false, 1, LOWEST)); |
| 3379 | 3388 |
| 3380 MockWrite writes[] = { | 3389 MockWrite writes[] = { |
| 3381 CreateMockWrite(*frame_req), | 3390 CreateMockWrite(*frame_req), |
| 3382 }; | 3391 }; |
| 3383 | 3392 |
| 3384 // Construct the reply. | 3393 // Construct the reply. |
| 3385 scoped_ptr<SpdyFrame> frame_reply( | 3394 scoped_ptr<SpdyFrame> frame_reply( |
| 3386 ConstructSpdyPacket(*test_cases[i].syn_reply, | 3395 ConstructSpdyFrame(*test_cases[i].syn_reply, |
| 3387 test_cases[i].extra_headers[1], | 3396 test_cases[i].extra_headers[1], |
| 3388 test_cases[i].num_headers[1], | 3397 test_cases[i].num_headers[1], |
| 3389 NULL, | 3398 NULL, |
| 3390 0)); | 3399 0)); |
| 3391 | 3400 |
| 3392 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); | 3401 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); |
| 3393 MockRead reads[] = { | 3402 MockRead reads[] = { |
| 3394 CreateMockRead(*frame_reply), | 3403 CreateMockRead(*frame_reply), |
| 3395 CreateMockRead(*body), | 3404 CreateMockRead(*body), |
| 3396 MockRead(ASYNC, 0, 0) // EOF | 3405 MockRead(ASYNC, 0, 0) // EOF |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3492 }; | 3501 }; |
| 3493 | 3502 |
| 3494 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { | 3503 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { |
| 3495 scoped_ptr<SpdyFrame> req( | 3504 scoped_ptr<SpdyFrame> req( |
| 3496 ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); | 3505 ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); |
| 3497 MockWrite writes[] = { | 3506 MockWrite writes[] = { |
| 3498 CreateMockWrite(*req), | 3507 CreateMockWrite(*req), |
| 3499 }; | 3508 }; |
| 3500 | 3509 |
| 3501 scoped_ptr<SpdyFrame> resp( | 3510 scoped_ptr<SpdyFrame> resp( |
| 3502 ConstructSpdyPacket(kSynStartHeader, | 3511 ConstructSpdyFrame(kSynStartHeader, |
| 3503 NULL, 0, | 3512 NULL, 0, |
| 3504 test_cases[i].headers, | 3513 test_cases[i].headers, |
| 3505 test_cases[i].num_headers)); | 3514 test_cases[i].num_headers)); |
| 3506 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); | 3515 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); |
| 3507 MockRead reads[] = { | 3516 MockRead reads[] = { |
| 3508 CreateMockRead(*resp), | 3517 CreateMockRead(*resp), |
| 3509 CreateMockRead(*body), | 3518 CreateMockRead(*body), |
| 3510 MockRead(ASYNC, 0, 0) // EOF | 3519 MockRead(ASYNC, 0, 0) // EOF |
| 3511 }; | 3520 }; |
| 3512 | 3521 |
| 3513 DelayedSocketData data(1, reads, arraysize(reads), | 3522 DelayedSocketData data(1, reads, arraysize(reads), |
| 3514 writes, arraysize(writes)); | 3523 writes, arraysize(writes)); |
| 3515 NormalSpdyTransactionHelper helper(CreateGetRequest(), | 3524 NormalSpdyTransactionHelper helper(CreateGetRequest(), |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4193 SpdySessionPool* spdy_session_pool = helper.session()->spdy_session_pool(); | 4202 SpdySessionPool* spdy_session_pool = helper.session()->spdy_session_pool(); |
| 4194 EXPECT_TRUE(spdy_session_pool->http_server_properties()->GetSpdySettings( | 4203 EXPECT_TRUE(spdy_session_pool->http_server_properties()->GetSpdySettings( |
| 4195 host_port_pair).empty()); | 4204 host_port_pair).empty()); |
| 4196 | 4205 |
| 4197 // Construct the request. | 4206 // Construct the request. |
| 4198 scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); | 4207 scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); |
| 4199 MockWrite writes[] = { CreateMockWrite(*req) }; | 4208 MockWrite writes[] = { CreateMockWrite(*req) }; |
| 4200 | 4209 |
| 4201 // Construct the reply. | 4210 // Construct the reply. |
| 4202 scoped_ptr<SpdyFrame> reply( | 4211 scoped_ptr<SpdyFrame> reply( |
| 4203 ConstructSpdyPacket(kSynReplyInfo, | 4212 ConstructSpdyFrame(kSynReplyInfo, |
| 4204 kExtraHeaders, | 4213 kExtraHeaders, |
| 4205 arraysize(kExtraHeaders) / 2, | 4214 arraysize(kExtraHeaders) / 2, |
| 4206 NULL, | 4215 NULL, |
| 4207 0)); | 4216 0)); |
| 4208 | 4217 |
| 4209 const SpdySettingsIds kSampleId1 = SETTINGS_UPLOAD_BANDWIDTH; | 4218 const SpdySettingsIds kSampleId1 = SETTINGS_UPLOAD_BANDWIDTH; |
| 4210 unsigned int kSampleValue1 = 0x0a0a0a0a; | 4219 unsigned int kSampleValue1 = 0x0a0a0a0a; |
| 4211 const SpdySettingsIds kSampleId2 = SETTINGS_DOWNLOAD_BANDWIDTH; | 4220 const SpdySettingsIds kSampleId2 = SETTINGS_DOWNLOAD_BANDWIDTH; |
| 4212 unsigned int kSampleValue2 = 0x0b0b0b0b; | 4221 unsigned int kSampleValue2 = 0x0b0b0b0b; |
| 4213 const SpdySettingsIds kSampleId3 = SETTINGS_ROUND_TRIP_TIME; | 4222 const SpdySettingsIds kSampleId3 = SETTINGS_ROUND_TRIP_TIME; |
| 4214 unsigned int kSampleValue3 = 0x0c0c0c0c; | 4223 unsigned int kSampleValue3 = 0x0c0c0c0c; |
| 4215 scoped_ptr<SpdyFrame> settings_frame; | 4224 scoped_ptr<SpdyFrame> settings_frame; |
| 4216 { | 4225 { |
| 4217 // Construct the SETTINGS frame. | 4226 // Construct the SETTINGS frame. |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4331 // Construct the request. | 4340 // Construct the request. |
| 4332 scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); | 4341 scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); |
| 4333 | 4342 |
| 4334 MockWrite writes[] = { | 4343 MockWrite writes[] = { |
| 4335 CreateMockWrite(*settings_frame), | 4344 CreateMockWrite(*settings_frame), |
| 4336 CreateMockWrite(*req), | 4345 CreateMockWrite(*req), |
| 4337 }; | 4346 }; |
| 4338 | 4347 |
| 4339 // Construct the reply. | 4348 // Construct the reply. |
| 4340 scoped_ptr<SpdyFrame> reply( | 4349 scoped_ptr<SpdyFrame> reply( |
| 4341 ConstructSpdyPacket(kSynReplyInfo, | 4350 ConstructSpdyFrame(kSynReplyInfo, |
| 4342 kExtraHeaders, | 4351 kExtraHeaders, |
| 4343 arraysize(kExtraHeaders) / 2, | 4352 arraysize(kExtraHeaders) / 2, |
| 4344 NULL, | 4353 NULL, |
| 4345 0)); | 4354 0)); |
| 4346 | 4355 |
| 4347 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); | 4356 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); |
| 4348 MockRead reads[] = { | 4357 MockRead reads[] = { |
| 4349 CreateMockRead(*reply), | 4358 CreateMockRead(*reply), |
| 4350 CreateMockRead(*body), | 4359 CreateMockRead(*body), |
| 4351 MockRead(ASYNC, 0, 0) // EOF | 4360 MockRead(ASYNC, 0, 0) // EOF |
| 4352 }; | 4361 }; |
| 4353 | 4362 |
| 4354 DelayedSocketData data(2, reads, arraysize(reads), | 4363 DelayedSocketData data(2, reads, arraysize(reads), |
| 4355 writes, arraysize(writes)); | 4364 writes, arraysize(writes)); |
| (...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5847 // And now we can allow everything else to run to completion. | 5856 // And now we can allow everything else to run to completion. |
| 5848 data.SetStop(10); | 5857 data.SetStop(10); |
| 5849 data.Run(); | 5858 data.Run(); |
| 5850 EXPECT_EQ(OK, callback2.WaitForResult()); | 5859 EXPECT_EQ(OK, callback2.WaitForResult()); |
| 5851 EXPECT_EQ(OK, callback3.WaitForResult()); | 5860 EXPECT_EQ(OK, callback3.WaitForResult()); |
| 5852 | 5861 |
| 5853 helper.VerifyDataConsumed(); | 5862 helper.VerifyDataConsumed(); |
| 5854 } | 5863 } |
| 5855 | 5864 |
| 5856 } // namespace net | 5865 } // namespace net |
| OLD | NEW |