OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_path.h" | 5 #include "base/file_path.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "content/browser/browser_thread_impl.h" | 7 #include "content/browser/browser_thread_impl.h" |
8 #include "content/browser/in_process_webkit/webkit_context.h" | 8 #include "content/browser/in_process_webkit/webkit_context.h" |
9 #include "content/test/test_browser_context.h" | 9 #include "content/test/test_browser_context.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 #include "webkit/quota/mock_special_storage_policy.h" | 11 #include "webkit/quota/mock_special_storage_policy.h" |
12 | 12 |
13 using content::BrowserThread; | 13 using content::BrowserThread; |
14 using content::BrowserThreadImpl; | 14 using content::BrowserThreadImpl; |
15 | 15 |
16 class DOMStorageTest : public testing::Test { | 16 class DOMStorageTest : public testing::Test { |
17 public: | 17 public: |
18 DOMStorageTest() | 18 DOMStorageTest() |
19 : message_loop_(MessageLoop::TYPE_IO), | 19 : message_loop_(MessageLoop::TYPE_IO), |
20 webkit_thread_(BrowserThread::WEBKIT, &message_loop_) { | 20 webkit_thread_(BrowserThread::WEBKIT_DEPRECATED, &message_loop_) { |
21 } | 21 } |
22 | 22 |
23 protected: | 23 protected: |
24 MessageLoop message_loop_; | 24 MessageLoop message_loop_; |
25 | 25 |
26 private: | 26 private: |
27 BrowserThreadImpl webkit_thread_; | 27 BrowserThreadImpl webkit_thread_; |
28 }; | 28 }; |
29 | 29 |
30 TEST_F(DOMStorageTest, SessionOnly) { | 30 TEST_F(DOMStorageTest, SessionOnly) { |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 // temporary data directory stays alive long enough to conduct the test. | 111 // temporary data directory stays alive long enough to conduct the test. |
112 browser_context.webkit_context_ = NULL; | 112 browser_context.webkit_context_ = NULL; |
113 // Run the message loop to ensure that DOMStorageContext gets destroyed. | 113 // Run the message loop to ensure that DOMStorageContext gets destroyed. |
114 message_loop_.RunAllPending(); | 114 message_loop_.RunAllPending(); |
115 | 115 |
116 // Expected result: no database files were deleted because of | 116 // Expected result: no database files were deleted because of |
117 // SaveSessionState. | 117 // SaveSessionState. |
118 EXPECT_TRUE(file_util::PathExists(session_only_database_path)); | 118 EXPECT_TRUE(file_util::PathExists(session_only_database_path)); |
119 EXPECT_TRUE(file_util::PathExists(permanent_database_path)); | 119 EXPECT_TRUE(file_util::PathExists(permanent_database_path)); |
120 } | 120 } |
OLD | NEW |