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 "chrome/browser/chromeos/file_manager/file_watcher.h" | 5 #include "chrome/browser/chromeos/file_manager/file_watcher.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
11 #include "chrome/browser/google_apis/test_util.h" | |
12 #include "content/public/test/test_browser_thread_bundle.h" | 11 #include "content/public/test/test_browser_thread_bundle.h" |
| 12 #include "google_apis/drive/test_util.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 | 14 |
15 namespace file_manager { | 15 namespace file_manager { |
16 namespace { | 16 namespace { |
17 | 17 |
18 using google_apis::test_util::CreateQuitCallback; | 18 using google_apis::test_util::CreateQuitCallback; |
19 using google_apis::test_util::CreateCopyResultCallback; | 19 using google_apis::test_util::CreateCopyResultCallback; |
20 | 20 |
21 class FileManagerFileWatcherTest : public testing::Test { | 21 class FileManagerFileWatcherTest : public testing::Test { |
22 public: | 22 public: |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 // This is ugly, but FileWatcher should be deleted explicitly here, and | 148 // This is ugly, but FileWatcher should be deleted explicitly here, and |
149 // spin the message loop so the base::FilePathWatcher is deleted. | 149 // spin the message loop so the base::FilePathWatcher is deleted. |
150 // Otherwise, base::FilePathWatcher may detect a change when the temporary | 150 // Otherwise, base::FilePathWatcher may detect a change when the temporary |
151 // directory is deleted, which may result in crash. | 151 // directory is deleted, which may result in crash. |
152 file_watcher.reset(); | 152 file_watcher.reset(); |
153 base::RunLoop().RunUntilIdle(); | 153 base::RunLoop().RunUntilIdle(); |
154 } | 154 } |
155 | 155 |
156 } // namespace | 156 } // namespace |
157 } // namespace file_manager. | 157 } // namespace file_manager. |
OLD | NEW |