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_path.h" | 7 #include "base/file_path.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 ASSERT_TRUE(file_util::CopyDirectory(test_data_dir, | 227 ASSERT_TRUE(file_util::CopyDirectory(test_data_dir, |
228 context_impl->data_path(), | 228 context_impl->data_path(), |
229 kRecursive)); | 229 kRecursive)); |
230 } | 230 } |
231 }; | 231 }; |
232 | 232 |
233 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithVersion0Schema, MigrationTest) { | 233 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithVersion0Schema, MigrationTest) { |
234 SimpleTest(GetTestUrl("indexeddb", "migration_test.html")); | 234 SimpleTest(GetTestUrl("indexeddb", "migration_test.html")); |
235 } | 235 } |
236 | 236 |
| 237 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, LevelDBLogFileTest) { |
| 238 // Any page that opens an IndexedDB will work here. |
| 239 SimpleTest(GetTestUrl("indexeddb", "database_test.html")); |
| 240 scoped_refptr<IndexedDBContext> context = |
| 241 BrowserContext::GetDefaultStoragePartition( |
| 242 shell()->web_contents()->GetBrowserContext())-> |
| 243 GetIndexedDBContext(); |
| 244 IndexedDBContextImpl* context_impl = |
| 245 static_cast<IndexedDBContextImpl*>(context.get()); |
| 246 FilePath leveldb_dir(FILE_PATH_LITERAL("file__0.indexeddb.leveldb")); |
| 247 FilePath log_file(FILE_PATH_LITERAL("LOG")); |
| 248 FilePath log_file_path = |
| 249 context_impl->data_path().Append(leveldb_dir).Append(log_file); |
| 250 int64 size; |
| 251 EXPECT_TRUE(file_util::GetFileSize(log_file_path, &size)); |
| 252 EXPECT_GT(size, 0); |
| 253 } |
| 254 |
| 255 // Complex multi-step (converted from pyauto) tests begin here. |
| 256 |
237 // Verify null key path persists after restarting browser. | 257 // Verify null key path persists after restarting browser. |
238 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, PRE_NullKeyPathPersistence) { | 258 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, PRE_NullKeyPathPersistence) { |
239 NavigateAndWaitForTitle(shell(), "bug_90635.html", "#part1", | 259 NavigateAndWaitForTitle(shell(), "bug_90635.html", "#part1", |
240 "pass - first run"); | 260 "pass - first run"); |
241 } | 261 } |
242 | 262 |
243 // Verify null key path persists after restarting browser. | 263 // Verify null key path persists after restarting browser. |
244 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, NullKeyPathPersistence) { | 264 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, NullKeyPathPersistence) { |
245 NavigateAndWaitForTitle(shell(), "bug_90635.html", "#part2", | 265 NavigateAndWaitForTitle(shell(), "bug_90635.html", "#part2", |
246 "pass - second run"); | 266 "pass - second run"); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 TitleWatcher title_watcher(new_shell->web_contents(), expected_title16); | 300 TitleWatcher title_watcher(new_shell->web_contents(), expected_title16); |
281 | 301 |
282 base::KillProcess( | 302 base::KillProcess( |
283 shell()->web_contents()->GetRenderProcessHost()->GetHandle(), 0, true); | 303 shell()->web_contents()->GetRenderProcessHost()->GetHandle(), 0, true); |
284 shell()->Close(); | 304 shell()->Close(); |
285 | 305 |
286 EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle()); | 306 EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle()); |
287 } | 307 } |
288 | 308 |
289 } // namespace content | 309 } // namespace content |
OLD | NEW |