| 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 | 5 |
| 6 #import <Foundation/Foundation.h> | 6 #import <Foundation/Foundation.h> |
| 7 #import <ImageCaptureCore/ImageCaptureCore.h> | 7 #import <ImageCaptureCore/ImageCaptureCore.h> |
| 8 | 8 |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 TestCameraListener listener_; | 282 TestCameraListener listener_; |
| 283 }; | 283 }; |
| 284 | 284 |
| 285 TEST_F(ImageCaptureDeviceManagerTest, TestAttachDetach) { | 285 TEST_F(ImageCaptureDeviceManagerTest, TestAttachDetach) { |
| 286 chrome::ImageCaptureDeviceManager manager; | 286 chrome::ImageCaptureDeviceManager manager; |
| 287 manager.SetNotifications(monitor_.receiver()); | 287 manager.SetNotifications(monitor_.receiver()); |
| 288 ICCameraDevice* device = AttachDevice(&manager); | 288 ICCameraDevice* device = AttachDevice(&manager); |
| 289 std::vector<chrome::StorageInfo> devices = monitor_.GetAttachedStorage(); | 289 std::vector<chrome::StorageInfo> devices = monitor_.GetAttachedStorage(); |
| 290 | 290 |
| 291 ASSERT_EQ(1U, devices.size()); | 291 ASSERT_EQ(1U, devices.size()); |
| 292 EXPECT_EQ(std::string("ic:") + kDeviceId, devices[0].device_id); | 292 EXPECT_EQ(std::string("ic:") + kDeviceId, devices[0].device_id()); |
| 293 | 293 |
| 294 DetachDevice(&manager, device); | 294 DetachDevice(&manager, device); |
| 295 devices = monitor_.GetAttachedStorage(); | 295 devices = monitor_.GetAttachedStorage(); |
| 296 ASSERT_EQ(0U, devices.size()); | 296 ASSERT_EQ(0U, devices.size()); |
| 297 }; | 297 }; |
| 298 | 298 |
| 299 TEST_F(ImageCaptureDeviceManagerTest, OpenCamera) { | 299 TEST_F(ImageCaptureDeviceManagerTest, OpenCamera) { |
| 300 chrome::ImageCaptureDeviceManager manager; | 300 chrome::ImageCaptureDeviceManager manager; |
| 301 manager.SetNotifications(monitor_.receiver()); | 301 manager.SetNotifications(monitor_.receiver()); |
| 302 ICCameraDevice* device = AttachDevice(&manager); | 302 ICCameraDevice* device = AttachDevice(&manager); |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 message_loop_.RunUntilIdle(); | 439 message_loop_.RunUntilIdle(); |
| 440 | 440 |
| 441 char file_contents[5]; | 441 char file_contents[5]; |
| 442 ASSERT_EQ(4, file_util::ReadFile(temp_file, file_contents, | 442 ASSERT_EQ(4, file_util::ReadFile(temp_file, file_contents, |
| 443 strlen(kTestFileContents))); | 443 strlen(kTestFileContents))); |
| 444 EXPECT_EQ(kTestFileContents, | 444 EXPECT_EQ(kTestFileContents, |
| 445 std::string(file_contents, strlen(kTestFileContents))); | 445 std::string(file_contents, strlen(kTestFileContents))); |
| 446 | 446 |
| 447 [camera didRemoveDevice:device]; | 447 [camera didRemoveDevice:device]; |
| 448 } | 448 } |
| OLD | NEW |