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 "base/scoped_temp_dir.h" | 7 #include "base/scoped_temp_dir.h" |
8 #include "base/test/thread_test_helper.h" | 8 #include "base/test/thread_test_helper.h" |
9 #include "chrome/test/base/in_process_browser_test.h" | 9 #include "chrome/test/base/in_process_browser_test.h" |
10 #include "chrome/test/base/testing_profile.h" | 10 #include "chrome/test/base/testing_profile.h" |
11 #include "content/browser/in_process_webkit/dom_storage_context.h" | 11 #include "content/browser/in_process_webkit/dom_storage_context.h" |
12 #include "content/browser/in_process_webkit/webkit_context.h" | 12 #include "content/browser/in_process_webkit/webkit_context.h" |
13 | 13 |
| 14 using content::BrowserThread; |
| 15 |
14 typedef InProcessBrowserTest DOMStorageBrowserTest; | 16 typedef InProcessBrowserTest DOMStorageBrowserTest; |
15 | 17 |
16 // In proc browser test is needed here because ClearLocalState indirectly calls | 18 // In proc browser test is needed here because ClearLocalState indirectly calls |
17 // WebKit's isMainThread through WebSecurityOrigin->SecurityOrigin. | 19 // WebKit's isMainThread through WebSecurityOrigin->SecurityOrigin. |
18 IN_PROC_BROWSER_TEST_F(DOMStorageBrowserTest, ClearLocalState) { | 20 IN_PROC_BROWSER_TEST_F(DOMStorageBrowserTest, ClearLocalState) { |
19 // Create test files. | 21 // Create test files. |
20 ScopedTempDir temp_dir; | 22 ScopedTempDir temp_dir; |
21 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); | 23 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); |
22 FilePath domstorage_dir = temp_dir.path().Append( | 24 FilePath domstorage_dir = temp_dir.path().Append( |
23 DOMStorageContext::kLocalStorageDirectory); | 25 DOMStorageContext::kLocalStorageDirectory); |
(...skipping 22 matching lines...) Expand all Loading... |
46 scoped_refptr<base::ThreadTestHelper> helper( | 48 scoped_refptr<base::ThreadTestHelper> helper( |
47 new base::ThreadTestHelper( | 49 new base::ThreadTestHelper( |
48 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::WEBKIT))); | 50 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::WEBKIT))); |
49 ASSERT_TRUE(helper->Run()); | 51 ASSERT_TRUE(helper->Run()); |
50 | 52 |
51 // Because we specified https for scheme to be skipped the second file | 53 // Because we specified https for scheme to be skipped the second file |
52 // should survive and the first go into vanity. | 54 // should survive and the first go into vanity. |
53 ASSERT_FALSE(file_util::PathExists(temp_file_path_1)); | 55 ASSERT_FALSE(file_util::PathExists(temp_file_path_1)); |
54 ASSERT_TRUE(file_util::PathExists(temp_file_path_2)); | 56 ASSERT_TRUE(file_util::PathExists(temp_file_path_2)); |
55 } | 57 } |
OLD | NEW |