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/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 private: | 233 private: |
234 std::vector<std::string> items_; | 234 std::vector<std::string> items_; |
235 std::vector<std::string> downloads_; | 235 std::vector<std::string> downloads_; |
236 bool completed_; | 236 bool completed_; |
237 bool removed_; | 237 bool removed_; |
238 base::File::Error last_error_; | 238 base::File::Error last_error_; |
239 }; | 239 }; |
240 | 240 |
241 class ImageCaptureDeviceManagerTest : public testing::Test { | 241 class ImageCaptureDeviceManagerTest : public testing::Test { |
242 public: | 242 public: |
243 virtual void SetUp() override { | 243 void SetUp() override { monitor_ = TestStorageMonitor::CreateAndInstall(); } |
244 monitor_ = TestStorageMonitor::CreateAndInstall(); | |
245 } | |
246 | 244 |
247 virtual void TearDown() override { | 245 void TearDown() override { TestStorageMonitor::Destroy(); } |
248 TestStorageMonitor::Destroy(); | |
249 } | |
250 | 246 |
251 MockICCameraDevice* AttachDevice(ImageCaptureDeviceManager* manager) { | 247 MockICCameraDevice* AttachDevice(ImageCaptureDeviceManager* manager) { |
252 // Ownership will be passed to the device browser delegate. | 248 // Ownership will be passed to the device browser delegate. |
253 base::scoped_nsobject<MockICCameraDevice> device( | 249 base::scoped_nsobject<MockICCameraDevice> device( |
254 [[MockICCameraDevice alloc] init]); | 250 [[MockICCameraDevice alloc] init]); |
255 id<ICDeviceBrowserDelegate> delegate = manager->device_browser(); | 251 id<ICDeviceBrowserDelegate> delegate = manager->device_browser(); |
256 [delegate deviceBrowser:nil didAddDevice:device moreComing:NO]; | 252 [delegate deviceBrowser:nil didAddDevice:device moreComing:NO]; |
257 return device.autorelease(); | 253 return device.autorelease(); |
258 } | 254 } |
259 | 255 |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 char file_contents[5]; | 409 char file_contents[5]; |
414 ASSERT_EQ(4, base::ReadFile(temp_file, file_contents, | 410 ASSERT_EQ(4, base::ReadFile(temp_file, file_contents, |
415 strlen(kTestFileContents))); | 411 strlen(kTestFileContents))); |
416 EXPECT_EQ(kTestFileContents, | 412 EXPECT_EQ(kTestFileContents, |
417 std::string(file_contents, strlen(kTestFileContents))); | 413 std::string(file_contents, strlen(kTestFileContents))); |
418 | 414 |
419 [camera didRemoveDevice:device]; | 415 [camera didRemoveDevice:device]; |
420 } | 416 } |
421 | 417 |
422 } // namespace storage_monitor | 418 } // namespace storage_monitor |
OLD | NEW |