OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/ref_counted.h" | 8 #include "base/ref_counted.h" |
9 #include "base/scoped_temp_dir.h" | 9 #include "base/scoped_temp_dir.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
11 #include "chrome/browser/in_process_webkit/indexed_db_context.h" | 11 #include "chrome/browser/in_process_webkit/indexed_db_context.h" |
12 #include "chrome/browser/in_process_webkit/webkit_context.h" | |
12 #include "chrome/browser/tab_contents/tab_contents.h" | 13 #include "chrome/browser/tab_contents/tab_contents.h" |
13 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
14 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
15 #include "chrome/test/in_process_browser_test.h" | 16 #include "chrome/test/in_process_browser_test.h" |
17 #include "chrome/test/testing_profile.h" | |
16 #include "chrome/test/ui_test_utils.h" | 18 #include "chrome/test/ui_test_utils.h" |
17 | 19 |
18 // This browser test is aimed towards exercising the IndexedDB bindings and | 20 // This browser test is aimed towards exercising the IndexedDB bindings and |
19 // the actual implementation that lives in the browser side (in_process_webkit). | 21 // the actual implementation that lives in the browser side (in_process_webkit). |
20 class IndexedDBBrowserTest : public InProcessBrowserTest { | 22 class IndexedDBBrowserTest : public InProcessBrowserTest { |
21 public: | 23 public: |
22 IndexedDBBrowserTest() { | 24 IndexedDBBrowserTest() { |
23 EnableDOMAutomation(); | 25 EnableDOMAutomation(); |
24 } | 26 } |
25 | 27 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
95 FilePath::StringType file_name_1(FILE_PATH_LITERAL("http_www.google.com_0")); | 97 FilePath::StringType file_name_1(FILE_PATH_LITERAL("http_www.google.com_0")); |
96 file_name_1.append(IndexedDBContext::kIndexedDBExtension); | 98 file_name_1.append(IndexedDBContext::kIndexedDBExtension); |
97 FilePath::StringType file_name_2(FILE_PATH_LITERAL("https_www.google.com_0")); | 99 FilePath::StringType file_name_2(FILE_PATH_LITERAL("https_www.google.com_0")); |
98 file_name_2.append(IndexedDBContext::kIndexedDBExtension); | 100 file_name_2.append(IndexedDBContext::kIndexedDBExtension); |
99 FilePath temp_file_path_1 = indexeddb_dir.Append(file_name_1); | 101 FilePath temp_file_path_1 = indexeddb_dir.Append(file_name_1); |
100 FilePath temp_file_path_2 = indexeddb_dir.Append(file_name_2); | 102 FilePath temp_file_path_2 = indexeddb_dir.Append(file_name_2); |
101 | 103 |
102 ASSERT_EQ(1, file_util::WriteFile(temp_file_path_1, ".", 1)); | 104 ASSERT_EQ(1, file_util::WriteFile(temp_file_path_1, ".", 1)); |
103 ASSERT_EQ(1, file_util::WriteFile(temp_file_path_2, "o", 1)); | 105 ASSERT_EQ(1, file_util::WriteFile(temp_file_path_2, "o", 1)); |
104 | 106 |
105 IndexedDBContext::ClearLocalState(temp_dir.path(), "https"); | 107 TestingProfile profile; |
108 scoped_refptr<WebKitContext> webkit_context(new WebKitContext(&profile)); | |
109 IndexedDBContext context(webkit_context); | |
110 | |
111 context.ClearLocalState(indexeddb_dir, "https"); | |
jochen (gone - plz use gerrit)
2010/11/29 10:45:24
you should delete the webkit context and check tha
pastarmovj
2010/11/29 12:50:37
done. More refactoring was needed to make this tes
| |
106 | 112 |
107 // Because we specified https for scheme to be skipped the second file | 113 // Because we specified https for scheme to be skipped the second file |
108 // should survive and the first go into vanity. | 114 // should survive and the first go into vanity. |
109 ASSERT_FALSE(file_util::PathExists(temp_file_path_1)); | 115 ASSERT_FALSE(file_util::PathExists(temp_file_path_1)); |
110 ASSERT_TRUE(file_util::PathExists(temp_file_path_2)); | 116 ASSERT_TRUE(file_util::PathExists(temp_file_path_2)); |
111 } | 117 } |
OLD | NEW |