OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/flip/flip_network_transaction.h" | 5 #include "net/flip/flip_network_transaction.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/ref_counted.h" | 8 #include "base/ref_counted.h" |
9 #include "net/base/completion_callback.h" | 9 #include "net/base/completion_callback.h" |
10 #include "net/base/load_log_unittest.h" | 10 #include "net/base/load_log_unittest.h" |
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1046 EXPECT_EQ(OK, out.rv); | 1046 EXPECT_EQ(OK, out.rv); |
1047 EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); | 1047 EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); |
1048 EXPECT_EQ("hello!", out.response_data); | 1048 EXPECT_EQ("hello!", out.response_data); |
1049 | 1049 |
1050 // Check that the LoadLog was filled reasonably. | 1050 // Check that the LoadLog was filled reasonably. |
1051 // This test is intentionally non-specific about the exact ordering of | 1051 // This test is intentionally non-specific about the exact ordering of |
1052 // the log; instead we just check to make sure that certain events exist. | 1052 // the log; instead we just check to make sure that certain events exist. |
1053 EXPECT_LT(0u, log->entries().size()); | 1053 EXPECT_LT(0u, log->entries().size()); |
1054 int pos = 0; | 1054 int pos = 0; |
1055 // We know the first event at position 0. | 1055 // We know the first event at position 0. |
1056 net::ExpectLogContains(log, 0, | 1056 EXPECT_TRUE(net::LogContainsBeginEvent( |
1057 net::LoadLog::TYPE_FLIP_TRANSACTION_INIT_CONNECTION, | 1057 *log, 0, net::LoadLog::TYPE_FLIP_TRANSACTION_INIT_CONNECTION)); |
1058 net::LoadLog::PHASE_BEGIN); | |
1059 // For the rest of the events, allow additional events in the middle, | 1058 // For the rest of the events, allow additional events in the middle, |
1060 // but expect these to be logged in order. | 1059 // but expect these to be logged in order. |
1061 pos = net::ExpectLogContainsSomewhere(log, 0, | 1060 pos = net::ExpectLogContainsSomewhere(log, 0, |
1062 net::LoadLog::TYPE_FLIP_TRANSACTION_INIT_CONNECTION, | 1061 net::LoadLog::TYPE_FLIP_TRANSACTION_INIT_CONNECTION, |
1063 net::LoadLog::PHASE_END); | 1062 net::LoadLog::PHASE_END); |
1064 pos = net::ExpectLogContainsSomewhere(log, pos + 1, | 1063 pos = net::ExpectLogContainsSomewhere(log, pos + 1, |
1065 net::LoadLog::TYPE_FLIP_TRANSACTION_SEND_REQUEST, | 1064 net::LoadLog::TYPE_FLIP_TRANSACTION_SEND_REQUEST, |
1066 net::LoadLog::PHASE_BEGIN); | 1065 net::LoadLog::PHASE_BEGIN); |
1067 pos = net::ExpectLogContainsSomewhere(log, pos + 1, | 1066 pos = net::ExpectLogContainsSomewhere(log, pos + 1, |
1068 net::LoadLog::TYPE_FLIP_TRANSACTION_SEND_REQUEST, | 1067 net::LoadLog::TYPE_FLIP_TRANSACTION_SEND_REQUEST, |
1069 net::LoadLog::PHASE_END); | 1068 net::LoadLog::PHASE_END); |
1070 pos = net::ExpectLogContainsSomewhere(log, pos + 1, | 1069 pos = net::ExpectLogContainsSomewhere(log, pos + 1, |
1071 net::LoadLog::TYPE_FLIP_TRANSACTION_READ_HEADERS, | 1070 net::LoadLog::TYPE_FLIP_TRANSACTION_READ_HEADERS, |
1072 net::LoadLog::PHASE_BEGIN); | 1071 net::LoadLog::PHASE_BEGIN); |
1073 pos = net::ExpectLogContainsSomewhere(log, pos + 1, | 1072 pos = net::ExpectLogContainsSomewhere(log, pos + 1, |
1074 net::LoadLog::TYPE_FLIP_TRANSACTION_READ_HEADERS, | 1073 net::LoadLog::TYPE_FLIP_TRANSACTION_READ_HEADERS, |
1075 net::LoadLog::PHASE_END); | 1074 net::LoadLog::PHASE_END); |
1076 pos = net::ExpectLogContainsSomewhere(log, pos + 1, | 1075 pos = net::ExpectLogContainsSomewhere(log, pos + 1, |
1077 net::LoadLog::TYPE_FLIP_TRANSACTION_READ_BODY, | 1076 net::LoadLog::TYPE_FLIP_TRANSACTION_READ_BODY, |
1078 net::LoadLog::PHASE_BEGIN); | 1077 net::LoadLog::PHASE_BEGIN); |
1079 pos = net::ExpectLogContainsSomewhere(log, pos + 1, | 1078 pos = net::ExpectLogContainsSomewhere(log, pos + 1, |
1080 net::LoadLog::TYPE_FLIP_TRANSACTION_READ_BODY, | 1079 net::LoadLog::TYPE_FLIP_TRANSACTION_READ_BODY, |
1081 net::LoadLog::PHASE_END); | 1080 net::LoadLog::PHASE_END); |
1082 } | 1081 } |
1083 | 1082 |
1084 } // namespace net | 1083 } // namespace net |
OLD | NEW |