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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
7 #include "base/message_loop_proxy.h" | 7 #include "base/message_loop_proxy.h" |
8 #include "base/synchronization/waitable_event.h" | 8 #include "base/synchronization/waitable_event.h" |
9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 using base::TimeDelta; | 22 using base::TimeDelta; |
23 | 23 |
24 namespace cloud_print { | 24 namespace cloud_print { |
25 | 25 |
26 const FilePath::CharType kDocRoot[] = FILE_PATH_LITERAL("chrome/test/data"); | 26 const FilePath::CharType kDocRoot[] = FILE_PATH_LITERAL("chrome/test/data"); |
27 | 27 |
28 int g_request_context_getter_instances = 0; | 28 int g_request_context_getter_instances = 0; |
29 class TrackingTestURLRequestContextGetter | 29 class TrackingTestURLRequestContextGetter |
30 : public net::TestURLRequestContextGetter { | 30 : public net::TestURLRequestContextGetter { |
31 public: | 31 public: |
32 explicit TrackingTestURLRequestContextGetter( | 32 TrackingTestURLRequestContextGetter( |
33 base::MessageLoopProxy* io_message_loop_proxy, | 33 base::MessageLoopProxy* io_message_loop_proxy, |
34 net::URLRequestThrottlerManager* throttler_manager) | 34 net::URLRequestThrottlerManager* throttler_manager) |
35 : TestURLRequestContextGetter(io_message_loop_proxy), | 35 : TestURLRequestContextGetter(io_message_loop_proxy), |
36 throttler_manager_(throttler_manager), | 36 throttler_manager_(throttler_manager), |
37 context_(NULL) { | 37 context_(NULL) { |
38 g_request_context_getter_instances++; | 38 g_request_context_getter_instances++; |
39 } | 39 } |
40 | 40 |
41 virtual net::TestURLRequestContext* GetURLRequestContext() OVERRIDE { | 41 virtual net::TestURLRequestContext* GetURLRequestContext() OVERRIDE { |
42 if (!context_.get()) { | 42 if (!context_.get()) { |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 FilePath(kDocRoot)); | 369 FilePath(kDocRoot)); |
370 ASSERT_TRUE(test_server.Start()); | 370 ASSERT_TRUE(test_server.Start()); |
371 | 371 |
372 GURL url(test_server.GetURL("defaultresponse")); | 372 GURL url(test_server.GetURL("defaultresponse")); |
373 CreateFetcher(url, 11); | 373 CreateFetcher(url, 11); |
374 | 374 |
375 MessageLoop::current()->Run(); | 375 MessageLoop::current()->Run(); |
376 } | 376 } |
377 | 377 |
378 } // namespace cloud_print | 378 } // namespace cloud_print |
OLD | NEW |