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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "chrome/browser/renderer_host/intercept_navigation_resource_throttle.h" | 9 #include "chrome/browser/renderer_host/intercept_navigation_resource_throttle.h" |
10 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 10 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 }; | 61 }; |
62 | 62 |
63 MockResourceController() | 63 MockResourceController() |
64 : status_(UNKNOWN) { | 64 : status_(UNKNOWN) { |
65 } | 65 } |
66 | 66 |
67 Status status() const { return status_; } | 67 Status status() const { return status_; } |
68 | 68 |
69 // content::ResourceController | 69 // content::ResourceController |
70 virtual void Cancel() { | 70 virtual void Cancel() { |
| 71 NOTREACHED(); |
| 72 } |
| 73 virtual void CancelWithHandledExternally() { |
71 DCHECK(status_ == UNKNOWN); | 74 DCHECK(status_ == UNKNOWN); |
72 status_ = CANCELLED; | 75 status_ = CANCELLED; |
73 ContinueTestCase(); | 76 ContinueTestCase(); |
74 } | 77 } |
75 virtual void Resume() { | 78 virtual void Resume() { |
76 DCHECK(status_ == UNKNOWN); | 79 DCHECK(status_ == UNKNOWN); |
77 status_ = RESUMED; | 80 status_ = RESUMED; |
78 ContinueTestCase(); | 81 ContinueTestCase(); |
79 } | 82 } |
80 | 83 |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 RunThrottleWillStartRequestOnIOThread, | 281 RunThrottleWillStartRequestOnIOThread, |
279 base::Unretained(this), | 282 base::Unretained(this), |
280 GURL(kUnsafeTestUrl), | 283 GURL(kUnsafeTestUrl), |
281 web_contents()->GetRenderViewHost()->GetProcess()->GetID(), | 284 web_contents()->GetRenderViewHost()->GetProcess()->GetID(), |
282 web_contents()->GetRenderViewHost()->GetRoutingID(), | 285 web_contents()->GetRenderViewHost()->GetRoutingID(), |
283 base::Unretained(&defer))); | 286 base::Unretained(&defer))); |
284 | 287 |
285 // Wait for the request to finish processing. | 288 // Wait for the request to finish processing. |
286 message_loop_.Run(); | 289 message_loop_.Run(); |
287 } | 290 } |
OLD | NEW |