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/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 operation()->CreateFile(fs_->CrackURL(GURL(root_ + filename_)), | 802 operation()->CreateFile(fs_->CrackURL(GURL(root_ + filename_)), |
803 kExclusive, base::Bind( | 803 kExclusive, base::Bind( |
804 &HTML5FileWriter::CreateFileCallback, base::Unretained(this))); | 804 &HTML5FileWriter::CreateFileCallback, base::Unretained(this))); |
805 } | 805 } |
806 | 806 |
807 void CreateFileCallback(base::PlatformFileError result) { | 807 void CreateFileCallback(base::PlatformFileError result) { |
808 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 808 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
809 CHECK_EQ(base::PLATFORM_FILE_OK, result); | 809 CHECK_EQ(base::PLATFORM_FILE_OK, result); |
810 blob_data_->AppendData(payload_); | 810 blob_data_->AppendData(payload_); |
811 url_request_context_.reset(new TestURLRequestContext(fs_)); | 811 url_request_context_.reset(new TestURLRequestContext(fs_)); |
812 url_request_context_->blob_storage_controller()->AddFinishedBlob( | 812 url_request_context_->blob_storage_controller() |
813 blob_url(), blob_data_); | 813 ->AddFinishedBlob(blob_url(), blob_data_.get()); |
814 operation()->Write( | 814 operation()->Write( |
815 url_request_context_.get(), | 815 url_request_context_.get(), |
816 fs_->CrackURL(GURL(root_ + filename_)), | 816 fs_->CrackURL(GURL(root_ + filename_)), |
817 blob_url(), | 817 blob_url(), |
818 0, // offset | 818 0, // offset |
819 base::Bind(&HTML5FileWriter::WriteCallback, base::Unretained(this))); | 819 base::Bind(&HTML5FileWriter::WriteCallback, base::Unretained(this))); |
820 } | 820 } |
821 | 821 |
822 void WriteCallback( | 822 void WriteCallback( |
823 base::PlatformFileError result, | 823 base::PlatformFileError result, |
(...skipping 2654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3478 DownloadsApiTest() {} | 3478 DownloadsApiTest() {} |
3479 virtual ~DownloadsApiTest() {} | 3479 virtual ~DownloadsApiTest() {} |
3480 private: | 3480 private: |
3481 DISALLOW_COPY_AND_ASSIGN(DownloadsApiTest); | 3481 DISALLOW_COPY_AND_ASSIGN(DownloadsApiTest); |
3482 }; | 3482 }; |
3483 | 3483 |
3484 | 3484 |
3485 IN_PROC_BROWSER_TEST_F(DownloadsApiTest, DownloadsApiTest) { | 3485 IN_PROC_BROWSER_TEST_F(DownloadsApiTest, DownloadsApiTest) { |
3486 ASSERT_TRUE(RunExtensionTest("downloads")) << message_; | 3486 ASSERT_TRUE(RunExtensionTest("downloads")) << message_; |
3487 } | 3487 } |
OLD | NEW |