| OLD | NEW |
| 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 Loading... |
| 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_impl.h" |
| 47 #include "net/url_request/url_request_job_factory.h" | 48 #include "net/url_request/url_request_job_factory.h" |
| 48 #include "webkit/blob/blob_data.h" | 49 #include "webkit/blob/blob_data.h" |
| 49 #include "webkit/blob/blob_storage_controller.h" | 50 #include "webkit/blob/blob_storage_controller.h" |
| 50 #include "webkit/blob/blob_url_request_job.h" | 51 #include "webkit/blob/blob_url_request_job.h" |
| 51 #include "webkit/fileapi/file_system_context.h" | 52 #include "webkit/fileapi/file_system_context.h" |
| 52 #include "webkit/fileapi/file_system_operation.h" | 53 #include "webkit/fileapi/file_system_operation.h" |
| 53 #include "webkit/fileapi/file_system_url.h" | 54 #include "webkit/fileapi/file_system_url.h" |
| 54 | 55 |
| 55 using content::BrowserContext; | 56 using content::BrowserContext; |
| 56 using content::BrowserThread; | 57 using content::BrowserThread; |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 set_job_factory(&job_factory_); | 652 set_job_factory(&job_factory_); |
| 652 } | 653 } |
| 653 | 654 |
| 654 virtual ~TestURLRequestContext() {} | 655 virtual ~TestURLRequestContext() {} |
| 655 | 656 |
| 656 webkit_blob::BlobStorageController* blob_storage_controller() const { | 657 webkit_blob::BlobStorageController* blob_storage_controller() const { |
| 657 return blob_storage_controller_.get(); | 658 return blob_storage_controller_.get(); |
| 658 } | 659 } |
| 659 | 660 |
| 660 private: | 661 private: |
| 661 net::URLRequestJobFactory job_factory_; | 662 net::URLRequestJobFactoryImpl job_factory_; |
| 662 scoped_ptr<webkit_blob::BlobStorageController> blob_storage_controller_; | 663 scoped_ptr<webkit_blob::BlobStorageController> blob_storage_controller_; |
| 663 | 664 |
| 664 DISALLOW_COPY_AND_ASSIGN(TestURLRequestContext); | 665 DISALLOW_COPY_AND_ASSIGN(TestURLRequestContext); |
| 665 }; | 666 }; |
| 666 | 667 |
| 667 // TODO(benjhayden): Comment. | 668 // TODO(benjhayden): Comment. |
| 668 class HTML5FileWriter { | 669 class HTML5FileWriter { |
| 669 public: | 670 public: |
| 670 HTML5FileWriter( | 671 HTML5FileWriter( |
| 671 Profile* profile, | 672 Profile* profile, |
| (...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2083 " \"state\": {" | 2084 " \"state\": {" |
| 2084 " \"previous\": \"in_progress\"," | 2085 " \"previous\": \"in_progress\"," |
| 2085 " \"current\": \"complete\"}}]", | 2086 " \"current\": \"complete\"}}]", |
| 2086 result_id, | 2087 result_id, |
| 2087 GetFilename("on_record.txt.crdownload").c_str(), | 2088 GetFilename("on_record.txt.crdownload").c_str(), |
| 2088 GetFilename("on_record.txt").c_str()))); | 2089 GetFilename("on_record.txt").c_str()))); |
| 2089 std::string disk_data; | 2090 std::string disk_data; |
| 2090 EXPECT_TRUE(file_util::ReadFileToString(item->GetFullPath(), &disk_data)); | 2091 EXPECT_TRUE(file_util::ReadFileToString(item->GetFullPath(), &disk_data)); |
| 2091 EXPECT_STREQ(kPayloadData, disk_data.c_str()); | 2092 EXPECT_STREQ(kPayloadData, disk_data.c_str()); |
| 2092 } | 2093 } |
| OLD | NEW |