| 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 #include <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 StorageInfo info(id, name, location, string16(), string16(), string16(), 0); | 47 StorageInfo info(id, name, location, string16(), string16(), string16(), 0); |
| 48 monitor_->receiver()->ProcessAttach(info); | 48 monitor_->receiver()->ProcessAttach(info); |
| 49 } | 49 } |
| 50 | 50 |
| 51 protected: | 51 protected: |
| 52 // Create mount point for the test device. | 52 // Create mount point for the test device. |
| 53 base::FilePath CreateMountPoint(bool create_dcim_dir) { | 53 base::FilePath CreateMountPoint(bool create_dcim_dir) { |
| 54 base::FilePath path(scoped_temp_dir_.path()); | 54 base::FilePath path(scoped_temp_dir_.path()); |
| 55 if (create_dcim_dir) | 55 if (create_dcim_dir) |
| 56 path = path.Append(kDCIMDirectoryName); | 56 path = path.Append(kDCIMDirectoryName); |
| 57 if (!file_util::CreateDirectory(path)) | 57 if (!base::CreateDirectory(path)) |
| 58 return base::FilePath(); | 58 return base::FilePath(); |
| 59 return scoped_temp_dir_.path(); | 59 return scoped_temp_dir_.path(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 virtual void SetUp() OVERRIDE { | 62 virtual void SetUp() OVERRIDE { |
| 63 monitor_ = TestStorageMonitor::CreateAndInstall(); | 63 monitor_ = TestStorageMonitor::CreateAndInstall(); |
| 64 ASSERT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); | 64 ASSERT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); |
| 65 } | 65 } |
| 66 | 66 |
| 67 virtual void TearDown() OVERRIDE { | 67 virtual void TearDown() OVERRIDE { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 FILE_PATH_LITERAL("/location")); | 143 FILE_PATH_LITERAL("/location")); |
| 144 devices.insert(kImageCaptureDeviceId); | 144 devices.insert(kImageCaptureDeviceId); |
| 145 event.Reset(); | 145 event.Reset(); |
| 146 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 146 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
| 147 base::Bind(&MediaStorageUtil::FilterAttachedDevices, | 147 base::Bind(&MediaStorageUtil::FilterAttachedDevices, |
| 148 base::Unretained(&devices), signal_event)); | 148 base::Unretained(&devices), signal_event)); |
| 149 event.Wait(); | 149 event.Wait(); |
| 150 | 150 |
| 151 EXPECT_TRUE(devices.find(kImageCaptureDeviceId) != devices.end()); | 151 EXPECT_TRUE(devices.find(kImageCaptureDeviceId) != devices.end()); |
| 152 } | 152 } |
| OLD | NEW |