Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: content/test/test_webkit_platform_support.cc

Issue 147973002: Move SetJavaScriptFlags() from webkit to content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/test/test_webkit_platform_support.h" 5 #include "content/test/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/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
11 #include "base/metrics/stats_counters.h" 11 #include "base/metrics/stats_counters.h"
12 #include "base/path_service.h" 12 #include "base/path_service.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "content/child/child_thread.h"
14 #include "content/public/common/content_switches.h" 15 #include "content/public/common/content_switches.h"
15 #include "content/test/mock_webclipboard_impl.h" 16 #include "content/test/mock_webclipboard_impl.h"
16 #include "content/test/web_gesture_curve_mock.h" 17 #include "content/test/web_gesture_curve_mock.h"
17 #include "content/test/web_layer_tree_view_impl_for_testing.h" 18 #include "content/test/web_layer_tree_view_impl_for_testing.h"
18 #include "content/test/weburl_loader_mock_factory.h" 19 #include "content/test/weburl_loader_mock_factory.h"
19 #include "media/base/media.h" 20 #include "media/base/media.h"
20 #include "net/cookies/cookie_monster.h" 21 #include "net/cookies/cookie_monster.h"
21 #include "net/test/spawned_test_server/spawned_test_server.h" 22 #include "net/test/spawned_test_server/spawned_test_server.h"
22 #include "third_party/WebKit/public/platform/WebData.h" 23 #include "third_party/WebKit/public/platform/WebData.h"
23 #include "third_party/WebKit/public/platform/WebFileSystem.h" 24 #include "third_party/WebKit/public/platform/WebFileSystem.h"
24 #include "third_party/WebKit/public/platform/WebStorageArea.h" 25 #include "third_party/WebKit/public/platform/WebStorageArea.h"
25 #include "third_party/WebKit/public/platform/WebStorageNamespace.h" 26 #include "third_party/WebKit/public/platform/WebStorageNamespace.h"
26 #include "third_party/WebKit/public/platform/WebString.h" 27 #include "third_party/WebKit/public/platform/WebString.h"
27 #include "third_party/WebKit/public/platform/WebURL.h" 28 #include "third_party/WebKit/public/platform/WebURL.h"
28 #include "third_party/WebKit/public/web/WebDatabase.h" 29 #include "third_party/WebKit/public/web/WebDatabase.h"
29 #include "third_party/WebKit/public/web/WebKit.h" 30 #include "third_party/WebKit/public/web/WebKit.h"
30 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" 31 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
31 #include "third_party/WebKit/public/web/WebScriptController.h" 32 #include "third_party/WebKit/public/web/WebScriptController.h"
32 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" 33 #include "third_party/WebKit/public/web/WebSecurityPolicy.h"
33 #include "third_party/WebKit/public/web/WebStorageEventDispatcher.h" 34 #include "third_party/WebKit/public/web/WebStorageEventDispatcher.h"
34 #include "v8/include/v8.h" 35 #include "v8/include/v8.h"
35 #include "webkit/browser/database/vfs_backend.h" 36 #include "webkit/browser/database/vfs_backend.h"
36 #include "webkit/child/webkitplatformsupport_impl.h" 37 #include "webkit/child/webkitplatformsupport_impl.h"
37 #include "webkit/glue/simple_webmimeregistry_impl.h" 38 #include "webkit/glue/simple_webmimeregistry_impl.h"
38 #include "webkit/glue/webkit_glue.h"
39 #include "webkit/renderer/compositor_bindings/web_compositor_support_impl.h" 39 #include "webkit/renderer/compositor_bindings/web_compositor_support_impl.h"
40 40
41 #if defined(OS_WIN) 41 #if defined(OS_WIN)
42 #include "third_party/WebKit/public/platform/win/WebThemeEngine.h" 42 #include "third_party/WebKit/public/platform/win/WebThemeEngine.h"
43 #elif defined(OS_MACOSX) 43 #elif defined(OS_MACOSX)
44 #include "base/mac/mac_util.h" 44 #include "base/mac/mac_util.h"
45 #endif 45 #endif
46 46
47 using blink::WebScriptController; 47 using blink::WebScriptController;
48 using webkit::WebLayerTreeViewImplForTesting; 48 using webkit::WebLayerTreeViewImplForTesting;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 } 97 }
98 98
99 #if defined(OS_WIN) 99 #if defined(OS_WIN)
100 // Ensure we pick up the default theme engine. 100 // Ensure we pick up the default theme engine.
101 SetThemeEngine(NULL); 101 SetThemeEngine(NULL);
102 #endif 102 #endif
103 103
104 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kEnableFileCookies); 104 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kEnableFileCookies);
105 105
106 // Test shell always exposes the GC. 106 // Test shell always exposes the GC.
107 webkit_glue::SetJavaScriptFlags(" --expose-gc"); 107 ChildThread::SetJavaScriptFlags(" --expose-gc");
108 } 108 }
109 109
110 TestWebKitPlatformSupport::~TestWebKitPlatformSupport() { 110 TestWebKitPlatformSupport::~TestWebKitPlatformSupport() {
111 url_loader_factory_.reset(); 111 url_loader_factory_.reset();
112 mock_clipboard_.reset(); 112 mock_clipboard_.reset();
113 blink::shutdown(); 113 blink::shutdown();
114 } 114 }
115 115
116 blink::WebMimeRegistry* TestWebKitPlatformSupport::mimeRegistry() { 116 blink::WebMimeRegistry* TestWebKitPlatformSupport::mimeRegistry() {
117 return &mime_registry_; 117 return &mime_registry_;
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 const blink::WebString& path) { 318 const blink::WebString& path) {
319 base::FilePath file_path = base::FilePath::FromUTF16Unsafe(path); 319 base::FilePath file_path = base::FilePath::FromUTF16Unsafe(path);
320 320
321 std::string buffer; 321 std::string buffer;
322 base::ReadFileToString(file_path, &buffer); 322 base::ReadFileToString(file_path, &buffer);
323 323
324 return blink::WebData(buffer.data(), buffer.size()); 324 return blink::WebData(buffer.data(), buffer.size());
325 } 325 }
326 326
327 } // namespace content 327 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698