Upstream version 9.37.195.0
[platform/framework/web/crosswalk.git] / src / content / test / test_webkit_platform_support.cc
index 0e9aaf0..a55ebf6 100644 (file)
@@ -42,9 +42,16 @@ namespace content {
 TestWebKitPlatformSupport::TestWebKitPlatformSupport() {
   url_loader_factory_.reset(new WebURLLoaderMockFactory());
   mock_clipboard_.reset(new MockWebClipboardImpl());
-  v8::V8::SetCounterFunction(base::StatsTable::FindLocation);
+
+  // Create an anonymous stats table since we don't need to share between
+  // processes.
+  stats_table_.reset(
+      new base::StatsTable(base::StatsTable::TableIdentifier(), 20, 200));
+  base::StatsTable::set_current(stats_table_.get());
 
   blink::initialize(this);
+  blink::mainThreadIsolate()->SetCounterFunction(
+      base::StatsTable::FindLocation);
   blink::setLayoutTestMode(true);
   blink::WebSecurityPolicy::registerURLSchemeAsLocal(
       blink::WebString::fromUTF8("test-shell-resource"));
@@ -97,6 +104,8 @@ TestWebKitPlatformSupport::~TestWebKitPlatformSupport() {
   url_loader_factory_.reset();
   mock_clipboard_.reset();
   blink::shutdown();
+  base::StatsTable::set_current(NULL);
+  stats_table_.reset();
 }
 
 blink::WebMimeRegistry* TestWebKitPlatformSupport::mimeRegistry() {