| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/message_loop_proxy.h" | 5 #include "base/message_loop_proxy.h" |
| 6 #include "base/thread.h" | 6 #include "base/thread.h" |
| 7 #include "base/waitable_event.h" | 7 #include "base/waitable_event.h" |
| 8 #include "chrome/common/chrome_plugin_lib.h" | 8 #include "chrome/common/chrome_plugin_lib.h" |
| 9 #include "chrome/common/net/url_fetcher.h" | 9 #include "chrome/common/net/url_fetcher.h" |
| 10 #include "chrome/common/net/url_fetcher_protect.h" | 10 #include "chrome/common/net/url_fetcher_protect.h" |
| 11 #include "chrome/common/net/url_request_context_getter.h" | 11 #include "chrome/common/net/url_request_context_getter.h" |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 URLFetcherTest::OnURLFetchComplete(source, url, status, response_code, | 329 URLFetcherTest::OnURLFetchComplete(source, url, status, response_code, |
| 330 cookies, data); | 330 cookies, data); |
| 331 } | 331 } |
| 332 } | 332 } |
| 333 } | 333 } |
| 334 | 334 |
| 335 void URLFetcherProtectTestPassedThrough::CreateFetcher(const GURL& url) { | 335 void URLFetcherProtectTestPassedThrough::CreateFetcher(const GURL& url) { |
| 336 fetcher_ = new URLFetcher(url, URLFetcher::GET, this); | 336 fetcher_ = new URLFetcher(url, URLFetcher::GET, this); |
| 337 fetcher_->set_request_context(new TestURLRequestContextGetter( | 337 fetcher_->set_request_context(new TestURLRequestContextGetter( |
| 338 io_message_loop_proxy())); | 338 io_message_loop_proxy())); |
| 339 fetcher_->set_automatcally_retry_on_5xx(false); | 339 fetcher_->set_automatically_retry_on_5xx(false); |
| 340 start_time_ = Time::Now(); | 340 start_time_ = Time::Now(); |
| 341 fetcher_->Start(); | 341 fetcher_->Start(); |
| 342 } | 342 } |
| 343 | 343 |
| 344 void URLFetcherProtectTestPassedThrough::OnURLFetchComplete( | 344 void URLFetcherProtectTestPassedThrough::OnURLFetchComplete( |
| 345 const URLFetcher* source, | 345 const URLFetcher* source, |
| 346 const GURL& url, | 346 const GURL& url, |
| 347 const URLRequestStatus& status, | 347 const URLRequestStatus& status, |
| 348 int response_code, | 348 int response_code, |
| 349 const ResponseCookies& cookies, | 349 const ResponseCookies& cookies, |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 // time difference from now). | 604 // time difference from now). |
| 605 | 605 |
| 606 base::Thread t("URLFetcher test thread"); | 606 base::Thread t("URLFetcher test thread"); |
| 607 ASSERT_TRUE(t.Start()); | 607 ASSERT_TRUE(t.Start()); |
| 608 t.message_loop()->PostTask(FROM_HERE, new FetcherWrapperTask(this, url)); | 608 t.message_loop()->PostTask(FROM_HERE, new FetcherWrapperTask(this, url)); |
| 609 | 609 |
| 610 MessageLoop::current()->Run(); | 610 MessageLoop::current()->Run(); |
| 611 } | 611 } |
| 612 | 612 |
| 613 } // namespace. | 613 } // namespace. |
| OLD | NEW |