| 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_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| 11 #include "base/files/scoped_temp_dir.h" | 11 #include "base/files/scoped_temp_dir.h" |
| 12 #include "base/mac/foundation_util.h" | 12 #include "base/mac/foundation_util.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
| 15 #include "base/system_monitor/system_monitor.h" | 15 #include "base/system_monitor/system_monitor.h" |
| 16 #include "base/thread_task_runner_handle.h" | |
| 17 #include "chrome/browser/system_monitor/image_capture_device.h" | 16 #include "chrome/browser/system_monitor/image_capture_device.h" |
| 18 #include "chrome/browser/system_monitor/image_capture_device_manager.h" | 17 #include "chrome/browser/system_monitor/image_capture_device_manager.h" |
| 19 #include "content/public/test/test_browser_thread.h" | 18 #include "content/public/test/test_browser_thread.h" |
| 20 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 21 | 20 |
| 22 namespace { | 21 namespace { |
| 23 | 22 |
| 24 const char kDeviceId[] = "id"; | 23 const char kDeviceId[] = "id"; |
| 25 const char kTestFileContents[] = "test"; | 24 const char kTestFileContents[] = "test"; |
| 26 | 25 |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 | 317 |
| 319 ASSERT_EQ(2U, listener_.downloads().size()); | 318 ASSERT_EQ(2U, listener_.downloads().size()); |
| 320 EXPECT_EQ(kTestFileName, listener_.downloads()[1]); | 319 EXPECT_EQ(kTestFileName, listener_.downloads()[1]); |
| 321 ASSERT_EQ(base::PLATFORM_FILE_OK, listener_.last_error()); | 320 ASSERT_EQ(base::PLATFORM_FILE_OK, listener_.last_error()); |
| 322 char file_contents[5]; | 321 char file_contents[5]; |
| 323 ASSERT_EQ(4, file_util::ReadFile(temp_file, file_contents, | 322 ASSERT_EQ(4, file_util::ReadFile(temp_file, file_contents, |
| 324 strlen(kTestFileContents))); | 323 strlen(kTestFileContents))); |
| 325 EXPECT_EQ(kTestFileContents, | 324 EXPECT_EQ(kTestFileContents, |
| 326 std::string(file_contents, strlen(kTestFileContents))); | 325 std::string(file_contents, strlen(kTestFileContents))); |
| 327 } | 326 } |
| OLD | NEW |