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 "webkit/support/test_webkit_client.h" | 5 #include "webkit/support/test_webkit_client.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/scoped_temp_dir.h" | 9 #include "base/scoped_temp_dir.h" |
10 #include "base/metrics/stats_counters.h" | 10 #include "base/metrics/stats_counters.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 #include "webkit/tools/test_shell/test_shell_request_context.h" | 50 #include "webkit/tools/test_shell/test_shell_request_context.h" |
51 #include "webkit/tools/test_shell/test_shell_webblobregistry_impl.h" | 51 #include "webkit/tools/test_shell/test_shell_webblobregistry_impl.h" |
52 #include "v8/include/v8.h" | 52 #include "v8/include/v8.h" |
53 | 53 |
54 #if defined(OS_WIN) | 54 #if defined(OS_WIN) |
55 #include "third_party/WebKit/WebKit/chromium/public/win/WebThemeEngine.h" | 55 #include "third_party/WebKit/WebKit/chromium/public/win/WebThemeEngine.h" |
56 #include "webkit/tools/test_shell/test_shell_webthemeengine.h" | 56 #include "webkit/tools/test_shell/test_shell_webthemeengine.h" |
57 #elif defined(OS_LINUX) | 57 #elif defined(OS_LINUX) |
58 #include "third_party/WebKit/WebKit/chromium/public/linux/WebThemeEngine.h" | 58 #include "third_party/WebKit/WebKit/chromium/public/linux/WebThemeEngine.h" |
59 #elif defined(OS_MACOSX) | 59 #elif defined(OS_MACOSX) |
60 #include "base/mac_util.h" | 60 #include "base/mac/mac_util.h" |
61 #endif | 61 #endif |
62 | 62 |
63 using WebKit::WebScriptController; | 63 using WebKit::WebScriptController; |
64 | 64 |
65 TestWebKitClient::TestWebKitClient(bool unit_test_mode) | 65 TestWebKitClient::TestWebKitClient(bool unit_test_mode) |
66 : unit_test_mode_(unit_test_mode) { | 66 : unit_test_mode_(unit_test_mode) { |
67 v8::V8::SetCounterFunction(base::StatsTable::FindLocation); | 67 v8::V8::SetCounterFunction(base::StatsTable::FindLocation); |
68 | 68 |
69 WebKit::initialize(this); | 69 WebKit::initialize(this); |
70 WebKit::setLayoutTestMode(true); | 70 WebKit::setLayoutTestMode(true); |
(...skipping 10 matching lines...) Expand all Loading... |
81 WebKit::WebRuntimeFeatures::enableWebGL(true); | 81 WebKit::WebRuntimeFeatures::enableWebGL(true); |
82 WebKit::WebRuntimeFeatures::enablePushState(true); | 82 WebKit::WebRuntimeFeatures::enablePushState(true); |
83 WebKit::WebRuntimeFeatures::enableNotifications(true); | 83 WebKit::WebRuntimeFeatures::enableNotifications(true); |
84 WebKit::WebRuntimeFeatures::enableTouch(true); | 84 WebKit::WebRuntimeFeatures::enableTouch(true); |
85 | 85 |
86 // Load libraries for media and enable the media player. | 86 // Load libraries for media and enable the media player. |
87 bool enable_media = false; | 87 bool enable_media = false; |
88 FilePath module_path; | 88 FilePath module_path; |
89 if (PathService::Get(base::DIR_MODULE, &module_path)) { | 89 if (PathService::Get(base::DIR_MODULE, &module_path)) { |
90 #if defined(OS_MACOSX) | 90 #if defined(OS_MACOSX) |
91 if (mac_util::AmIBundled()) | 91 if (base::mac::AmIBundled()) |
92 module_path = module_path.DirName().DirName().DirName(); | 92 module_path = module_path.DirName().DirName().DirName(); |
93 #endif | 93 #endif |
94 if (media::InitializeMediaLibrary(module_path)) | 94 if (media::InitializeMediaLibrary(module_path)) |
95 enable_media = true; | 95 enable_media = true; |
96 } | 96 } |
97 WebKit::WebRuntimeFeatures::enableMediaPlayer(enable_media); | 97 WebKit::WebRuntimeFeatures::enableMediaPlayer(enable_media); |
98 LOG_IF(WARNING, !enable_media) << "Failed to initialize the media library.\n"; | 98 LOG_IF(WARNING, !enable_media) << "Failed to initialize the media library.\n"; |
99 | 99 |
100 // TODO(joth): Make a dummy geolocation service implemenation for | 100 // TODO(joth): Make a dummy geolocation service implemenation for |
101 // test_shell, and set this to true. http://crbug.com/36451 | 101 // test_shell, and set this to true. http://crbug.com/36451 |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 } | 341 } |
342 #endif | 342 #endif |
343 | 343 |
344 WebKit::WebSharedWorkerRepository* TestWebKitClient::sharedWorkerRepository() { | 344 WebKit::WebSharedWorkerRepository* TestWebKitClient::sharedWorkerRepository() { |
345 return NULL; | 345 return NULL; |
346 } | 346 } |
347 | 347 |
348 WebKit::WebGraphicsContext3D* TestWebKitClient::createGraphicsContext3D() { | 348 WebKit::WebGraphicsContext3D* TestWebKitClient::createGraphicsContext3D() { |
349 return WebKit::WebGraphicsContext3D::createDefault(); | 349 return WebKit::WebGraphicsContext3D::createDefault(); |
350 } | 350 } |
OLD | NEW |