| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 707 const char* data, | 707 const char* data, |
| 708 int length) { | 708 int length) { |
| 709 // Create a temp file. | 709 // Create a temp file. |
| 710 base::FilePath temp_file; | 710 base::FilePath temp_file; |
| 711 if (!base::CreateTemporaryFile(&temp_file) || | 711 if (!base::CreateTemporaryFile(&temp_file) || |
| 712 base::WriteFile(temp_file, data, length) != length) { | 712 base::WriteFile(temp_file, data, length) != length) { |
| 713 return false; | 713 return false; |
| 714 } | 714 } |
| 715 // Invoke the fileapi to copy it into the sandboxed filesystem. | 715 // Invoke the fileapi to copy it into the sandboxed filesystem. |
| 716 bool result = false; | 716 bool result = false; |
| 717 base::WaitableEvent done_event(true, false); | 717 base::WaitableEvent done_event( |
| 718 base::WaitableEvent::ResetPolicy::MANUAL, |
| 719 base::WaitableEvent::InitialState::NOT_SIGNALED); |
| 718 BrowserThread::PostTask( | 720 BrowserThread::PostTask( |
| 719 BrowserThread::IO, FROM_HERE, | 721 BrowserThread::IO, FROM_HERE, |
| 720 base::Bind(&CreateFileForTestingOnIOThread, | 722 base::Bind(&CreateFileForTestingOnIOThread, |
| 721 base::Unretained(context), | 723 base::Unretained(context), |
| 722 path, temp_file, | 724 path, temp_file, |
| 723 base::Unretained(&result), | 725 base::Unretained(&result), |
| 724 base::Unretained(&done_event))); | 726 base::Unretained(&done_event))); |
| 725 // Wait for that to finish. | 727 // Wait for that to finish. |
| 726 done_event.Wait(); | 728 done_event.Wait(); |
| 727 base::DeleteFile(temp_file, false); | 729 base::DeleteFile(temp_file, false); |
| (...skipping 3504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4232 EXPECT_EQ(downloads::FILENAME_CONFLICT_ACTION_PROMPT, conflict_action); | 4234 EXPECT_EQ(downloads::FILENAME_CONFLICT_ACTION_PROMPT, conflict_action); |
| 4233 EXPECT_FALSE(warnings.empty()); | 4235 EXPECT_FALSE(warnings.empty()); |
| 4234 EXPECT_EQ(Warning::kDownloadFilenameConflict, | 4236 EXPECT_EQ(Warning::kDownloadFilenameConflict, |
| 4235 warnings.begin()->warning_type()); | 4237 warnings.begin()->warning_type()); |
| 4236 EXPECT_EQ("incumbent", warnings.begin()->extension_id()); | 4238 EXPECT_EQ("incumbent", warnings.begin()->extension_id()); |
| 4237 } | 4239 } |
| 4238 | 4240 |
| 4239 } // namespace extensions | 4241 } // namespace extensions |
| 4240 | 4242 |
| 4241 #endif // http://crbug.com/306144 | 4243 #endif // http://crbug.com/306144 |
| OLD | NEW |