| 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/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/test/thread_test_helper.h" | 9 #include "base/test/thread_test_helper.h" |
| 10 #include "content/browser/web_contents/web_contents_impl.h" | 10 #include "content/browser/web_contents/web_contents_impl.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 72 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 73 qm->SetTemporaryGlobalOverrideQuota(bytes, quota::QuotaCallback()); | 73 qm->SetTemporaryGlobalOverrideQuota(bytes, quota::QuotaCallback()); |
| 74 // Don't return until the quota has been set. | 74 // Don't return until the quota has been set. |
| 75 scoped_refptr<base::ThreadTestHelper> helper( | 75 scoped_refptr<base::ThreadTestHelper> helper( |
| 76 new base::ThreadTestHelper( | 76 new base::ThreadTestHelper( |
| 77 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB))); | 77 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB))); |
| 78 ASSERT_TRUE(helper->Run()); | 78 ASSERT_TRUE(helper->Run()); |
| 79 } | 79 } |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 // This class runs WebKit filesystem layout tests. | |
| 83 class FileSystemLayoutTest : public InProcessBrowserLayoutTest { | |
| 84 public: | |
| 85 FileSystemLayoutTest() : | |
| 86 InProcessBrowserLayoutTest( | |
| 87 base::FilePath(), | |
| 88 base::FilePath( | |
| 89 FILE_PATH_LITERAL("fast/filesystem") | |
| 90 ).NormalizePathSeparators()) { | |
| 91 } | |
| 92 }; | |
| 93 | |
| 94 IN_PROC_BROWSER_TEST_F(FileSystemBrowserTest, RequestTest) { | 82 IN_PROC_BROWSER_TEST_F(FileSystemBrowserTest, RequestTest) { |
| 95 SimpleTest(GetTestUrl("fileapi", "request_test.html")); | 83 SimpleTest(GetTestUrl("fileapi", "request_test.html")); |
| 96 } | 84 } |
| 97 | 85 |
| 98 IN_PROC_BROWSER_TEST_F(FileSystemBrowserTest, CreateTest) { | 86 IN_PROC_BROWSER_TEST_F(FileSystemBrowserTest, CreateTest) { |
| 99 SimpleTest(GetTestUrl("fileapi", "create_test.html")); | 87 SimpleTest(GetTestUrl("fileapi", "create_test.html")); |
| 100 } | 88 } |
| 101 | 89 |
| 102 IN_PROC_BROWSER_TEST_F(FileSystemBrowserTestWithLowQuota, QuotaTest) { | 90 IN_PROC_BROWSER_TEST_F(FileSystemBrowserTestWithLowQuota, QuotaTest) { |
| 103 SimpleTest(GetTestUrl("fileapi", "quota_test.html")); | 91 SimpleTest(GetTestUrl("fileapi", "quota_test.html")); |
| 104 } | 92 } |
| 105 | 93 |
| 106 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, AsyncOperations) { | |
| 107 RunLayoutTest("async-operations.html"); | |
| 108 } | |
| 109 | |
| 110 // crbug.com/172787 for disabling on Windows (flaky), crbug.com/173079 for | |
| 111 // temporary disabling everywhere. | |
| 112 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, DISABLED_CrossFilesystemOp) { | |
| 113 RunLayoutTest("cross-filesystem-op.html"); | |
| 114 } | |
| 115 | |
| 116 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, DirectoryEntryToUri) { | |
| 117 RunLayoutTest("directory-entry-to-uri.html"); | |
| 118 } | |
| 119 | |
| 120 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, EntryPointsMissingArguments) { | |
| 121 RunLayoutTest("entry-points-missing-arguments.html"); | |
| 122 } | |
| 123 | |
| 124 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, FileAfterReloadCrash) { | |
| 125 RunLayoutTest("file-after-reload-crash.html"); | |
| 126 } | |
| 127 | |
| 128 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, FileEntryToUri) { | |
| 129 RunLayoutTest("file-entry-to-uri.html"); | |
| 130 } | |
| 131 | |
| 132 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, FileFromFileEntry) { | |
| 133 RunLayoutTest("file-from-file-entry.html"); | |
| 134 } | |
| 135 | |
| 136 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, FileMetadataAfterWrite) { | |
| 137 RunLayoutTest("file-metadata-after-write.html"); | |
| 138 } | |
| 139 | |
| 140 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, FilesystemMissingArguments) { | |
| 141 RunLayoutTest("filesystem-missing-arguments.html"); | |
| 142 } | |
| 143 | |
| 144 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, FilesystemNoCallbackNullPtrCrash) { | |
| 145 RunLayoutTest("filesystem-no-callback-null-ptr-crash.html"); | |
| 146 } | |
| 147 | |
| 148 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, FilesystemReference) { | |
| 149 RunLayoutTest("filesystem-reference.html"); | |
| 150 } | |
| 151 | |
| 152 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, FilesystemUnserializable) { | |
| 153 RunLayoutTest("filesystem-unserializable.html"); | |
| 154 } | |
| 155 | |
| 156 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, FilesystemUriOrigin) { | |
| 157 RunLayoutTest("filesystem-uri-origin.html"); | |
| 158 } | |
| 159 | |
| 160 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, FileWriterAbortContinue) { | |
| 161 RunLayoutTest("file-writer-abort-continue.html"); | |
| 162 } | |
| 163 | |
| 164 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, FileWriterAbortDepth) { | |
| 165 RunLayoutTest("file-writer-abort-depth.html"); | |
| 166 } | |
| 167 | |
| 168 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, FileWriterAbort) { | |
| 169 RunLayoutTest("file-writer-abort.html"); | |
| 170 } | |
| 171 | |
| 172 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, FileWriterEmptyBlob) { | |
| 173 RunLayoutTest("file-writer-empty-blob.html"); | |
| 174 } | |
| 175 | |
| 176 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, FileWriterEvents) { | |
| 177 RunLayoutTest("file-writer-events.html"); | |
| 178 } | |
| 179 | |
| 180 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, FileWriterGcBlob) { | |
| 181 RunLayoutTest("file-writer-gc-blob.html"); | |
| 182 } | |
| 183 | |
| 184 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, FileWriterTruncateExtend) { | |
| 185 RunLayoutTest("file-writer-truncate-extend.html"); | |
| 186 } | |
| 187 | |
| 188 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, FileWriterWriteOverlapped) { | |
| 189 RunLayoutTest("file-writer-write-overlapped.html"); | |
| 190 } | |
| 191 | |
| 192 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, FlagsPassing) { | |
| 193 RunLayoutTest("flags-passing.html"); | |
| 194 } | |
| 195 | |
| 196 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, InputAccessEntries) { | |
| 197 RunLayoutTest("input-access-entries.html"); | |
| 198 } | |
| 199 | |
| 200 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, NotEnoughArguments) { | |
| 201 RunLayoutTest("not-enough-arguments.html"); | |
| 202 } | |
| 203 | |
| 204 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, OpCopy) { | |
| 205 RunLayoutTest("op-copy.html"); | |
| 206 } | |
| 207 | |
| 208 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, OpGetEntry) { | |
| 209 RunLayoutTest("op-get-entry.html"); | |
| 210 } | |
| 211 | |
| 212 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, OpGetMetadata) { | |
| 213 RunLayoutTest("op-get-metadata.html"); | |
| 214 } | |
| 215 | |
| 216 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, OpGetParent) { | |
| 217 RunLayoutTest("op-get-parent.html"); | |
| 218 } | |
| 219 | |
| 220 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, OpMove) { | |
| 221 RunLayoutTest("op-move.html"); | |
| 222 } | |
| 223 | |
| 224 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, OpReadDirectory) { | |
| 225 RunLayoutTest("op-read-directory.html"); | |
| 226 } | |
| 227 | |
| 228 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, OpRemove) { | |
| 229 RunLayoutTest("op-remove.html"); | |
| 230 } | |
| 231 | |
| 232 // TODO(kinuko): This has been broken before but the bug has surfaced | |
| 233 // due to a partial fix for drive-letter handling. | |
| 234 // http://crbug.com/176253 | |
| 235 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, DISABLED_OpRestrictedChars) { | |
| 236 RunLayoutTest("op-restricted-chars.html"); | |
| 237 } | |
| 238 | |
| 239 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, OpRestrictedNames) { | |
| 240 RunLayoutTest("op-restricted-names.html"); | |
| 241 } | |
| 242 | |
| 243 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, OpRestrictedUnicode) { | |
| 244 RunLayoutTest("op-restricted-unicode.html"); | |
| 245 } | |
| 246 | |
| 247 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, ReadDirectory) { | |
| 248 RunLayoutTest("read-directory.html"); | |
| 249 } | |
| 250 | |
| 251 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, SimplePersistent) { | |
| 252 RunLayoutTest("simple-persistent.html"); | |
| 253 } | |
| 254 | |
| 255 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, SimpleReadonlyFileObject) { | |
| 256 RunLayoutTest("simple-readonly-file-object.html"); | |
| 257 } | |
| 258 | |
| 259 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, SimpleReadonly) { | |
| 260 RunLayoutTest("simple-readonly.html"); | |
| 261 } | |
| 262 | |
| 263 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, | |
| 264 SimpleRequiredArgumentsGetdirectory) { | |
| 265 RunLayoutTest("simple-required-arguments-getdirectory.html"); | |
| 266 } | |
| 267 | |
| 268 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, SimpleRequiredArgumentsGetfile) | |
| 269 { | |
| 270 RunLayoutTest("simple-required-arguments-getfile.html"); | |
| 271 } | |
| 272 | |
| 273 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, | |
| 274 SimpleRequiredArgumentsGetmetadata) { | |
| 275 RunLayoutTest("simple-required-arguments-getmetadata.html"); | |
| 276 } | |
| 277 | |
| 278 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, SimpleRequiredArgumentsRemove) { | |
| 279 RunLayoutTest("simple-required-arguments-remove.html"); | |
| 280 } | |
| 281 | |
| 282 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, SimpleTemporary) { | |
| 283 RunLayoutTest("simple-temporary.html"); | |
| 284 } | |
| 285 | |
| 286 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, WorkersAsyncOperations) { | |
| 287 RunLayoutTest("workers/async-operations.html"); | |
| 288 } | |
| 289 | |
| 290 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, WorkersDetachedFrameCrash) { | |
| 291 RunLayoutTest("workers/detached-frame-crash.html"); | |
| 292 } | |
| 293 | |
| 294 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, WorkersFileEntryToUriSync) { | |
| 295 RunLayoutTest("workers/file-entry-to-uri-sync.html"); | |
| 296 } | |
| 297 | |
| 298 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, WorkersFileFromFileEntry) { | |
| 299 RunLayoutTest("workers/file-from-file-entry.html"); | |
| 300 } | |
| 301 | |
| 302 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, WorkersFileFromFileEntrySync) | |
| 303 { | |
| 304 RunLayoutTest("workers/file-from-file-entry-sync.html"); | |
| 305 } | |
| 306 | |
| 307 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, WorkersFileWriterEmptyBlob) { | |
| 308 RunLayoutTest("workers/file-writer-empty-blob.html"); | |
| 309 } | |
| 310 | |
| 311 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, WorkersFileWriterEvents) { | |
| 312 RunLayoutTest("workers/file-writer-events.html"); | |
| 313 } | |
| 314 | |
| 315 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, | |
| 316 WorkersFileWriterEventsSharedWorker) { | |
| 317 RunLayoutTest("workers/file-writer-events-shared-worker.html"); | |
| 318 } | |
| 319 | |
| 320 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, WorkersFileWriterGcBlob) { | |
| 321 RunLayoutTest("workers/file-writer-gc-blob.html"); | |
| 322 } | |
| 323 | |
| 324 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, | |
| 325 WorkersFileWriterSyncTruncateExtend) { | |
| 326 RunLayoutTest("workers/file-writer-sync-truncate-extend.html"); | |
| 327 } | |
| 328 | |
| 329 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, | |
| 330 WorkersFileWriterSyncWriteOverlapped) { | |
| 331 RunLayoutTest("workers/file-writer-sync-write-overlapped.html"); | |
| 332 } | |
| 333 | |
| 334 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, WorkersFileWriterTruncateExtend) { | |
| 335 RunLayoutTest("workers/file-writer-truncate-extend.html"); | |
| 336 } | |
| 337 | |
| 338 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, WorkersFileWriterWriteOverlapped) { | |
| 339 RunLayoutTest("workers/file-writer-write-overlapped.html"); | |
| 340 } | |
| 341 | |
| 342 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, WorkersSimplePersistent) { | |
| 343 RunLayoutTest("workers/simple-persistent.html"); | |
| 344 } | |
| 345 | |
| 346 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, WorkersSimplePersistentSync) { | |
| 347 RunLayoutTest("workers/simple-persistent-sync.html"); | |
| 348 } | |
| 349 | |
| 350 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, WorkersSimpleTemporary) { | |
| 351 RunLayoutTest("workers/simple-temporary.html"); | |
| 352 } | |
| 353 | |
| 354 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, WorkersSimpleTemporarySync) { | |
| 355 RunLayoutTest("workers/simple-temporary-sync.html"); | |
| 356 } | |
| 357 | |
| 358 IN_PROC_BROWSER_TEST_F(FileSystemLayoutTest, WorkersSyncOperations) { | |
| 359 RunLayoutTest("workers/sync-operations.html"); | |
| 360 } | |
| 361 | |
| 362 } // namespace content | 94 } // namespace content |
| OLD | NEW |