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/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 scoped_refptr<IndexedDBContextImpl> context, | 227 scoped_refptr<IndexedDBContextImpl> context, |
228 const std::string& test_directory) { | 228 const std::string& test_directory) { |
229 DCHECK(context->TaskRunner()->RunsTasksOnCurrentThread()); | 229 DCHECK(context->TaskRunner()->RunsTasksOnCurrentThread()); |
230 base::FilePath leveldb_dir(FILE_PATH_LITERAL("file__0.indexeddb.leveldb")); | 230 base::FilePath leveldb_dir(FILE_PATH_LITERAL("file__0.indexeddb.leveldb")); |
231 base::FilePath test_data_dir = | 231 base::FilePath test_data_dir = |
232 GetTestFilePath("indexeddb", test_directory.c_str()).Append(leveldb_dir); | 232 GetTestFilePath("indexeddb", test_directory.c_str()).Append(leveldb_dir); |
233 base::FilePath dest = context->data_path().Append(leveldb_dir); | 233 base::FilePath dest = context->data_path().Append(leveldb_dir); |
234 // If we don't create the destination directory first, the contents of the | 234 // If we don't create the destination directory first, the contents of the |
235 // leveldb directory are copied directly into profile/IndexedDB instead of | 235 // leveldb directory are copied directly into profile/IndexedDB instead of |
236 // profile/IndexedDB/file__0.xxx/ | 236 // profile/IndexedDB/file__0.xxx/ |
237 ASSERT_TRUE(file_util::CreateDirectory(dest)); | 237 ASSERT_TRUE(base::CreateDirectory(dest)); |
238 const bool kRecursive = true; | 238 const bool kRecursive = true; |
239 ASSERT_TRUE(base::CopyDirectory(test_data_dir, | 239 ASSERT_TRUE(base::CopyDirectory(test_data_dir, |
240 context->data_path(), | 240 context->data_path(), |
241 kRecursive)); | 241 kRecursive)); |
242 } | 242 } |
243 | 243 |
244 class IndexedDBBrowserTestWithPreexistingLevelDB : public IndexedDBBrowserTest { | 244 class IndexedDBBrowserTestWithPreexistingLevelDB : public IndexedDBBrowserTest { |
245 public: | 245 public: |
246 virtual void SetUpOnMainThread() OVERRIDE { | 246 virtual void SetUpOnMainThread() OVERRIDE { |
247 scoped_refptr<IndexedDBContextImpl> context = GetContext(); | 247 scoped_refptr<IndexedDBContextImpl> context = GetContext(); |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 command_line->AppendSwitch(switches::kSingleProcess); | 432 command_line->AppendSwitch(switches::kSingleProcess); |
433 } | 433 } |
434 }; | 434 }; |
435 | 435 |
436 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestSingleProcess, | 436 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestSingleProcess, |
437 RenderThreadShutdownTest) { | 437 RenderThreadShutdownTest) { |
438 SimpleTest(GetTestUrl("indexeddb", "shutdown_with_requests.html")); | 438 SimpleTest(GetTestUrl("indexeddb", "shutdown_with_requests.html")); |
439 } | 439 } |
440 | 440 |
441 } // namespace content | 441 } // namespace content |
OLD | NEW |