OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/service/cloud_print/cloud_print_url_fetcher.h" | 10 #include "chrome/service/cloud_print/cloud_print_url_fetcher.h" |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 // http://code.google.com/p/chromium/issues/detail?id=60426 | 303 // http://code.google.com/p/chromium/issues/detail?id=60426 |
304 TEST_F(CloudPrintURLFetcherBasicTest, FLAKY_HandleRawData) { | 304 TEST_F(CloudPrintURLFetcherBasicTest, FLAKY_HandleRawData) { |
305 net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot)); | 305 net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot)); |
306 ASSERT_TRUE(test_server.Start()); | 306 ASSERT_TRUE(test_server.Start()); |
307 | 307 |
308 SetHandleRawData(true); | 308 SetHandleRawData(true); |
309 CreateFetcher(test_server.GetURL("echo"), 0); | 309 CreateFetcher(test_server.GetURL("echo"), 0); |
310 MessageLoop::current()->Run(); | 310 MessageLoop::current()->Run(); |
311 } | 311 } |
312 | 312 |
313 // http://code.google.com/p/chromium/issues/detail?id=78440 | 313 TEST_F(CloudPrintURLFetcherOverloadTest, Protect) { |
314 TEST_F(CloudPrintURLFetcherOverloadTest, FLAKY_Protect) { | |
315 net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot)); | 314 net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot)); |
316 ASSERT_TRUE(test_server.Start()); | 315 ASSERT_TRUE(test_server.Start()); |
317 | 316 |
318 GURL url(test_server.GetURL("defaultresponse")); | 317 GURL url(test_server.GetURL("defaultresponse")); |
319 | 318 |
320 // Registers an entry for test url. It only allows 3 requests to be sent | 319 // Registers an entry for test url. It only allows 3 requests to be sent |
321 // in 200 milliseconds. | 320 // in 200 milliseconds. |
322 net::URLRequestThrottlerManager* manager = | 321 net::URLRequestThrottlerManager* manager = |
323 net::URLRequestThrottlerManager::GetInstance(); | 322 net::URLRequestThrottlerManager::GetInstance(); |
324 scoped_refptr<net::URLRequestThrottlerEntry> entry( | 323 scoped_refptr<net::URLRequestThrottlerEntry> entry( |
(...skipping 25 matching lines...) Expand all Loading... |
350 manager->OverrideEntryForTests(url, entry); | 349 manager->OverrideEntryForTests(url, entry); |
351 | 350 |
352 CreateFetcher(url, 11); | 351 CreateFetcher(url, 11); |
353 | 352 |
354 MessageLoop::current()->Run(); | 353 MessageLoop::current()->Run(); |
355 | 354 |
356 net::URLRequestThrottlerManager::GetInstance()->EraseEntryForTests(url); | 355 net::URLRequestThrottlerManager::GetInstance()->EraseEntryForTests(url); |
357 } | 356 } |
358 | 357 |
359 } // namespace. | 358 } // namespace. |
OLD | NEW |