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 10870040: Rename FileSystemOperationInterface to FileSystemOperation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
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.h"
48 #include "webkit/blob/blob_data.h" 48 #include "webkit/blob/blob_data.h"
49 #include "webkit/blob/blob_storage_controller.h" 49 #include "webkit/blob/blob_storage_controller.h"
50 #include "webkit/blob/blob_url_request_job.h" 50 #include "webkit/blob/blob_url_request_job.h"
51 #include "webkit/fileapi/file_system_context.h" 51 #include "webkit/fileapi/file_system_context.h"
52 #include "webkit/fileapi/file_system_operation_interface.h" 52 #include "webkit/fileapi/file_system_operation.h"
53 #include "webkit/fileapi/file_system_url.h" 53 #include "webkit/fileapi/file_system_url.h"
54 54
55 using content::BrowserContext; 55 using content::BrowserContext;
56 using content::BrowserThread; 56 using content::BrowserThread;
57 using content::DownloadItem; 57 using content::DownloadItem;
58 using content::DownloadManager; 58 using content::DownloadManager;
59 using content::DownloadPersistentStoreInfo; 59 using content::DownloadPersistentStoreInfo;
60 60
61 namespace events = extensions::event_names; 61 namespace events = extensions::event_names;
62 62
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 void OpenFileSystemCallback( 711 void OpenFileSystemCallback(
712 base::PlatformFileError result, 712 base::PlatformFileError result,
713 const std::string& fs_name, 713 const std::string& fs_name,
714 const GURL& root) { 714 const GURL& root) {
715 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 715 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
716 root_ = root.spec(); 716 root_ = root.spec();
717 CHECK(BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind( 717 CHECK(BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind(
718 &HTML5FileWriter::CreateFile, base::Unretained(this)))); 718 &HTML5FileWriter::CreateFile, base::Unretained(this))));
719 } 719 }
720 720
721 fileapi::FileSystemOperationInterface* operation() { 721 fileapi::FileSystemOperation* operation() {
722 return fs_->CreateFileSystemOperation(fileapi::FileSystemURL(GURL(root_))); 722 return fs_->CreateFileSystemOperation(fileapi::FileSystemURL(GURL(root_)));
723 } 723 }
724 724
725 void CreateFile() { 725 void CreateFile() {
726 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 726 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
727 operation()->CreateFile(fileapi::FileSystemURL(GURL(root_ + filename_)), 727 operation()->CreateFile(fileapi::FileSystemURL(GURL(root_ + filename_)),
728 kExclusive, base::Bind( 728 kExclusive, base::Bind(
729 &HTML5FileWriter::CreateFileCallback, base::Unretained(this))); 729 &HTML5FileWriter::CreateFileCallback, base::Unretained(this)));
730 } 730 }
731 731
(...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after
2081 " \"state\": {" 2081 " \"state\": {"
2082 " \"previous\": \"in_progress\"," 2082 " \"previous\": \"in_progress\","
2083 " \"current\": \"complete\"}}]", 2083 " \"current\": \"complete\"}}]",
2084 result_id, 2084 result_id,
2085 GetFilename("on_record.txt.crdownload").c_str(), 2085 GetFilename("on_record.txt.crdownload").c_str(),
2086 GetFilename("on_record.txt").c_str()))); 2086 GetFilename("on_record.txt").c_str())));
2087 std::string disk_data; 2087 std::string disk_data;
2088 EXPECT_TRUE(file_util::ReadFileToString(item->GetFullPath(), &disk_data)); 2088 EXPECT_TRUE(file_util::ReadFileToString(item->GetFullPath(), &disk_data));
2089 EXPECT_STREQ(kPayloadData, disk_data.c_str()); 2089 EXPECT_STREQ(kPayloadData, disk_data.c_str());
2090 } 2090 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698