| 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 #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/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/mac/cocoa_protocols.h" | 10 #include "base/mac/cocoa_protocols.h" |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 virtual void TearDown() OVERRIDE { | 291 virtual void TearDown() OVERRIDE { |
| 292 id<ICDeviceBrowserDelegate> delegate = manager_.device_browser(); | 292 id<ICDeviceBrowserDelegate> delegate = manager_.device_browser(); |
| 293 [delegate deviceBrowser:nil didRemoveDevice:camera_ moreGoing:NO]; | 293 [delegate deviceBrowser:nil didRemoveDevice:camera_ moreGoing:NO]; |
| 294 | 294 |
| 295 delegate_->CancelPendingTasksAndDeleteDelegate(); | 295 delegate_->CancelPendingTasksAndDeleteDelegate(); |
| 296 | 296 |
| 297 io_thread_->Stop(); | 297 io_thread_->Stop(); |
| 298 } | 298 } |
| 299 | 299 |
| 300 protected: | 300 protected: |
| 301 MessageLoopForUI message_loop_; | 301 base::MessageLoopForUI message_loop_; |
| 302 // Note: threads must be made in this order: UI > FILE > IO | 302 // Note: threads must be made in this order: UI > FILE > IO |
| 303 scoped_ptr<content::TestBrowserThread> ui_thread_; | 303 scoped_ptr<content::TestBrowserThread> ui_thread_; |
| 304 scoped_ptr<content::TestBrowserThread> file_thread_; | 304 scoped_ptr<content::TestBrowserThread> file_thread_; |
| 305 scoped_ptr<content::TestBrowserThread> io_thread_; | 305 scoped_ptr<content::TestBrowserThread> io_thread_; |
| 306 base::ScopedTempDir temp_dir_; | 306 base::ScopedTempDir temp_dir_; |
| 307 chrome::test::TestStorageMonitor monitor_; | 307 chrome::test::TestStorageMonitor monitor_; |
| 308 chrome::ImageCaptureDeviceManager manager_; | 308 chrome::ImageCaptureDeviceManager manager_; |
| 309 MockMTPICCameraDevice* camera_; | 309 MockMTPICCameraDevice* camera_; |
| 310 | 310 |
| 311 // This object needs special deletion inside the above |task_runner_|. | 311 // This object needs special deletion inside the above |task_runner_|. |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 temp_dir_.path().Append("target"))); | 562 temp_dir_.path().Append("target"))); |
| 563 | 563 |
| 564 EXPECT_EQ(base::PLATFORM_FILE_OK, | 564 EXPECT_EQ(base::PLATFORM_FILE_OK, |
| 565 DownloadFile(base::FilePath("/ic:id/filename"), | 565 DownloadFile(base::FilePath("/ic:id/filename"), |
| 566 temp_dir_.path().Append("target"))); | 566 temp_dir_.path().Append("target"))); |
| 567 std::string contents; | 567 std::string contents; |
| 568 EXPECT_TRUE(file_util::ReadFileToString(temp_dir_.path().Append("target"), | 568 EXPECT_TRUE(file_util::ReadFileToString(temp_dir_.path().Append("target"), |
| 569 &contents)); | 569 &contents)); |
| 570 EXPECT_EQ(kTestFileContents, contents); | 570 EXPECT_EQ(kTestFileContents, contents); |
| 571 } | 571 } |
| OLD | NEW |