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 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/files/scoped_temp_dir.h" | 13 #include "base/files/scoped_temp_dir.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/run_loop.h" | 16 #include "base/run_loop.h" |
17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
18 #include "base/test/test_simple_task_runner.h" | 18 #include "base/test/test_simple_task_runner.h" |
19 #include "base/thread_task_runner_handle.h" | 19 #include "base/threading/thread_task_runner_handle.h" |
20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
21 | 21 |
22 namespace offline_pages { | 22 namespace offline_pages { |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 const char kTestURL[] = "http://example.com/"; | 26 const char kTestURL[] = "http://example.com/"; |
27 const base::FilePath::CharType kTestFilePath[] = FILE_PATH_LITERAL( | 27 const base::FilePath::CharType kTestFilePath[] = FILE_PATH_LITERAL( |
28 "/archive_dir/offline_page.mhtml"); | 28 "/archive_dir/offline_page.mhtml"); |
29 const int64_t kTestFileSize = 123456LL; | 29 const int64_t kTestFileSize = 123456LL; |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 base::FilePath expected_3( | 258 base::FilePath expected_3( |
259 FILE_PATH_LITERAL("www.google.com-" + | 259 FILE_PATH_LITERAL("www.google.com-" + |
260 expected_title_3_part + | 260 expected_title_3_part + |
261 "-123456789.mhtml")); | 261 "-123456789.mhtml")); |
262 base::FilePath actual_3( | 262 base::FilePath actual_3( |
263 OfflinePageMHTMLArchiver::GenerateFileName(url_3, title_3, 123456789LL)); | 263 OfflinePageMHTMLArchiver::GenerateFileName(url_3, title_3, 123456789LL)); |
264 EXPECT_EQ(expected_3, actual_3); | 264 EXPECT_EQ(expected_3, actual_3); |
265 } | 265 } |
266 | 266 |
267 } // namespace offline_pages | 267 } // namespace offline_pages |
OLD | NEW |