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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 1992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2003 | 2003 |
2004 // Sorts out all the messages we saw by request. | 2004 // Sorts out all the messages we saw by request. |
2005 ResourceIPCAccumulator::ClassifiedMessages msgs; | 2005 ResourceIPCAccumulator::ClassifiedMessages msgs; |
2006 accum_.GetClassifiedMessages(&msgs); | 2006 accum_.GetClassifiedMessages(&msgs); |
2007 | 2007 |
2008 // We should have gotten one RequestComplete message. | 2008 // We should have gotten one RequestComplete message. |
2009 ASSERT_EQ(1U, msgs[0].size()); | 2009 ASSERT_EQ(1U, msgs[0].size()); |
2010 EXPECT_EQ(ResourceMsg_RequestComplete::ID, msgs[0][0].type()); | 2010 EXPECT_EQ(ResourceMsg_RequestComplete::ID, msgs[0][0].type()); |
2011 | 2011 |
2012 // The RequestComplete message should have had the error code of | 2012 // The RequestComplete message should have had the error code of |
2013 // ERR_FILE_NOT_FOUND. | 2013 // ERR_INVALID_RESPONSE. |
2014 CheckRequestCompleteErrorCode(msgs[0][0], net::ERR_FILE_NOT_FOUND); | 2014 CheckRequestCompleteErrorCode(msgs[0][0], net::ERR_INVALID_RESPONSE); |
2015 } | 2015 } |
2016 | 2016 |
2017 // Test for http://crbug.com/76202 . We don't want to destroy a | 2017 // Test for http://crbug.com/76202 . We don't want to destroy a |
2018 // download request prematurely when processing a cancellation from | 2018 // download request prematurely when processing a cancellation from |
2019 // the renderer. | 2019 // the renderer. |
2020 TEST_F(ResourceDispatcherHostTest, IgnoreCancelForDownloads) { | 2020 TEST_F(ResourceDispatcherHostTest, IgnoreCancelForDownloads) { |
2021 EXPECT_EQ(0, host_.pending_requests()); | 2021 EXPECT_EQ(0, host_.pending_requests()); |
2022 | 2022 |
2023 int render_view_id = 0; | 2023 int render_view_id = 0; |
2024 int request_id = 1; | 2024 int request_id = 1; |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2707 } | 2707 } |
2708 | 2708 |
2709 base::MessageLoop::current()->RunUntilIdle(); | 2709 base::MessageLoop::current()->RunUntilIdle(); |
2710 | 2710 |
2711 msgs.clear(); | 2711 msgs.clear(); |
2712 accum_.GetClassifiedMessages(&msgs); | 2712 accum_.GetClassifiedMessages(&msgs); |
2713 } | 2713 } |
2714 } | 2714 } |
2715 | 2715 |
2716 } // namespace content | 2716 } // namespace content |
OLD | NEW |