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 "content/browser/download/base_file.h" | 5 #include "content/browser/download/base_file.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 namespace content { | 26 namespace content { |
27 namespace { | 27 namespace { |
28 | 28 |
29 const char kTestData1[] = "Let's write some data to the file!\n"; | 29 const char kTestData1[] = "Let's write some data to the file!\n"; |
30 const char kTestData2[] = "Writing more data.\n"; | 30 const char kTestData2[] = "Writing more data.\n"; |
31 const char kTestData3[] = "Final line."; | 31 const char kTestData3[] = "Final line."; |
32 const char kTestData4[] = "supercalifragilisticexpialidocious"; | 32 const char kTestData4[] = "supercalifragilisticexpialidocious"; |
33 const int kTestDataLength1 = arraysize(kTestData1) - 1; | 33 const int kTestDataLength1 = arraysize(kTestData1) - 1; |
34 const int kTestDataLength2 = arraysize(kTestData2) - 1; | 34 const int kTestDataLength2 = arraysize(kTestData2) - 1; |
35 const int kTestDataLength4 = arraysize(kTestData4) - 1; | 35 const int kTestDataLength4 = arraysize(kTestData4) - 1; |
36 const int kElapsedTimeSeconds = 5; | |
37 const base::TimeDelta kElapsedTimeDelta = base::TimeDelta::FromSeconds( | |
38 kElapsedTimeSeconds); | |
39 | 36 |
40 // SHA-256 hash of kTestData1 (excluding terminating NUL). | 37 // SHA-256 hash of kTestData1 (excluding terminating NUL). |
41 const uint8_t kHashOfTestData1[] = { | 38 const uint8_t kHashOfTestData1[] = { |
42 0x0b, 0x2d, 0x3f, 0x3f, 0x79, 0x43, 0xad, 0x64, 0xb8, 0x60, 0xdf, | 39 0x0b, 0x2d, 0x3f, 0x3f, 0x79, 0x43, 0xad, 0x64, 0xb8, 0x60, 0xdf, |
43 0x94, 0xd0, 0x5c, 0xb5, 0x6a, 0x8a, 0x97, 0xc6, 0xec, 0x57, 0x68, | 40 0x94, 0xd0, 0x5c, 0xb5, 0x6a, 0x8a, 0x97, 0xc6, 0xec, 0x57, 0x68, |
44 0xb5, 0xb7, 0x0b, 0x93, 0x0c, 0x5a, 0xa7, 0xfa, 0x9a, 0xde}; | 41 0xb5, 0xb7, 0x0b, 0x93, 0x0c, 0x5a, 0xa7, 0xfa, 0x9a, 0xde}; |
45 | 42 |
46 // SHA-256 hash of kTestData1 ++ kTestData2 ++ kTestData3 (excluding terminating | 43 // SHA-256 hash of kTestData1 ++ kTestData2 ++ kTestData3 (excluding terminating |
47 // NUL). | 44 // NUL). |
48 const uint8_t kHashOfTestData1To3[] = { | 45 const uint8_t kHashOfTestData1To3[] = { |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 | 726 |
730 const char kData[] = "hello"; | 727 const char kData[] = "hello"; |
731 const int kDataLength = static_cast<int>(arraysize(kData) - 1); | 728 const int kDataLength = static_cast<int>(arraysize(kData) - 1); |
732 ASSERT_EQ(kDataLength, base::WriteFile(full_path, kData, kDataLength)); | 729 ASSERT_EQ(kDataLength, base::WriteFile(full_path, kData, kDataLength)); |
733 // The file that we created here should stick around when the BaseFile is | 730 // The file that we created here should stick around when the BaseFile is |
734 // destroyed during TearDown. | 731 // destroyed during TearDown. |
735 expect_file_survives_ = true; | 732 expect_file_survives_ = true; |
736 } | 733 } |
737 | 734 |
738 } // namespace content | 735 } // namespace content |
OLD | NEW |