| OLD | NEW |
| 1 // Copyright (c) 2010 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/message_loop_proxy.h" | 6 #include "base/message_loop_proxy.h" |
| 7 #include "base/ref_counted.h" | 7 #include "base/ref_counted.h" |
| 8 #include "base/thread.h" | 8 #include "base/thread.h" |
| 9 #include "base/waitable_event.h" | 9 #include "base/waitable_event.h" |
| 10 #include "chrome/common/net/url_request_context_getter.h" | 10 #include "chrome/common/net/url_request_context_getter.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 } | 60 } |
| 61 | 61 |
| 62 virtual URLRequestContextGetter* GetRequestContextGetter() { | 62 virtual URLRequestContextGetter* GetRequestContextGetter() { |
| 63 return new TestURLRequestContextGetter(io_message_loop_proxy_.get()); | 63 return new TestURLRequestContextGetter(io_message_loop_proxy_.get()); |
| 64 } | 64 } |
| 65 private: | 65 private: |
| 66 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; | 66 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 class CloudPrintURLFetcherTest : public testing::Test, | 69 class CloudPrintURLFetcherTest : public testing::Test, |
| 70 public CloudPrintURLFetcher::Delegate { | 70 public CloudPrintURLFetcherDelegate { |
| 71 public: | 71 public: |
| 72 CloudPrintURLFetcherTest() : max_retries_(0), fetcher_(NULL) { } | 72 CloudPrintURLFetcherTest() : max_retries_(0), fetcher_(NULL) { } |
| 73 | 73 |
| 74 // Creates a URLFetcher, using the program's main thread to do IO. | 74 // Creates a URLFetcher, using the program's main thread to do IO. |
| 75 virtual void CreateFetcher(const GURL& url, int max_retries); | 75 virtual void CreateFetcher(const GURL& url, int max_retries); |
| 76 | 76 |
| 77 // CloudPrintURLFetcher::Delegate | 77 // CloudPrintURLFetcher::Delegate |
| 78 virtual CloudPrintURLFetcher::ResponseAction HandleRawResponse( | 78 virtual CloudPrintURLFetcher::ResponseAction HandleRawResponse( |
| 79 const URLFetcher* source, | 79 const URLFetcher* source, |
| 80 const GURL& url, | 80 const GURL& url, |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 url, entry); | 347 url, entry); |
| 348 | 348 |
| 349 CreateFetcher(url, 11); | 349 CreateFetcher(url, 11); |
| 350 | 350 |
| 351 MessageLoop::current()->Run(); | 351 MessageLoop::current()->Run(); |
| 352 | 352 |
| 353 net::URLRequestThrottlerManager::GetInstance()->EraseEntryForTests(url); | 353 net::URLRequestThrottlerManager::GetInstance()->EraseEntryForTests(url); |
| 354 } | 354 } |
| 355 | 355 |
| 356 } // namespace. | 356 } // namespace. |
| OLD | NEW |