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/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/files/scoped_temp_dir.h" | 6 #include "base/files/scoped_temp_dir.h" |
7 #include "content/browser/browser_thread_impl.h" | 7 #include "content/browser/browser_thread_impl.h" |
8 #include "content/browser/indexed_db/indexed_db_context_impl.h" | 8 #include "content/browser/indexed_db/indexed_db_context_impl.h" |
9 #include "content/public/browser/storage_partition.h" | 9 #include "content/public/browser/storage_partition.h" |
10 #include "content/public/common/url_constants.h" | 10 #include "content/public/common/url_constants.h" |
11 #include "content/public/test/test_browser_context.h" | 11 #include "content/public/test/test_browser_context.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 #include "third_party/WebKit/Source/Platform/chromium/public/WebIDBDatabase.h" | 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebIDBDatabase.h" |
14 #include "webkit/database/database_util.h" | 14 #include "webkit/database/database_util.h" |
15 #include "webkit/quota/mock_special_storage_policy.h" | 15 #include "webkit/quota/mock_special_storage_policy.h" |
16 #include "webkit/quota/quota_manager.h" | 16 #include "webkit/quota/quota_manager.h" |
17 #include "webkit/quota/special_storage_policy.h" | 17 #include "webkit/quota/special_storage_policy.h" |
18 | 18 |
19 using webkit_database::DatabaseUtil; | 19 using webkit_database::DatabaseUtil; |
20 | 20 |
21 namespace content { | 21 namespace content { |
22 | 22 |
23 class IndexedDBTest : public testing::Test { | 23 class IndexedDBTest : public testing::Test { |
24 public: | 24 public: |
25 IndexedDBTest() | 25 IndexedDBTest() |
26 : message_loop_(MessageLoop::TYPE_IO), | 26 : message_loop_(base::MessageLoop::TYPE_IO), |
27 webkit_thread_(BrowserThread::WEBKIT_DEPRECATED, &message_loop_), | 27 webkit_thread_(BrowserThread::WEBKIT_DEPRECATED, &message_loop_), |
28 file_thread_(BrowserThread::FILE_USER_BLOCKING, &message_loop_), | 28 file_thread_(BrowserThread::FILE_USER_BLOCKING, &message_loop_), |
29 io_thread_(BrowserThread::IO, &message_loop_) { | 29 io_thread_(BrowserThread::IO, &message_loop_) {} |
30 } | |
31 | 30 |
32 protected: | 31 protected: |
33 MessageLoop message_loop_; | 32 base::MessageLoop message_loop_; |
34 | 33 |
35 private: | 34 private: |
36 BrowserThreadImpl webkit_thread_; | 35 BrowserThreadImpl webkit_thread_; |
37 BrowserThreadImpl file_thread_; | 36 BrowserThreadImpl file_thread_; |
38 BrowserThreadImpl io_thread_; | 37 BrowserThreadImpl io_thread_; |
39 }; | 38 }; |
40 | 39 |
41 TEST_F(IndexedDBTest, ClearSessionOnlyDatabases) { | 40 TEST_F(IndexedDBTest, ClearSessionOnlyDatabases) { |
42 base::ScopedTempDir temp_dir; | 41 base::ScopedTempDir temp_dir; |
43 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); | 42 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 message_loop_.RunUntilIdle(); | 193 message_loop_.RunUntilIdle(); |
195 } | 194 } |
196 | 195 |
197 // Make sure we wait until the destructor has run. | 196 // Make sure we wait until the destructor has run. |
198 message_loop_.RunUntilIdle(); | 197 message_loop_.RunUntilIdle(); |
199 | 198 |
200 EXPECT_FALSE(file_util::DirectoryExists(test_path)); | 199 EXPECT_FALSE(file_util::DirectoryExists(test_path)); |
201 } | 200 } |
202 | 201 |
203 } // namespace content | 202 } // namespace content |
OLD | NEW |