OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/thread.h" | 5 #include "base/thread.h" |
6 #include "base/time.h" | 6 #include "base/time.h" |
7 #include "chrome/browser/url_fetcher.h" | 7 #include "chrome/browser/url_fetcher.h" |
8 #include "chrome/browser/url_fetcher_protect.h" | 8 #include "chrome/browser/url_fetcher_protect.h" |
9 #include "net/url_request/url_request_unittest.h" | 9 #include "net/url_request/url_request_unittest.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 URLFetcherTest::OnURLFetchComplete(source, url, status, response_code, | 256 URLFetcherTest::OnURLFetchComplete(source, url, status, response_code, |
257 cookies, data); | 257 cookies, data); |
258 } | 258 } |
259 } | 259 } |
260 } | 260 } |
261 | 261 |
262 URLFetcherBadHTTPSTest::URLFetcherBadHTTPSTest() { | 262 URLFetcherBadHTTPSTest::URLFetcherBadHTTPSTest() { |
263 PathService::Get(base::DIR_SOURCE_ROOT, &cert_dir_); | 263 PathService::Get(base::DIR_SOURCE_ROOT, &cert_dir_); |
264 cert_dir_ += L"/chrome/test/data/ssl/certificates/"; | 264 cert_dir_ += L"/chrome/test/data/ssl/certificates/"; |
265 std::replace(cert_dir_.begin(), cert_dir_.end(), | 265 std::replace(cert_dir_.begin(), cert_dir_.end(), |
266 L'/', file_util::kPathSeparator); | 266 L'/', FilePath::kSeparators[0]); |
267 } | 267 } |
268 | 268 |
269 // The "server certificate expired" error should result in automatic | 269 // The "server certificate expired" error should result in automatic |
270 // cancellation of the request by | 270 // cancellation of the request by |
271 // URLRequest::Delegate::OnSSLCertificateError. | 271 // URLRequest::Delegate::OnSSLCertificateError. |
272 void URLFetcherBadHTTPSTest::OnURLFetchComplete( | 272 void URLFetcherBadHTTPSTest::OnURLFetchComplete( |
273 const URLFetcher* source, | 273 const URLFetcher* source, |
274 const GURL& url, | 274 const GURL& url, |
275 const URLRequestStatus& status, | 275 const URLRequestStatus& status, |
276 int response_code, | 276 int response_code, |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 // (main) thread will do the IO, and when the fetch is complete it will | 433 // (main) thread will do the IO, and when the fetch is complete it will |
434 // terminate the main thread's message loop; then the other thread's | 434 // terminate the main thread's message loop; then the other thread's |
435 // message loop will be shut down automatically as the thread goes out of | 435 // message loop will be shut down automatically as the thread goes out of |
436 // scope. | 436 // scope. |
437 base::Thread t("URLFetcher test thread"); | 437 base::Thread t("URLFetcher test thread"); |
438 t.Start(); | 438 t.Start(); |
439 t.message_loop()->PostTask(FROM_HERE, new FetcherWrapperTask(this, url)); | 439 t.message_loop()->PostTask(FROM_HERE, new FetcherWrapperTask(this, url)); |
440 | 440 |
441 MessageLoop::current()->Run(); | 441 MessageLoop::current()->Run(); |
442 } | 442 } |
OLD | NEW |