OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/upload_list/upload_list.h" | 5 #include "components/upload_list/upload_list.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 class UploadListTest : public testing::Test, | 29 class UploadListTest : public testing::Test, |
30 public UploadList::Delegate { | 30 public UploadList::Delegate { |
31 public: | 31 public: |
32 UploadListTest() : worker_pool_owner_(1, "UploadListTest") {} | 32 UploadListTest() : worker_pool_owner_(1, "UploadListTest") {} |
33 | 33 |
34 void SetUp() override { | 34 void SetUp() override { |
35 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 35 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
36 } | 36 } |
37 | 37 |
38 void WriteUploadLog(const std::string& log_data) { | 38 void WriteUploadLog(const std::string& log_data) { |
39 ASSERT_GT(base::WriteFile(log_path(), log_data.c_str(), log_data.size()), | 39 ASSERT_GT(base::WriteFile(log_path(), log_data.c_str(), |
| 40 static_cast<int>(log_data.size())), |
40 0); | 41 0); |
41 } | 42 } |
42 | 43 |
43 void WaitForUploadList() { | 44 void WaitForUploadList() { |
44 base::RunLoop run_loop; | 45 base::RunLoop run_loop; |
45 quit_closure_ = run_loop.QuitClosure(); | 46 quit_closure_ = run_loop.QuitClosure(); |
46 run_loop.Run(); | 47 run_loop.Run(); |
47 } | 48 } |
48 | 49 |
49 // UploadList::Delegate: | 50 // UploadList::Delegate: |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 double time_double = uploads[0].upload_time.ToDoubleT(); | 280 double time_double = uploads[0].upload_time.ToDoubleT(); |
280 EXPECT_STREQ(kTestUploadTime, base::DoubleToString(time_double).c_str()); | 281 EXPECT_STREQ(kTestUploadTime, base::DoubleToString(time_double).c_str()); |
281 EXPECT_STREQ(kTestUploadId, uploads[0].upload_id.c_str()); | 282 EXPECT_STREQ(kTestUploadId, uploads[0].upload_id.c_str()); |
282 EXPECT_STREQ(kTestLocalID, uploads[0].local_id.c_str()); | 283 EXPECT_STREQ(kTestLocalID, uploads[0].local_id.c_str()); |
283 time_double = uploads[0].capture_time.ToDoubleT(); | 284 time_double = uploads[0].capture_time.ToDoubleT(); |
284 EXPECT_STREQ(kTestCaptureTime, base::DoubleToString(time_double).c_str()); | 285 EXPECT_STREQ(kTestCaptureTime, base::DoubleToString(time_double).c_str()); |
285 } | 286 } |
286 } | 287 } |
287 | 288 |
288 } // namespace | 289 } // namespace |
OLD | NEW |