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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 // InterceptNavigationResourceThrottleTest ------------------------------------ | 177 // InterceptNavigationResourceThrottleTest ------------------------------------ |
178 | 178 |
179 class InterceptNavigationResourceThrottleTest | 179 class InterceptNavigationResourceThrottleTest |
180 : public content::RenderViewHostTestHarness { | 180 : public content::RenderViewHostTestHarness { |
181 public: | 181 public: |
182 InterceptNavigationResourceThrottleTest() | 182 InterceptNavigationResourceThrottleTest() |
183 : mock_callback_receiver_(new MockInterceptCallbackReceiver()), | 183 : mock_callback_receiver_(new MockInterceptCallbackReceiver()), |
184 io_thread_state_(NULL) { | 184 io_thread_state_(NULL) { |
185 } | 185 } |
186 | 186 |
187 virtual void SetUp() override { | 187 void SetUp() override { RenderViewHostTestHarness::SetUp(); } |
188 RenderViewHostTestHarness::SetUp(); | |
189 } | |
190 | 188 |
191 virtual void TearDown() override { | 189 void TearDown() override { |
192 if (web_contents()) | 190 if (web_contents()) |
193 web_contents()->SetDelegate(NULL); | 191 web_contents()->SetDelegate(NULL); |
194 | 192 |
195 content::BrowserThread::DeleteSoon( | 193 content::BrowserThread::DeleteSoon( |
196 content::BrowserThread::IO, FROM_HERE, io_thread_state_); | 194 content::BrowserThread::IO, FROM_HERE, io_thread_state_); |
197 | 195 |
198 RenderViewHostTestHarness::TearDown(); | 196 RenderViewHostTestHarness::TearDown(); |
199 } | 197 } |
200 | 198 |
201 void SetIOThreadState(TestIOThreadState* io_thread_state) { | 199 void SetIOThreadState(TestIOThreadState* io_thread_state) { |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 REDIRECT_MODE_302, | 463 REDIRECT_MODE_302, |
466 web_contents()->GetRenderViewHost()->GetProcess()->GetID(), | 464 web_contents()->GetRenderViewHost()->GetProcess()->GetID(), |
467 web_contents()->GetMainFrame()->GetRoutingID(), | 465 web_contents()->GetMainFrame()->GetRoutingID(), |
468 base::Unretained(&defer))); | 466 base::Unretained(&defer))); |
469 | 467 |
470 // Wait for the request to finish processing. | 468 // Wait for the request to finish processing. |
471 base::RunLoop().RunUntilIdle(); | 469 base::RunLoop().RunUntilIdle(); |
472 } | 470 } |
473 | 471 |
474 } // namespace navigation_interception | 472 } // namespace navigation_interception |
OLD | NEW |