Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(378)

Side by Side Diff: net/http/bidirectional_stream_unittest.cc

Issue 2016863002: Log BIDIRECTIONL_STREAM_ALIVE before HTTP_STREAM_REQUEST (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a test Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/bidirectional_stream.h" 5 #include "net/http/bidirectional_stream.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 EXPECT_EQ(CountReadBytes(reads, arraysize(reads)), 573 EXPECT_EQ(CountReadBytes(reads, arraysize(reads)),
574 delegate->GetTotalReceivedBytes()); 574 delegate->GetTotalReceivedBytes());
575 575
576 // Destroy the delegate will destroy the stream, so we can get an end event 576 // Destroy the delegate will destroy the stream, so we can get an end event
577 // for BIDIRECTIONAL_STREAM_ALIVE. 577 // for BIDIRECTIONAL_STREAM_ALIVE.
578 delegate.reset(); 578 delegate.reset();
579 TestNetLogEntry::List entries; 579 TestNetLogEntry::List entries;
580 net_log_.GetEntries(&entries); 580 net_log_.GetEntries(&entries);
581 size_t index = ExpectLogContainsSomewhere( 581 size_t index = ExpectLogContainsSomewhere(
582 entries, 0, NetLog::TYPE_BIDIRECTIONAL_STREAM_ALIVE, NetLog::PHASE_BEGIN); 582 entries, 0, NetLog::TYPE_BIDIRECTIONAL_STREAM_ALIVE, NetLog::PHASE_BEGIN);
583 // Headers received should happen after BIDIRECTIONAL_STREAM_ALIVE. 583 // HTTP_STREAM_REQUEST is nested inside in BIDIRECTIONAL_STREAM_ALIVE.
584 index = ExpectLogContainsSomewhere(
585 entries, index, NetLog::TYPE_HTTP_STREAM_REQUEST, NetLog::PHASE_BEGIN);
586 index = ExpectLogContainsSomewhere(
587 entries, index, NetLog::TYPE_HTTP_STREAM_REQUEST, NetLog::PHASE_END);
588 // Headers received should happen after HTTP_STREAM_REQUEST.
584 index = ExpectLogContainsSomewhere( 589 index = ExpectLogContainsSomewhere(
585 entries, index, NetLog::TYPE_BIDIRECTIONAL_STREAM_RECV_HEADERS, 590 entries, index, NetLog::TYPE_BIDIRECTIONAL_STREAM_RECV_HEADERS,
586 NetLog::PHASE_NONE); 591 NetLog::PHASE_NONE);
587 // Trailers received should happen after headers received. It might happen 592 // Trailers received should happen after headers received. It might happen
588 // before the reads complete. 593 // before the reads complete.
589 ExpectLogContainsSomewhere(entries, index, 594 ExpectLogContainsSomewhere(entries, index,
590 NetLog::TYPE_BIDIRECTIONAL_STREAM_RECV_TRAILERS, 595 NetLog::TYPE_BIDIRECTIONAL_STREAM_RECV_TRAILERS,
591 NetLog::PHASE_NONE); 596 NetLog::PHASE_NONE);
592 // Sent bytes. Sending data is always asynchronous. 597 // Sent bytes. Sending data is always asynchronous.
593 index = ExpectLogContainsSomewhere( 598 index = ExpectLogContainsSomewhere(
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
1501 AlternativeServiceVector alternative_service_vector = 1506 AlternativeServiceVector alternative_service_vector =
1502 http_session_->http_server_properties()->GetAlternativeServices(server); 1507 http_session_->http_server_properties()->GetAlternativeServices(server);
1503 ASSERT_EQ(1u, alternative_service_vector.size()); 1508 ASSERT_EQ(1u, alternative_service_vector.size());
1504 EXPECT_EQ(AlternateProtocolFromNextProto(kProtoQUIC1SPDY3), 1509 EXPECT_EQ(AlternateProtocolFromNextProto(kProtoQUIC1SPDY3),
1505 alternative_service_vector[0].protocol); 1510 alternative_service_vector[0].protocol);
1506 EXPECT_EQ("www.example.org", alternative_service_vector[0].host); 1511 EXPECT_EQ("www.example.org", alternative_service_vector[0].host);
1507 EXPECT_EQ(443, alternative_service_vector[0].port); 1512 EXPECT_EQ(443, alternative_service_vector[0].port);
1508 } 1513 }
1509 1514
1510 } // namespace net 1515 } // namespace net
OLDNEW
« net/http/bidirectional_stream.cc ('K') | « net/http/bidirectional_stream.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698