| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h" | 5 #include "chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 } | 147 } |
| 148 | 148 |
| 149 OfflinePageMHTMLArchiverTest::~OfflinePageMHTMLArchiverTest() { | 149 OfflinePageMHTMLArchiverTest::~OfflinePageMHTMLArchiverTest() { |
| 150 } | 150 } |
| 151 | 151 |
| 152 std::unique_ptr<TestMHTMLArchiver> OfflinePageMHTMLArchiverTest::CreateArchive( | 152 std::unique_ptr<TestMHTMLArchiver> OfflinePageMHTMLArchiverTest::CreateArchive( |
| 153 const GURL& url, | 153 const GURL& url, |
| 154 TestMHTMLArchiver::TestScenario scenario) { | 154 TestMHTMLArchiver::TestScenario scenario) { |
| 155 std::unique_ptr<TestMHTMLArchiver> archiver( | 155 std::unique_ptr<TestMHTMLArchiver> archiver( |
| 156 new TestMHTMLArchiver(url, scenario)); | 156 new TestMHTMLArchiver(url, scenario)); |
| 157 std::string extra_data; |
| 157 archiver->CreateArchive(GetTestFilePath(), | 158 archiver->CreateArchive(GetTestFilePath(), |
| 158 OfflinePageArchiver::CreateArchiveParams(), | 159 OfflinePageArchiver::CreateArchiveParams(), |
| 159 callback()); | 160 extra_data, callback()); |
| 160 PumpLoop(); | 161 PumpLoop(); |
| 161 return archiver; | 162 return archiver; |
| 162 } | 163 } |
| 163 | 164 |
| 164 void OfflinePageMHTMLArchiverTest::OnCreateArchiveDone( | 165 void OfflinePageMHTMLArchiverTest::OnCreateArchiveDone( |
| 165 OfflinePageArchiver* archiver, | 166 OfflinePageArchiver* archiver, |
| 166 OfflinePageArchiver::ArchiverResult result, | 167 OfflinePageArchiver::ArchiverResult result, |
| 167 const GURL& url, | 168 const GURL& url, |
| 168 const base::FilePath& file_path, | 169 const base::FilePath& file_path, |
| 169 const base::string16& title, | 170 const base::string16& title, |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 PumpLoop(); | 226 PumpLoop(); |
| 226 | 227 |
| 227 EXPECT_EQ(archiver.get(), last_archiver()); | 228 EXPECT_EQ(archiver.get(), last_archiver()); |
| 228 EXPECT_EQ(OfflinePageArchiver::ArchiverResult::SUCCESSFULLY_CREATED, | 229 EXPECT_EQ(OfflinePageArchiver::ArchiverResult::SUCCESSFULLY_CREATED, |
| 229 last_result()); | 230 last_result()); |
| 230 EXPECT_EQ(GetTestFilePath(), last_file_path()); | 231 EXPECT_EQ(GetTestFilePath(), last_file_path()); |
| 231 EXPECT_EQ(kTestFileSize, last_file_size()); | 232 EXPECT_EQ(kTestFileSize, last_file_size()); |
| 232 } | 233 } |
| 233 | 234 |
| 234 } // namespace offline_pages | 235 } // namespace offline_pages |
| OLD | NEW |