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" | |
17 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
18 #include "content/public/test/test_browser_thread_bundle.h" | 17 #include "content/public/test/test_browser_thread_bundle.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
20 | 19 |
21 namespace chromeos { | 20 namespace chromeos { |
22 | 21 |
23 namespace { | 22 namespace { |
24 | 23 |
25 void WriteStringToFile(const base::FilePath path, const std::string& data) { | 24 void WriteStringToFile(const base::FilePath path, const std::string& data) { |
26 ASSERT_TRUE(base::CreateDirectory(path.DirName())) | 25 ASSERT_TRUE(base::CreateDirectory(path.DirName())) |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 run_loop.QuitClosure()); | 143 run_loop.QuitClosure()); |
145 flusher->ResumeForTest(); | 144 flusher->ResumeForTest(); |
146 run_loop.Run(); | 145 run_loop.Run(); |
147 | 146 |
148 EXPECT_EQ(1, GetFlushCount("dir1/file1")); | 147 EXPECT_EQ(1, GetFlushCount("dir1/file1")); |
149 EXPECT_EQ(1, GetFlushCount("dir1/file2")); | 148 EXPECT_EQ(1, GetFlushCount("dir1/file2")); |
150 EXPECT_EQ(1, GetFlushCount("dir1/file3")); | 149 EXPECT_EQ(1, GetFlushCount("dir1/file3")); |
151 } | 150 } |
152 | 151 |
153 } // namespace chromeos | 152 } // namespace chromeos |
OLD | NEW |