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 "webkit/support/test_webkit_platform_support.h" | 5 #include "webkit/support/test_webkit_platform_support.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/metrics/stats_counters.h" | 10 #include "base/metrics/stats_counters.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 blob_registry_ = new TestShellWebBlobRegistryImpl(); | 107 blob_registry_ = new TestShellWebBlobRegistryImpl(); |
108 | 108 |
109 file_utilities_.set_sandbox_enabled(false); | 109 file_utilities_.set_sandbox_enabled(false); |
110 | 110 |
111 if (!file_system_root_.CreateUniqueTempDir()) { | 111 if (!file_system_root_.CreateUniqueTempDir()) { |
112 LOG(WARNING) << "Failed to create a temp dir for the filesystem." | 112 LOG(WARNING) << "Failed to create a temp dir for the filesystem." |
113 "FileSystem feature will be disabled."; | 113 "FileSystem feature will be disabled."; |
114 DCHECK(file_system_root_.path().empty()); | 114 DCHECK(file_system_root_.path().empty()); |
115 } | 115 } |
116 | 116 |
117 { | |
118 // Initialize the hyphen library with a sample dictionary. | |
119 base::FilePath path; | |
120 PathService::Get(base::DIR_SOURCE_ROOT, &path); | |
121 path = path.Append(FILE_PATH_LITERAL("third_party/hyphen/hyph_en_US.dic")); | |
122 base::PlatformFile dict_file = base::CreatePlatformFile( | |
123 path, | |
124 base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ, | |
125 NULL, NULL); | |
126 hyphenator_.LoadDictionary(dict_file); | |
127 } | |
128 | |
129 #if defined(OS_WIN) | 117 #if defined(OS_WIN) |
130 // Ensure we pick up the default theme engine. | 118 // Ensure we pick up the default theme engine. |
131 SetThemeEngine(NULL); | 119 SetThemeEngine(NULL); |
132 #endif | 120 #endif |
133 | 121 |
134 net::CookieMonster::EnableFileScheme(); | 122 net::CookieMonster::EnableFileScheme(); |
135 | 123 |
136 // Test shell always exposes the GC. | 124 // Test shell always exposes the GC. |
137 webkit_glue::SetJavaScriptFlags(" --expose-gc"); | 125 webkit_glue::SetJavaScriptFlags(" --expose-gc"); |
138 // Expose GCController to JavaScript. | 126 // Expose GCController to JavaScript. |
(...skipping 18 matching lines...) Expand all Loading... |
157 } | 145 } |
158 | 146 |
159 WebKit::WebSandboxSupport* TestWebKitPlatformSupport::sandboxSupport() { | 147 WebKit::WebSandboxSupport* TestWebKitPlatformSupport::sandboxSupport() { |
160 return NULL; | 148 return NULL; |
161 } | 149 } |
162 | 150 |
163 WebKit::WebBlobRegistry* TestWebKitPlatformSupport::blobRegistry() { | 151 WebKit::WebBlobRegistry* TestWebKitPlatformSupport::blobRegistry() { |
164 return blob_registry_.get(); | 152 return blob_registry_.get(); |
165 } | 153 } |
166 | 154 |
167 WebKit::WebHyphenator* TestWebKitPlatformSupport::hyphenator() { | |
168 return &hyphenator_; | |
169 } | |
170 | |
171 WebKit::WebIDBFactory* TestWebKitPlatformSupport::idbFactory() { | 155 WebKit::WebIDBFactory* TestWebKitPlatformSupport::idbFactory() { |
172 NOTREACHED() << | 156 NOTREACHED() << |
173 "IndexedDB cannot be tested with in-process harnesses."; | 157 "IndexedDB cannot be tested with in-process harnesses."; |
174 return NULL; | 158 return NULL; |
175 } | 159 } |
176 | 160 |
177 bool TestWebKitPlatformSupport::sandboxEnabled() { | 161 bool TestWebKitPlatformSupport::sandboxEnabled() { |
178 return true; | 162 return true; |
179 } | 163 } |
180 | 164 |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 return view.release(); | 429 return view.release(); |
446 } | 430 } |
447 | 431 |
448 WebKit::WebLayerTreeView* | 432 WebKit::WebLayerTreeView* |
449 TestWebKitPlatformSupport::createLayerTreeViewForTesting( | 433 TestWebKitPlatformSupport::createLayerTreeViewForTesting( |
450 TestViewType type) { | 434 TestViewType type) { |
451 DCHECK_EQ(TestViewTypeUnitTest, type); | 435 DCHECK_EQ(TestViewTypeUnitTest, type); |
452 return createLayerTreeViewForTesting(); | 436 return createLayerTreeViewForTesting(); |
453 } | 437 } |
454 | 438 |
OLD | NEW |