| 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 // Disable everything on windows only. http://crbug.com/306144 | 5 // Disable everything on windows only. http://crbug.com/306144 |
| 6 #ifndef OS_WIN | 6 #ifndef OS_WIN |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 | 9 |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 base::Unretained(&done_event))); | 724 base::Unretained(&done_event))); |
| 725 // Wait for that to finish. | 725 // Wait for that to finish. |
| 726 done_event.Wait(); | 726 done_event.Wait(); |
| 727 base::DeleteFile(temp_file, false); | 727 base::DeleteFile(temp_file, false); |
| 728 return result; | 728 return result; |
| 729 } | 729 } |
| 730 | 730 |
| 731 private: | 731 private: |
| 732 static void CopyInCompletion(bool* result, | 732 static void CopyInCompletion(bool* result, |
| 733 base::WaitableEvent* done_event, | 733 base::WaitableEvent* done_event, |
| 734 base::PlatformFileError error) { | 734 base::File::Error error) { |
| 735 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 735 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 736 *result = error == base::PLATFORM_FILE_OK; | 736 *result = error == base::File::FILE_OK; |
| 737 done_event->Signal(); | 737 done_event->Signal(); |
| 738 } | 738 } |
| 739 | 739 |
| 740 static void CreateFileForTestingOnIOThread( | 740 static void CreateFileForTestingOnIOThread( |
| 741 fileapi::FileSystemContext* context, | 741 fileapi::FileSystemContext* context, |
| 742 const fileapi::FileSystemURL& path, | 742 const fileapi::FileSystemURL& path, |
| 743 const base::FilePath& temp_file, | 743 const base::FilePath& temp_file, |
| 744 bool* result, | 744 bool* result, |
| 745 base::WaitableEvent* done_event) { | 745 base::WaitableEvent* done_event) { |
| 746 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 746 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| (...skipping 2888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3635 EXPECT_EQ("suggester", winner_id); | 3635 EXPECT_EQ("suggester", winner_id); |
| 3636 EXPECT_EQ(FILE_PATH_LITERAL("b"), filename.value()); | 3636 EXPECT_EQ(FILE_PATH_LITERAL("b"), filename.value()); |
| 3637 EXPECT_EQ(api::FILENAME_CONFLICT_ACTION_PROMPT, conflict_action); | 3637 EXPECT_EQ(api::FILENAME_CONFLICT_ACTION_PROMPT, conflict_action); |
| 3638 EXPECT_FALSE(warnings.empty()); | 3638 EXPECT_FALSE(warnings.empty()); |
| 3639 EXPECT_EQ(extensions::ExtensionWarning::kDownloadFilenameConflict, | 3639 EXPECT_EQ(extensions::ExtensionWarning::kDownloadFilenameConflict, |
| 3640 warnings.begin()->warning_type()); | 3640 warnings.begin()->warning_type()); |
| 3641 EXPECT_EQ("incumbent", warnings.begin()->extension_id()); | 3641 EXPECT_EQ("incumbent", warnings.begin()->extension_id()); |
| 3642 } | 3642 } |
| 3643 | 3643 |
| 3644 #endif // http://crbug.com/3061144 | 3644 #endif // http://crbug.com/3061144 |
| OLD | NEW |