OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/chromeos/base/file_flusher.h" | 5 #include "chrome/browser/chromeos/base/file_flusher.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
12 #include "base/files/scoped_temp_dir.h" | 12 #include "base/files/scoped_temp_dir.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/run_loop.h" | 14 #include "base/run_loop.h" |
15 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
| 16 #include "base/threading/sequenced_worker_pool.h" |
16 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
17 #include "content/public/test/test_browser_thread_bundle.h" | 18 #include "content/public/test/test_browser_thread_bundle.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
19 | 20 |
20 namespace chromeos { | 21 namespace chromeos { |
21 | 22 |
22 namespace { | 23 namespace { |
23 | 24 |
24 void WriteStringToFile(const base::FilePath path, const std::string& data) { | 25 void WriteStringToFile(const base::FilePath path, const std::string& data) { |
25 ASSERT_TRUE(base::CreateDirectory(path.DirName())) | 26 ASSERT_TRUE(base::CreateDirectory(path.DirName())) |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 run_loop.QuitClosure()); | 144 run_loop.QuitClosure()); |
144 flusher->ResumeForTest(); | 145 flusher->ResumeForTest(); |
145 run_loop.Run(); | 146 run_loop.Run(); |
146 | 147 |
147 EXPECT_EQ(1, GetFlushCount("dir1/file1")); | 148 EXPECT_EQ(1, GetFlushCount("dir1/file1")); |
148 EXPECT_EQ(1, GetFlushCount("dir1/file2")); | 149 EXPECT_EQ(1, GetFlushCount("dir1/file2")); |
149 EXPECT_EQ(1, GetFlushCount("dir1/file3")); | 150 EXPECT_EQ(1, GetFlushCount("dir1/file3")); |
150 } | 151 } |
151 | 152 |
152 } // namespace chromeos | 153 } // namespace chromeos |
OLD | NEW |