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/file_path.h" | 6 #include "base/file_path.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/json/json_file_value_serializer.h" | 8 #include "base/json/json_file_value_serializer.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 // Adds a local mount point at at mount point /tmp. | 153 // Adds a local mount point at at mount point /tmp. |
154 void AddTmpMountPoint() { | 154 void AddTmpMountPoint() { |
155 fileapi::ExternalFileSystemMountPointProvider* provider = | 155 fileapi::ExternalFileSystemMountPointProvider* provider = |
156 BrowserContext::GetFileSystemContext(browser()->profile())-> | 156 BrowserContext::GetFileSystemContext(browser()->profile())-> |
157 external_provider(); | 157 external_provider(); |
158 provider->AddLocalMountPoint(test_mount_point_); | 158 provider->AddLocalMountPoint(test_mount_point_); |
159 } | 159 } |
160 | 160 |
161 // Loads the extension, which temporarily starts the lazy background page | 161 // Loads the extension, which temporarily starts the lazy background page |
162 // to dispatch the onInstalled event. We wait until it shuts down again. | 162 // to dispatch the onInstalled event. We wait until it shuts down again. |
163 const Extension* LoadExtensionAndWait(const std::string& test_name) { | 163 const extensions::Extension* LoadExtensionAndWait( |
| 164 const std::string& test_name) { |
164 BackgroundObserver page_complete; | 165 BackgroundObserver page_complete; |
165 FilePath extdir = test_data_dir_.AppendASCII(test_name); | 166 FilePath extdir = test_data_dir_.AppendASCII(test_name); |
166 const Extension* extension = LoadExtension(extdir); | 167 const extensions::Extension* extension = LoadExtension(extdir); |
167 if (extension) | 168 if (extension) |
168 page_complete.WaitUntilClosed(); | 169 page_complete.WaitUntilClosed(); |
169 return extension; | 170 return extension; |
170 } | 171 } |
171 | 172 |
172 private: | 173 private: |
173 FilePath test_mount_point_; | 174 FilePath test_mount_point_; |
174 }; | 175 }; |
175 | 176 |
176 class RemoteFileSystemExtensionApiTest : public ExtensionApiTest { | 177 class RemoteFileSystemExtensionApiTest : public ExtensionApiTest { |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 // This one is called on exit, but we don't care much about it, as long as it | 293 // This one is called on exit, but we don't care much about it, as long as it |
293 // retunrs something valid (i.e. not NULL). | 294 // retunrs something valid (i.e. not NULL). |
294 EXPECT_CALL(*mock_documents_service_, operation_registry()). | 295 EXPECT_CALL(*mock_documents_service_, operation_registry()). |
295 WillOnce(Return(operation_registry_.get())); | 296 WillOnce(Return(operation_registry_.get())); |
296 | 297 |
297 // All is set... RUN THE TEST. | 298 // All is set... RUN THE TEST. |
298 EXPECT_TRUE(RunExtensionTest("filesystem_handler")) << message_; | 299 EXPECT_TRUE(RunExtensionTest("filesystem_handler")) << message_; |
299 EXPECT_TRUE(RunExtensionSubtest("filebrowser_component", "remote.html", | 300 EXPECT_TRUE(RunExtensionSubtest("filebrowser_component", "remote.html", |
300 kComponentFlags)) << message_; | 301 kComponentFlags)) << message_; |
301 } | 302 } |
OLD | NEW |