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 1663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1674 "Content-Type: text/html; charset=utf-8\n\n"); | 1674 "Content-Type: text/html; charset=utf-8\n\n"); |
1675 std::string response_data("<html>foobar</html>"); | 1675 std::string response_data("<html>foobar</html>"); |
1676 | 1676 |
1677 SetResponse(raw_headers, response_data); | 1677 SetResponse(raw_headers, response_data); |
1678 SetResourceType(ResourceType::MAIN_FRAME); | 1678 SetResourceType(ResourceType::MAIN_FRAME); |
1679 HandleScheme("http"); | 1679 HandleScheme("http"); |
1680 | 1680 |
1681 MakeTestRequest(render_view_id, request_id, GURL("http://example.com/blah")); | 1681 MakeTestRequest(render_view_id, request_id, GURL("http://example.com/blah")); |
1682 | 1682 |
1683 GlobalRequestID global_request_id(filter_->child_id(), request_id); | 1683 GlobalRequestID global_request_id(filter_->child_id(), request_id); |
1684 host_.MarkAsTransferredNavigation(global_request_id); | 1684 host_.MarkAsTransferredNavigation(global_request_id, |
| 1685 GURL("http://example.com/blah")); |
1685 | 1686 |
1686 // And now simulate a cancellation coming from the renderer. | 1687 // And now simulate a cancellation coming from the renderer. |
1687 ResourceHostMsg_CancelRequest msg(filter_->child_id(), request_id); | 1688 ResourceHostMsg_CancelRequest msg(filter_->child_id(), request_id); |
1688 bool msg_was_ok; | 1689 bool msg_was_ok; |
1689 host_.OnMessageReceived(msg, filter_.get(), &msg_was_ok); | 1690 host_.OnMessageReceived(msg, filter_.get(), &msg_was_ok); |
1690 | 1691 |
1691 // Since the request is marked as being transferred, | 1692 // Since the request is marked as being transferred, |
1692 // the cancellation above should have been ignored and the request | 1693 // the cancellation above should have been ignored and the request |
1693 // should still be alive. | 1694 // should still be alive. |
1694 EXPECT_EQ(1, host_.pending_requests()); | 1695 EXPECT_EQ(1, host_.pending_requests()); |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1997 } | 1998 } |
1998 | 1999 |
1999 base::MessageLoop::current()->RunUntilIdle(); | 2000 base::MessageLoop::current()->RunUntilIdle(); |
2000 | 2001 |
2001 msgs.clear(); | 2002 msgs.clear(); |
2002 accum_.GetClassifiedMessages(&msgs); | 2003 accum_.GetClassifiedMessages(&msgs); |
2003 } | 2004 } |
2004 } | 2005 } |
2005 | 2006 |
2006 } // namespace content | 2007 } // namespace content |
OLD | NEW |