| 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 CancelWithError(int error) { |
| 74 DCHECK(error == net::OK_HANDLED_EXTERNALLY); |
| 71 DCHECK(status_ == UNKNOWN); | 75 DCHECK(status_ == UNKNOWN); |
| 72 status_ = CANCELLED; | 76 status_ = CANCELLED; |
| 73 ContinueTestCase(); | 77 ContinueTestCase(); |
| 74 } | 78 } |
| 75 virtual void Resume() { | 79 virtual void Resume() { |
| 76 DCHECK(status_ == UNKNOWN); | 80 DCHECK(status_ == UNKNOWN); |
| 77 status_ = RESUMED; | 81 status_ = RESUMED; |
| 78 ContinueTestCase(); | 82 ContinueTestCase(); |
| 79 } | 83 } |
| 80 | 84 |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 RunThrottleWillStartRequestOnIOThread, | 282 RunThrottleWillStartRequestOnIOThread, |
| 279 base::Unretained(this), | 283 base::Unretained(this), |
| 280 GURL(kUnsafeTestUrl), | 284 GURL(kUnsafeTestUrl), |
| 281 web_contents()->GetRenderViewHost()->GetProcess()->GetID(), | 285 web_contents()->GetRenderViewHost()->GetProcess()->GetID(), |
| 282 web_contents()->GetRenderViewHost()->GetRoutingID(), | 286 web_contents()->GetRenderViewHost()->GetRoutingID(), |
| 283 base::Unretained(&defer))); | 287 base::Unretained(&defer))); |
| 284 | 288 |
| 285 // Wait for the request to finish processing. | 289 // Wait for the request to finish processing. |
| 286 message_loop_.Run(); | 290 message_loop_.Run(); |
| 287 } | 291 } |
| OLD | NEW |