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/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
10 #include "components/navigation_interception/intercept_navigation_resource_throt
tle.h" | 10 #include "components/navigation_interception/intercept_navigation_resource_throt
tle.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 CANCELLED | 79 CANCELLED |
80 }; | 80 }; |
81 | 81 |
82 MockResourceController() | 82 MockResourceController() |
83 : status_(UNKNOWN) { | 83 : status_(UNKNOWN) { |
84 } | 84 } |
85 | 85 |
86 Status status() const { return status_; } | 86 Status status() const { return status_; } |
87 | 87 |
88 // ResourceController: | 88 // ResourceController: |
89 virtual void Cancel() override { | 89 void Cancel() override { NOTREACHED(); } |
90 NOTREACHED(); | 90 void CancelAndIgnore() override { status_ = CANCELLED; } |
91 } | 91 void CancelWithError(int error_code) override { NOTREACHED(); } |
92 virtual void CancelAndIgnore() override { | 92 void Resume() override { |
93 status_ = CANCELLED; | |
94 } | |
95 virtual void CancelWithError(int error_code) override { | |
96 NOTREACHED(); | |
97 } | |
98 virtual void Resume() override { | |
99 DCHECK(status_ == UNKNOWN); | 93 DCHECK(status_ == UNKNOWN); |
100 status_ = RESUMED; | 94 status_ = RESUMED; |
101 } | 95 } |
102 | 96 |
103 private: | 97 private: |
104 Status status_; | 98 Status status_; |
105 }; | 99 }; |
106 | 100 |
107 // TestIOThreadState ---------------------------------------------------------- | 101 // TestIOThreadState ---------------------------------------------------------- |
108 | 102 |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 REDIRECT_MODE_302, | 465 REDIRECT_MODE_302, |
472 web_contents()->GetRenderViewHost()->GetProcess()->GetID(), | 466 web_contents()->GetRenderViewHost()->GetProcess()->GetID(), |
473 web_contents()->GetMainFrame()->GetRoutingID(), | 467 web_contents()->GetMainFrame()->GetRoutingID(), |
474 base::Unretained(&defer))); | 468 base::Unretained(&defer))); |
475 | 469 |
476 // Wait for the request to finish processing. | 470 // Wait for the request to finish processing. |
477 base::RunLoop().RunUntilIdle(); | 471 base::RunLoop().RunUntilIdle(); |
478 } | 472 } |
479 | 473 |
480 } // namespace navigation_interception | 474 } // namespace navigation_interception |
OLD | NEW |