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/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/metrics/stats_counters.h" | 8 #include "base/metrics/stats_counters.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
13 #include "media/base/media.h" | 13 #include "media/base/media.h" |
14 #include "net/cookies/cookie_monster.h" | 14 #include "net/cookies/cookie_monster.h" |
15 #include "net/http/http_cache.h" | 15 #include "net/http/http_cache.h" |
16 #include "net/test/test_server.h" | 16 #include "net/test/test_server.h" |
17 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebAudioDevi
ce.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebAudioDevi
ce.h" |
18 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebData.h" | 18 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebData.h" |
19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h" | 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h" |
20 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFileSyste
m.h" | 20 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFileSyste
m.h" |
21 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGamepads.
h" | 21 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGamepads.
h" |
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBFactory.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBFactory.h" |
23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h" | |
24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h" | |
25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" |
27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h
" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h
" |
28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" | 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" |
29 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSerialize
dScriptValue.h" | |
30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageArea.h" | 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageArea.h" |
31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispat
cher.h" | 28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispat
cher.h" |
32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h
" | 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h
" |
33 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 30 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
34 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" | 31 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" |
35 #include "v8/include/v8.h" | 32 #include "v8/include/v8.h" |
36 #include "webkit/appcache/web_application_cache_host_impl.h" | 33 #include "webkit/appcache/web_application_cache_host_impl.h" |
37 #include "webkit/database/vfs_backend.h" | 34 #include "webkit/database/vfs_backend.h" |
38 #include "webkit/glue/simple_webmimeregistry_impl.h" | 35 #include "webkit/glue/simple_webmimeregistry_impl.h" |
39 #include "webkit/glue/webclipboard_impl.h" | 36 #include "webkit/glue/webclipboard_impl.h" |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 private: | 370 private: |
374 scoped_ptr<WebIDBFactory> factory_; | 371 scoped_ptr<WebIDBFactory> factory_; |
375 ScopedTempDir indexed_db_dir_; | 372 ScopedTempDir indexed_db_dir_; |
376 WebString data_dir_; | 373 WebString data_dir_; |
377 }; | 374 }; |
378 | 375 |
379 WebKit::WebIDBFactory* TestWebKitPlatformSupport::idbFactory() { | 376 WebKit::WebIDBFactory* TestWebKitPlatformSupport::idbFactory() { |
380 return new TestWebIDBFactory(); | 377 return new TestWebIDBFactory(); |
381 } | 378 } |
382 | 379 |
383 void TestWebKitPlatformSupport::createIDBKeysFromSerializedValuesAndKeyPath( | |
384 const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values, | |
385 const WebKit::WebIDBKeyPath& keyPath, | |
386 WebKit::WebVector<WebKit::WebIDBKey>& keys_out) { | |
387 WebKit::WebVector<WebKit::WebIDBKey> keys(values.size()); | |
388 for (size_t i = 0; i < values.size(); ++i) { | |
389 keys[i] = WebKit::WebIDBKey::createFromValueAndKeyPath( | |
390 values[i], keyPath); | |
391 } | |
392 keys_out.swap(keys); | |
393 } | |
394 | |
395 WebKit::WebSerializedScriptValue | |
396 TestWebKitPlatformSupport::injectIDBKeyIntoSerializedValue( | |
397 const WebKit::WebIDBKey& key, | |
398 const WebKit::WebSerializedScriptValue& value, | |
399 const WebKit::WebIDBKeyPath& keyPath) { | |
400 return WebKit::WebIDBKey::injectIDBKeyIntoSerializedValue( | |
401 key, value, keyPath); | |
402 } | |
403 | |
404 #if defined(OS_WIN) || defined(OS_MACOSX) | 380 #if defined(OS_WIN) || defined(OS_MACOSX) |
405 void TestWebKitPlatformSupport::SetThemeEngine(WebKit::WebThemeEngine* engine) { | 381 void TestWebKitPlatformSupport::SetThemeEngine(WebKit::WebThemeEngine* engine) { |
406 active_theme_engine_ = engine ? | 382 active_theme_engine_ = engine ? |
407 engine : WebKitPlatformSupportImpl::themeEngine(); | 383 engine : WebKitPlatformSupportImpl::themeEngine(); |
408 } | 384 } |
409 | 385 |
410 WebKit::WebThemeEngine* TestWebKitPlatformSupport::themeEngine() { | 386 WebKit::WebThemeEngine* TestWebKitPlatformSupport::themeEngine() { |
411 return active_theme_engine_; | 387 return active_theme_engine_; |
412 } | 388 } |
413 #endif | 389 #endif |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 | 489 |
514 WebKit::WebRTCPeerConnectionHandler* | 490 WebKit::WebRTCPeerConnectionHandler* |
515 TestWebKitPlatformSupport::createRTCPeerConnectionHandler( | 491 TestWebKitPlatformSupport::createRTCPeerConnectionHandler( |
516 WebKit::WebRTCPeerConnectionHandlerClient* client) { | 492 WebKit::WebRTCPeerConnectionHandlerClient* client) { |
517 if (shadow_platform_delegate_) | 493 if (shadow_platform_delegate_) |
518 return shadow_platform_delegate_->createRTCPeerConnectionHandler(client); | 494 return shadow_platform_delegate_->createRTCPeerConnectionHandler(client); |
519 | 495 |
520 return webkit_glue::WebKitPlatformSupportImpl::createRTCPeerConnectionHandler( | 496 return webkit_glue::WebKitPlatformSupportImpl::createRTCPeerConnectionHandler( |
521 client); | 497 client); |
522 } | 498 } |
OLD | NEW |