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

Side by Side Diff: chrome/browser/extensions/api/downloads/downloads_api_unittest.cc

Issue 10836248: Turned job_factory into a pure virtual class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleaned up, responded to suggestions Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <algorithm> 5 #include <algorithm>
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 26 matching lines...) Expand all
37 #include "content/public/browser/notification_service.h" 37 #include "content/public/browser/notification_service.h"
38 #include "content/public/browser/web_contents.h" 38 #include "content/public/browser/web_contents.h"
39 #include "content/public/common/page_transition_types.h" 39 #include "content/public/common/page_transition_types.h"
40 #include "content/public/test/download_test_observer.h" 40 #include "content/public/test/download_test_observer.h"
41 #include "content/test/net/url_request_slow_download_job.h" 41 #include "content/test/net/url_request_slow_download_job.h"
42 #include "net/base/data_url.h" 42 #include "net/base/data_url.h"
43 #include "net/base/net_util.h" 43 #include "net/base/net_util.h"
44 #include "net/url_request/url_request.h" 44 #include "net/url_request/url_request.h"
45 #include "net/url_request/url_request_context.h" 45 #include "net/url_request/url_request_context.h"
46 #include "net/url_request/url_request_job.h" 46 #include "net/url_request/url_request_job.h"
47 #include "net/url_request/url_request_job_factory.h" 47 #include "net/url_request/url_request_job_factory_impl.h"
48 #include "ui/gfx/codec/png_codec.h" 48 #include "ui/gfx/codec/png_codec.h"
49 #include "webkit/blob/blob_data.h" 49 #include "webkit/blob/blob_data.h"
50 #include "webkit/blob/blob_storage_controller.h" 50 #include "webkit/blob/blob_storage_controller.h"
51 #include "webkit/blob/blob_url_request_job.h" 51 #include "webkit/blob/blob_url_request_job.h"
52 #include "webkit/fileapi/file_system_context.h" 52 #include "webkit/fileapi/file_system_context.h"
53 #include "webkit/fileapi/file_system_operation_interface.h" 53 #include "webkit/fileapi/file_system_operation_interface.h"
54 #include "webkit/fileapi/file_system_url.h" 54 #include "webkit/fileapi/file_system_url.h"
55 55
56 using content::BrowserContext; 56 using content::BrowserContext;
57 using content::BrowserThread; 57 using content::BrowserThread;
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 set_job_factory(&job_factory_); 673 set_job_factory(&job_factory_);
674 } 674 }
675 675
676 virtual ~TestURLRequestContext() {} 676 virtual ~TestURLRequestContext() {}
677 677
678 webkit_blob::BlobStorageController* blob_storage_controller() const { 678 webkit_blob::BlobStorageController* blob_storage_controller() const {
679 return blob_storage_controller_.get(); 679 return blob_storage_controller_.get();
680 } 680 }
681 681
682 private: 682 private:
683 net::URLRequestJobFactory job_factory_; 683 net::URLRequestJobFactoryImpl job_factory_;
684 scoped_ptr<webkit_blob::BlobStorageController> blob_storage_controller_; 684 scoped_ptr<webkit_blob::BlobStorageController> blob_storage_controller_;
685 685
686 DISALLOW_COPY_AND_ASSIGN(TestURLRequestContext); 686 DISALLOW_COPY_AND_ASSIGN(TestURLRequestContext);
687 }; 687 };
688 688
689 // TODO(benjhayden): Comment. 689 // TODO(benjhayden): Comment.
690 class HTML5FileWriter { 690 class HTML5FileWriter {
691 public: 691 public:
692 HTML5FileWriter( 692 HTML5FileWriter(
693 Profile* profile, 693 Profile* profile,
(...skipping 1461 matching lines...) Expand 10 before | Expand all | Expand 10 after
2155 " \"state\": {" 2155 " \"state\": {"
2156 " \"previous\": \"in_progress\"," 2156 " \"previous\": \"in_progress\","
2157 " \"current\": \"complete\"}}]", 2157 " \"current\": \"complete\"}}]",
2158 result_id, 2158 result_id,
2159 GetFilename("on_record.txt.crdownload").c_str(), 2159 GetFilename("on_record.txt.crdownload").c_str(),
2160 GetFilename("on_record.txt").c_str()))); 2160 GetFilename("on_record.txt").c_str())));
2161 std::string disk_data; 2161 std::string disk_data;
2162 EXPECT_TRUE(file_util::ReadFileToString(item->GetFullPath(), &disk_data)); 2162 EXPECT_TRUE(file_util::ReadFileToString(item->GetFullPath(), &disk_data));
2163 EXPECT_STREQ(kPayloadData, disk_data.c_str()); 2163 EXPECT_STREQ(kPayloadData, disk_data.c_str());
2164 } 2164 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_protocols_unittest.cc » ('j') | net/url_request/http_intercept_job_factory.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698