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 "base/auto_reset.h" | 5 #include "base/auto_reset.h" |
6 #include "base/callback.h" | 6 #include "base/callback.h" |
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/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/numerics/safe_conversions.h" | 10 #include "base/numerics/safe_conversions.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 bool result = RunPlatformAppTestWithArg(extension_name, custom_arg); | 162 bool result = RunPlatformAppTestWithArg(extension_name, custom_arg); |
163 content::RunAllPendingInMessageLoop(); // avoid race on exit in registry. | 163 content::RunAllPendingInMessageLoop(); // avoid race on exit in registry. |
164 return result; | 164 return result; |
165 } | 165 } |
166 | 166 |
167 void AttachFakeDevice() { | 167 void AttachFakeDevice() { |
168 device_id_ = StorageInfo::MakeDeviceId( | 168 device_id_ = StorageInfo::MakeDeviceId( |
169 StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM, kDeviceId); | 169 StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM, kDeviceId); |
170 | 170 |
171 StorageMonitor::GetInstance()->receiver()->ProcessAttach( | 171 StorageMonitor::GetInstance()->receiver()->ProcessAttach( |
172 StorageInfo(device_id_, base::string16(), kDevicePath, | 172 StorageInfo(device_id_, kDevicePath, base::ASCIIToUTF16(kDeviceName), |
173 base::ASCIIToUTF16(kDeviceName), base::string16(), | 173 base::string16(), base::string16(), 0)); |
174 base::string16(), 0)); | |
175 content::RunAllPendingInMessageLoop(); | 174 content::RunAllPendingInMessageLoop(); |
176 } | 175 } |
177 | 176 |
178 void DetachFakeDevice() { | 177 void DetachFakeDevice() { |
179 StorageMonitor::GetInstance()->receiver()->ProcessDetach(device_id_); | 178 StorageMonitor::GetInstance()->receiver()->ProcessDetach(device_id_); |
180 content::RunAllPendingInMessageLoop(); | 179 content::RunAllPendingInMessageLoop(); |
181 } | 180 } |
182 | 181 |
183 // Called if test only wants a single gallery it creates. | 182 // Called if test only wants a single gallery it creates. |
184 void RemoveAllGalleries() { | 183 void RemoveAllGalleries() { |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 | 581 |
583 base::ListValue custom_args; | 582 base::ListValue custom_args; |
584 #if defined(USE_PROPRIETARY_CODECS) | 583 #if defined(USE_PROPRIETARY_CODECS) |
585 custom_args.AppendBoolean(true); | 584 custom_args.AppendBoolean(true); |
586 #else | 585 #else |
587 custom_args.AppendBoolean(false); | 586 custom_args.AppendBoolean(false); |
588 #endif | 587 #endif |
589 ASSERT_TRUE(RunMediaGalleriesTestWithArg("media_metadata", custom_args)) | 588 ASSERT_TRUE(RunMediaGalleriesTestWithArg("media_metadata", custom_args)) |
590 << message_; | 589 << message_; |
591 } | 590 } |
OLD | NEW |