OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #import <Foundation/Foundation.h> | 5 #import <Foundation/Foundation.h> |
6 #import <ImageCaptureCore/ImageCaptureCore.h> | 6 #import <ImageCaptureCore/ImageCaptureCore.h> |
7 | 7 |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
11 #include "base/mac/foundation_util.h" | 11 #include "base/mac/foundation_util.h" |
| 12 #include "base/mac/sdk_forward_declarations.h" |
12 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
13 #include "base/run_loop.h" | 14 #include "base/run_loop.h" |
14 #include "components/storage_monitor/image_capture_device.h" | 15 #include "components/storage_monitor/image_capture_device.h" |
15 #include "components/storage_monitor/image_capture_device_manager.h" | 16 #include "components/storage_monitor/image_capture_device_manager.h" |
16 #include "components/storage_monitor/test_storage_monitor.h" | 17 #include "components/storage_monitor/test_storage_monitor.h" |
17 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
18 #include "content/public/test/test_browser_thread_bundle.h" | 19 #include "content/public/test/test_browser_thread_bundle.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
20 | 21 |
21 #if !defined(MAC_OS_X_VERSION_10_7) || \ | |
22 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 | |
23 | |
24 @interface NSObject (ICCameraDeviceDelegateLionAPI) | |
25 - (void)deviceDidBecomeReadyWithCompleteContentCatalog:(ICDevice*)device; | |
26 - (void)didDownloadFile:(ICCameraFile*)file | |
27 error:(NSError*)error | |
28 options:(NSDictionary*)options | |
29 contextInfo:(void*)contextInfo; | |
30 @end | |
31 | |
32 #endif // 10.6 | |
33 | |
34 namespace { | 22 namespace { |
35 | 23 |
36 const char kDeviceId[] = "id"; | 24 const char kDeviceId[] = "id"; |
37 const char kTestFileContents[] = "test"; | 25 const char kTestFileContents[] = "test"; |
38 | 26 |
39 } // namespace | 27 } // namespace |
40 | 28 |
41 // Private ICCameraDevice method needed to properly initialize the object. | 29 // Private ICCameraDevice method needed to properly initialize the object. |
42 @interface NSObject (PrivateAPIICCameraDevice) | 30 @interface NSObject (PrivateAPIICCameraDevice) |
43 - (id)initWithDictionary:(id)properties; | 31 - (id)initWithDictionary:(id)properties; |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 char file_contents[5]; | 417 char file_contents[5]; |
430 ASSERT_EQ(4, base::ReadFile(temp_file, file_contents, | 418 ASSERT_EQ(4, base::ReadFile(temp_file, file_contents, |
431 strlen(kTestFileContents))); | 419 strlen(kTestFileContents))); |
432 EXPECT_EQ(kTestFileContents, | 420 EXPECT_EQ(kTestFileContents, |
433 std::string(file_contents, strlen(kTestFileContents))); | 421 std::string(file_contents, strlen(kTestFileContents))); |
434 | 422 |
435 [camera didRemoveDevice:device]; | 423 [camera didRemoveDevice:device]; |
436 } | 424 } |
437 | 425 |
438 } // namespace storage_monitor | 426 } // namespace storage_monitor |
OLD | NEW |