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 "content/child/resource_dispatcher.h" | 5 #include "content/child/resource_dispatcher.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 EXPECT_EQ(0u, queued_messages()); | 632 EXPECT_EQ(0u, queued_messages()); |
633 | 633 |
634 // This lets the wrapper peer pass all the messages to the original | 634 // This lets the wrapper peer pass all the messages to the original |
635 // peer at once, but the original peer cancels right after it receives | 635 // peer at once, but the original peer cancels right after it receives |
636 // the response. (This will remove pending request info from | 636 // the response. (This will remove pending request info from |
637 // ResourceDispatcher while the wrapper peer is still running | 637 // ResourceDispatcher while the wrapper peer is still running |
638 // OnCompletedRequest, but it should not lead to crashes.) | 638 // OnCompletedRequest, but it should not lead to crashes.) |
639 NotifyRequestComplete(id, strlen(kTestPageContents)); | 639 NotifyRequestComplete(id, strlen(kTestPageContents)); |
640 | 640 |
641 EXPECT_TRUE(peer_context.received_response); | 641 EXPECT_TRUE(peer_context.received_response); |
642 // Request should have been cancelled. | 642 // Request should have been cancelled with no additional messages. |
643 ConsumeCancelRequest(id); | 643 EXPECT_EQ(0u, queued_messages()); |
644 EXPECT_TRUE(peer_context.cancelled); | 644 EXPECT_TRUE(peer_context.cancelled); |
645 | 645 |
646 // Any future messages related to the request should be ignored. | 646 // Any future messages related to the request should be ignored. |
647 NotifyDataReceived(id, kTestPageContents); | 647 NotifyDataReceived(id, kTestPageContents); |
648 NotifyRequestComplete(id, strlen(kTestPageContents)); | 648 NotifyRequestComplete(id, strlen(kTestPageContents)); |
649 | 649 |
650 EXPECT_EQ(0u, queued_messages()); | 650 EXPECT_EQ(0u, queued_messages()); |
651 EXPECT_EQ("", peer_context.data); | 651 EXPECT_EQ("", peer_context.data); |
652 EXPECT_FALSE(peer_context.complete); | 652 EXPECT_FALSE(peer_context.complete); |
653 } | 653 } |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 ResourceResponseHead response_head; | 936 ResourceResponseHead response_head; |
937 | 937 |
938 PerformTest(response_head); | 938 PerformTest(response_head); |
939 | 939 |
940 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start); | 940 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start); |
941 EXPECT_EQ(base::TimeTicks(), | 941 EXPECT_EQ(base::TimeTicks(), |
942 response_info().load_timing.connect_timing.dns_start); | 942 response_info().load_timing.connect_timing.dns_start); |
943 } | 943 } |
944 | 944 |
945 } // namespace content | 945 } // namespace content |
OLD | NEW |