Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5779)

Unified Diff: chrome/browser/net/url_request_slow_http_job.cc

Issue 7149013: Remove most of the remaining test dependencies (other than chrome/test). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/net/url_request_slow_http_job.h ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/url_request_slow_http_job.cc
===================================================================
--- chrome/browser/net/url_request_slow_http_job.cc (revision 88946)
+++ chrome/browser/net/url_request_slow_http_job.cc (working copy)
@@ -1,62 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/net/url_request_slow_http_job.h"
-
-#include "base/time.h"
-#include "base/utf_string_conversions.h"
-#include "net/url_request/url_request_filter.h"
-
-static const char kMockHostname[] = "mock.slow.http";
-
-FilePath URLRequestSlowHTTPJob::base_path_;
-
-// static
-const int URLRequestSlowHTTPJob::kDelayMs = 1000;
-
-using base::TimeDelta;
-
-/* static */
-net::URLRequestJob* URLRequestSlowHTTPJob::Factory(net::URLRequest* request,
- const std::string& scheme) {
- return new URLRequestSlowHTTPJob(request,
- GetOnDiskPath(base_path_, request, scheme));
-}
-
-/* static */
-void URLRequestSlowHTTPJob::AddUrlHandler(const FilePath& base_path) {
- base_path_ = base_path;
-
- // Add kMockHostname to net::URLRequestFilter.
- net::URLRequestFilter* filter = net::URLRequestFilter::GetInstance();
- filter->AddHostnameHandler("http", kMockHostname,
- URLRequestSlowHTTPJob::Factory);
-}
-
-/* static */
-GURL URLRequestSlowHTTPJob::GetMockUrl(const FilePath& path) {
- std::string url = "http://";
- url.append(kMockHostname);
- url.append("/");
- std::string path_str = path.MaybeAsASCII();
- DCHECK(!path_str.empty()); // We only expect ASCII paths in tests.
- url.append(path_str);
- return GURL(url);
-}
-
-URLRequestSlowHTTPJob::URLRequestSlowHTTPJob(net::URLRequest* request,
- const FilePath& file_path)
- : URLRequestMockHTTPJob(request, file_path) { }
-
-void URLRequestSlowHTTPJob::Start() {
- delay_timer_.Start(TimeDelta::FromMilliseconds(kDelayMs), this,
- &URLRequestSlowHTTPJob::RealStart);
-}
-
-URLRequestSlowHTTPJob::~URLRequestSlowHTTPJob() {
-}
-
-void URLRequestSlowHTTPJob::RealStart() {
- URLRequestMockHTTPJob::Start();
-}
« no previous file with comments | « chrome/browser/net/url_request_slow_http_job.h ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698