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/common/net/url_request_context_getter.h" | 10 #include "chrome/common/net/url_request_context_getter.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 TEST_F(CloudPrintURLFetcherOverloadTest, Protect) { | 313 // http://code.google.com/p/chromium/issues/detail?id=78440 |
| 314 TEST_F(CloudPrintURLFetcherOverloadTest, FLAKY_Protect) { |
314 net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot)); | 315 net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot)); |
315 ASSERT_TRUE(test_server.Start()); | 316 ASSERT_TRUE(test_server.Start()); |
316 | 317 |
317 GURL url(test_server.GetURL("defaultresponse")); | 318 GURL url(test_server.GetURL("defaultresponse")); |
318 | 319 |
319 // Registers an entry for test url. It only allows 3 requests to be sent | 320 // Registers an entry for test url. It only allows 3 requests to be sent |
320 // in 200 milliseconds. | 321 // in 200 milliseconds. |
321 net::URLRequestThrottlerManager* manager = | 322 net::URLRequestThrottlerManager* manager = |
322 net::URLRequestThrottlerManager::GetInstance(); | 323 net::URLRequestThrottlerManager::GetInstance(); |
323 scoped_refptr<net::URLRequestThrottlerEntry> entry( | 324 scoped_refptr<net::URLRequestThrottlerEntry> entry( |
(...skipping 25 matching lines...) Expand all Loading... |
349 manager->OverrideEntryForTests(url, entry); | 350 manager->OverrideEntryForTests(url, entry); |
350 | 351 |
351 CreateFetcher(url, 11); | 352 CreateFetcher(url, 11); |
352 | 353 |
353 MessageLoop::current()->Run(); | 354 MessageLoop::current()->Run(); |
354 | 355 |
355 net::URLRequestThrottlerManager::GetInstance()->EraseEntryForTests(url); | 356 net::URLRequestThrottlerManager::GetInstance()->EraseEntryForTests(url); |
356 } | 357 } |
357 | 358 |
358 } // namespace. | 359 } // namespace. |
OLD | NEW |