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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 ResultCatcher catcher; | 79 ResultCatcher catcher; |
80 host->render_view_host()->ExecuteJavascriptInWebFrame(string16(), command); | 80 host->render_view_host()->ExecuteJavascriptInWebFrame(string16(), command); |
81 EXPECT_TRUE(catcher.GetNextResult()) << message_; | 81 EXPECT_TRUE(catcher.GetNextResult()) << message_; |
82 } | 82 } |
83 | 83 |
84 void AttachFakeDevice() { | 84 void AttachFakeDevice() { |
85 device_id_ = chrome::StorageInfo::MakeDeviceId( | 85 device_id_ = chrome::StorageInfo::MakeDeviceId( |
86 chrome::StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM, kDeviceId); | 86 chrome::StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM, kDeviceId); |
87 | 87 |
88 chrome::StorageMonitor::GetInstance()->receiver()->ProcessAttach( | 88 chrome::StorageMonitor::GetInstance()->receiver()->ProcessAttach( |
89 chrome::StorageInfo(device_id_, string16(), kDevicePath, | 89 chrome::StorageInfo(device_id_, kDevicePath, |
90 ASCIIToUTF16(kDeviceName), | 90 base::ASCIIToUTF16(kDeviceName), base::string16(), |
91 string16(), string16(), 0)); | 91 base::string16(), 0)); |
92 content::RunAllPendingInMessageLoop(); | 92 content::RunAllPendingInMessageLoop(); |
93 } | 93 } |
94 | 94 |
95 void DetachFakeDevice() { | 95 void DetachFakeDevice() { |
96 chrome::StorageMonitor::GetInstance()->receiver()->ProcessDetach( | 96 chrome::StorageMonitor::GetInstance()->receiver()->ProcessDetach( |
97 device_id_); | 97 device_id_); |
98 content::RunAllPendingInMessageLoop(); | 98 content::RunAllPendingInMessageLoop(); |
99 } | 99 } |
100 | 100 |
101 private: | 101 private: |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 169 |
170 DetachFakeDevice(); | 170 DetachFakeDevice(); |
171 } | 171 } |
172 | 172 |
173 IN_PROC_BROWSER_TEST_F(MediaGalleriesPlatformAppBrowserTest, | 173 IN_PROC_BROWSER_TEST_F(MediaGalleriesPlatformAppBrowserTest, |
174 GetFilesystemMetadata) { | 174 GetFilesystemMetadata) { |
175 chrome::EnsureMediaDirectoriesExists media_directories; | 175 chrome::EnsureMediaDirectoriesExists media_directories; |
176 ASSERT_TRUE(RunPlatformAppTest("api_test/media_galleries/metadata")) | 176 ASSERT_TRUE(RunPlatformAppTest("api_test/media_galleries/metadata")) |
177 << message_; | 177 << message_; |
178 } | 178 } |
OLD | NEW |