summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/renderer/renderer_webkitclient_impl.cc4
-rw-r--r--chrome/renderer/renderer_webkitclient_impl.h4
-rw-r--r--chrome/worker/worker_webkitclient_impl.cc14
-rw-r--r--chrome/worker/worker_webkitclient_impl.h1
-rw-r--r--webkit/glue/webclipboard_impl.cc10
-rw-r--r--webkit/glue/webclipboard_impl.h7
-rw-r--r--webkit/glue/webkitclient_impl.cc5
-rw-r--r--webkit/glue/webkitclient_impl.h3
-rwxr-xr-xwebkit/tools/layout_tests/run_webkit_tests.py19
-rw-r--r--webkit/tools/layout_tests/test_types/test_type_base.py32
-rw-r--r--webkit/tools/test_shell/SConscript1
-rw-r--r--webkit/tools/test_shell/mac/webwidget_host.mm6
-rw-r--r--webkit/tools/test_shell/mock_webclipboard_impl.cc66
-rw-r--r--webkit/tools/test_shell/mock_webclipboard_impl.h38
-rw-r--r--webkit/tools/test_shell/test_shell.gyp2
-rw-r--r--webkit/tools/test_shell/test_shell.vcproj8
-rw-r--r--webkit/tools/test_shell/test_shell_tests.vcproj8
-rw-r--r--webkit/tools/test_shell/test_shell_webkit_init.h16
-rw-r--r--webkit/tools/test_shell/webwidget_host_gtk.cc11
-rw-r--r--webkit/tools/test_shell/webwidget_host_win.cc6
20 files changed, 232 insertions, 29 deletions
diff --git a/chrome/renderer/renderer_webkitclient_impl.cc b/chrome/renderer/renderer_webkitclient_impl.cc
index 26eb73d..f35e9d1 100644
--- a/chrome/renderer/renderer_webkitclient_impl.cc
+++ b/chrome/renderer/renderer_webkitclient_impl.cc
@@ -21,6 +21,10 @@ using WebKit::WebURL;
//------------------------------------------------------------------------------
+WebKit::WebClipboard* RendererWebKitClientImpl::clipboard() {
+ return &clipboard_;
+}
+
WebKit::WebMimeRegistry* RendererWebKitClientImpl::mimeRegistry() {
return &mime_registry_;
}
diff --git a/chrome/renderer/renderer_webkitclient_impl.h b/chrome/renderer/renderer_webkitclient_impl.h
index 603cad9..2efdf66 100644
--- a/chrome/renderer/renderer_webkitclient_impl.h
+++ b/chrome/renderer/renderer_webkitclient_impl.h
@@ -6,6 +6,7 @@
#define CHROME_RENDERER_RENDERER_WEBKIT_CLIENT_IMPL_H_
#include "webkit/glue/simple_webmimeregistry_impl.h"
+#include "webkit/glue/webclipboard_impl.h"
#include "webkit/glue/webkitclient_impl.h"
#if defined(OS_WIN)
@@ -15,6 +16,7 @@
class RendererWebKitClientImpl : public webkit_glue::WebKitClientImpl {
public:
// WebKitClient methods:
+ virtual WebKit::WebClipboard* clipboard();
virtual WebKit::WebMimeRegistry* mimeRegistry();
virtual WebKit::WebSandboxSupport* sandboxSupport();
virtual uint64_t visitedLinkHash(const char* canonicalURL, size_t length);
@@ -43,6 +45,8 @@ class RendererWebKitClientImpl : public webkit_glue::WebKitClientImpl {
};
#endif
+ webkit_glue::WebClipboardImpl clipboard_;
+
MimeRegistry mime_registry_;
#if defined(OS_WIN)
SandboxSupport sandbox_support_;
diff --git a/chrome/worker/worker_webkitclient_impl.cc b/chrome/worker/worker_webkitclient_impl.cc
index e99347a..96fc6ed 100644
--- a/chrome/worker/worker_webkitclient_impl.cc
+++ b/chrome/worker/worker_webkitclient_impl.cc
@@ -4,39 +4,53 @@
#include "chrome/worker/worker_webkitclient_impl.h"
+#include "base/logging.h"
#include "third_party/WebKit/WebKit/chromium/public/WebString.h"
#include "third_party/WebKit/WebKit/chromium/public/WebURL.h"
+WebKit::WebClipboard* WorkerWebKitClientImpl::clipboard() {
+ NOTREACHED();
+ return NULL;
+}
+
WebKit::WebMimeRegistry* WorkerWebKitClientImpl::mimeRegistry() {
+ NOTREACHED();
return NULL;
}
WebKit::WebSandboxSupport* WorkerWebKitClientImpl::sandboxSupport() {
+ NOTREACHED();
return NULL;
}
uint64_t WorkerWebKitClientImpl::visitedLinkHash(const char* canonical_url,
size_t length) {
+ NOTREACHED();
return 0;
}
bool WorkerWebKitClientImpl::isLinkVisited(uint64_t link_hash) {
+ NOTREACHED();
return false;
}
void WorkerWebKitClientImpl::setCookies(const WebKit::WebURL& url,
const WebKit::WebURL& policy_url,
const WebKit::WebString& value) {
+ NOTREACHED();
}
WebKit::WebString WorkerWebKitClientImpl::cookies(
const WebKit::WebURL& url, const WebKit::WebURL& policy_url) {
+ NOTREACHED();
return WebKit::WebString();
}
void WorkerWebKitClientImpl::prefetchHostName(const WebKit::WebString&) {
+ NOTREACHED();
}
WebKit::WebString WorkerWebKitClientImpl::defaultLocale() {
+ NOTREACHED();
return WebKit::WebString();
}
diff --git a/chrome/worker/worker_webkitclient_impl.h b/chrome/worker/worker_webkitclient_impl.h
index d378909..e507cc0 100644
--- a/chrome/worker/worker_webkitclient_impl.h
+++ b/chrome/worker/worker_webkitclient_impl.h
@@ -10,6 +10,7 @@
class WorkerWebKitClientImpl : public webkit_glue::WebKitClientImpl {
public:
// WebKitClient methods:
+ virtual WebKit::WebClipboard* clipboard();
virtual WebKit::WebMimeRegistry* mimeRegistry();
virtual WebKit::WebSandboxSupport* sandboxSupport();
virtual uint64_t visitedLinkHash(const char* canonicalURL, size_t length);
diff --git a/webkit/glue/webclipboard_impl.cc b/webkit/glue/webclipboard_impl.cc
index 21674d2..a95f7e8 100644
--- a/webkit/glue/webclipboard_impl.cc
+++ b/webkit/glue/webclipboard_impl.cc
@@ -7,7 +7,6 @@
#include "base/clipboard.h"
#include "base/logging.h"
#include "base/string_util.h"
-#include "base/string16.h"
#include "googleurl/src/gurl.h"
#include "net/base/escape.h"
#include "third_party/WebKit/WebKit/chromium/public/WebImage.h"
@@ -23,7 +22,9 @@ using WebKit::WebURL;
namespace webkit_glue {
-static std::string URLToMarkup(const WebURL& url, const WebString& title) {
+// Static
+std::string WebClipboardImpl::URLToMarkup(const WebURL& url,
+ const WebString& title) {
std::string markup("<a href=\"");
markup.append(url.spec());
markup.append("\">");
@@ -33,8 +34,9 @@ static std::string URLToMarkup(const WebURL& url, const WebString& title) {
return markup;
}
-static std::string URLToImageMarkup(const WebURL& url,
- const WebString& title) {
+// Static
+std::string WebClipboardImpl::URLToImageMarkup(const WebURL& url,
+ const WebString& title) {
std::string markup("<img src=\"");
markup.append(url.spec());
markup.append("\"");
diff --git a/webkit/glue/webclipboard_impl.h b/webkit/glue/webclipboard_impl.h
index 6640203..f5b7b50 100644
--- a/webkit/glue/webclipboard_impl.h
+++ b/webkit/glue/webclipboard_impl.h
@@ -7,10 +7,17 @@
#include "third_party/WebKit/WebKit/chromium/public/WebClipboard.h"
+#include <string>
+
namespace webkit_glue {
class WebClipboardImpl : public WebKit::WebClipboard {
public:
+ static std::string URLToMarkup(const WebKit::WebURL& url,
+ const WebKit::WebString& title);
+ static std::string URLToImageMarkup(const WebKit::WebURL& url,
+ const WebKit::WebString& title);
+
// WebClipboard methods:
virtual bool isFormatAvailable(WebKit::WebClipboard::Format);
virtual WebKit::WebString readPlainText();
diff --git a/webkit/glue/webkitclient_impl.cc b/webkit/glue/webkitclient_impl.cc
index d14e2ba..b9ef492 100644
--- a/webkit/glue/webkitclient_impl.cc
+++ b/webkit/glue/webkitclient_impl.cc
@@ -11,7 +11,6 @@
#include "third_party/WebKit/WebKit/chromium/public/WebCString.h"
#include "webkit/glue/webkit_glue.h"
-using WebKit::WebClipboard;
using WebKit::WebCString;
using WebKit::WebThemeEngine;
@@ -22,10 +21,6 @@ WebKitClientImpl::WebKitClientImpl()
shared_timer_func_(NULL) {
}
-WebClipboard* WebKitClientImpl::clipboard() {
- return &clipboard_;
-}
-
WebThemeEngine* WebKitClientImpl::themeEngine() {
#if defined(OS_WIN)
return &theme_engine_;
diff --git a/webkit/glue/webkitclient_impl.h b/webkit/glue/webkitclient_impl.h
index e53605d..9fc95fa 100644
--- a/webkit/glue/webkitclient_impl.h
+++ b/webkit/glue/webkitclient_impl.h
@@ -7,7 +7,6 @@
#include "base/timer.h"
#include "third_party/WebKit/WebKit/chromium/public/WebKitClient.h"
-#include "webkit/glue/webclipboard_impl.h"
#if defined(OS_WIN)
#include "webkit/glue/webthemeengine_impl_win.h"
#endif
@@ -21,7 +20,6 @@ class WebKitClientImpl : public WebKit::WebKitClient {
WebKitClientImpl();
// WebKitClient methods (partial implementation):
- virtual WebKit::WebClipboard* clipboard();
virtual WebKit::WebThemeEngine* themeEngine();
virtual void decrementStatsCounter(const char* name);
virtual void incrementStatsCounter(const char* name);
@@ -40,7 +38,6 @@ class WebKitClientImpl : public WebKit::WebKitClient {
shared_timer_func_();
}
- WebClipboardImpl clipboard_;
MessageLoop* main_loop_;
base::OneShotTimer<WebKitClientImpl> shared_timer_;
void (*shared_timer_func_)();
diff --git a/webkit/tools/layout_tests/run_webkit_tests.py b/webkit/tools/layout_tests/run_webkit_tests.py
index c4dd11e..ca84546 100755
--- a/webkit/tools/layout_tests/run_webkit_tests.py
+++ b/webkit/tools/layout_tests/run_webkit_tests.py
@@ -685,6 +685,22 @@ def main(options, args):
if options.platform is None:
options.platform = path_utils.PlatformDir()
+ if options.num_test_shells is None:
+ cpus = 1
+ if sys.platform in ('win32', 'cygwin'):
+ cpus = int(os.environ.get('NUMBER_OF_PROCESSORS', 1))
+ elif (hasattr(os, "sysconf") and
+ os.sysconf_names.has_key("SC_NPROCESSORS_ONLN")):
+ # Linux & Unix:
+ ncpus = os.sysconf("SC_NPROCESSORS_ONLN")
+ if isinstance(ncpus, int) and ncpus > 0:
+ cpus = ncpus
+ elif sys.platform in ('darwin'): # OSX:
+ cpus = int(os.popen2("sysctl -n hw.ncpu")[1].read())
+
+ # TODO: Do timing tests on a single-core machine.
+ options.num_test_shells = 2 * cpus
+
# Include all tests if none are specified.
paths = args
if not paths:
@@ -779,8 +795,7 @@ if '__main__' == __name__:
"newly pass or fail.")
option_parser.add_option("", "--num-test-shells",
default=1,
- help="Experimental. Number of testshells to run in "
- "parallel.")
+ help="Number of testshells to run in parallel.")
option_parser.add_option("", "--time-out-ms",
default=None,
help="Set the timeout for each test")
diff --git a/webkit/tools/layout_tests/test_types/test_type_base.py b/webkit/tools/layout_tests/test_types/test_type_base.py
index 9fab50e..691599c 100644
--- a/webkit/tools/layout_tests/test_types/test_type_base.py
+++ b/webkit/tools/layout_tests/test_types/test_type_base.py
@@ -199,30 +199,40 @@ class TestTypeBase(object):
#
# http://mail.python.org/pipermail/python-list/2008-August/505753.html
# http://bugs.python.org/issue3210
+ #
+ # It also has a threading bug, so we don't output wdiff if the Popen
+ # raises a ValueError.
+ # http://bugs.python.org/issue1236
if _wdiff_available:
wdiff = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0]
+ wdiff_failed = False
+
except OSError, e:
if e.errno == errno.ENOENT or e.errno == errno.EACCES:
_wdiff_available = False
else:
raise e
+ except ValueError, e:
+ wdiff_failed = True
+
+ out = open(filename, 'wb')
if not _wdiff_available:
- out = open(filename, 'wb')
out.write(
"""wdiff not installed.<br/>"""
"""If you're running OS X, you can install via macports.<br/>"""
"""If running Ubuntu linux, you can run "sudo apt-get install"""
""" wdiff".""")
- out.close()
- return
+ elif wdiff_failed:
+ out.write('wdiff failed due to running with multiple test_shells in '
+ 'parallel.')
+ else:
+ wdiff = cgi.escape(wdiff)
+ wdiff = wdiff.replace('##WDIFF_DEL##', '<span class=del>')
+ wdiff = wdiff.replace('##WDIFF_ADD##', '<span class=add>')
+ wdiff = wdiff.replace('##WDIFF_END##', '</span>')
+ out.write('<head><style>.del { background: #faa; } ')
+ out.write('.add { background: #afa; }</style></head>')
+ out.write('<pre>' + wdiff + '</pre>')
- wdiff = cgi.escape(wdiff)
- wdiff = wdiff.replace('##WDIFF_DEL##', '<span class=del>')
- wdiff = wdiff.replace('##WDIFF_ADD##', '<span class=add>')
- wdiff = wdiff.replace('##WDIFF_END##', '</span>')
- out = open(filename, 'wb')
- out.write('<head><style>.del { background: #faa; } ')
- out.write('.add { background: #afa; }</style></head>')
- out.write('<pre>' + wdiff + '</pre>')
out.close()
diff --git a/webkit/tools/test_shell/SConscript b/webkit/tools/test_shell/SConscript
index 385c583..afd0b60 100644
--- a/webkit/tools/test_shell/SConscript
+++ b/webkit/tools/test_shell/SConscript
@@ -115,6 +115,7 @@ env_lib.SConscript([
input_files = [
'event_sending_controller.cc',
'layout_test_controller.cc',
+ 'mock_webclipboard_impl.cc',
'simple_resource_loader_bridge.cc',
# This file is only used by test_shell/test_shell_tests. It should
diff --git a/webkit/tools/test_shell/mac/webwidget_host.mm b/webkit/tools/test_shell/mac/webwidget_host.mm
index 41b47b5..f992141 100644
--- a/webkit/tools/test_shell/mac/webwidget_host.mm
+++ b/webkit/tools/test_shell/mac/webwidget_host.mm
@@ -13,6 +13,7 @@
#include "third_party/WebKit/WebKit/chromium/public/mac/WebInputEventFactory.h"
#include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h"
#include "webkit/glue/webwidget.h"
+#include "webkit/tools/test_shell/test_shell.h"
using WebKit::WebInputEvent;
using WebKit::WebInputEventFactory;
@@ -248,7 +249,10 @@ void WebWidgetHost::KeyEvent(NSEvent *event) {
}
void WebWidgetHost::SetFocus(bool enable) {
- webwidget_->SetFocus(enable);
+ // Ignore focus calls in layout test mode so that tests don't mess with each
+ // other's focus when running in parallel.
+ if (!TestShell::layout_test_mode())
+ webwidget_->SetFocus(enable);
}
void WebWidgetHost::TrackMouseLeave(bool track) {
diff --git a/webkit/tools/test_shell/mock_webclipboard_impl.cc b/webkit/tools/test_shell/mock_webclipboard_impl.cc
new file mode 100644
index 0000000..305eabf
--- /dev/null
+++ b/webkit/tools/test_shell/mock_webclipboard_impl.cc
@@ -0,0 +1,66 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
+// source code is governed by a BSD-style license that can be found in the
+// LICENSE file.
+
+#include "webkit/tools/test_shell/mock_webclipboard_impl.h"
+
+#include "base/clipboard.h"
+#include "base/logging.h"
+#include "base/string_util.h"
+#include "net/base/escape.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebImage.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebURL.h"
+#include "webkit/glue/webclipboard_impl.h"
+#include "webkit/glue/webkit_glue.h"
+
+using WebKit::WebString;
+using WebKit::WebURL;
+
+bool MockWebClipboardImpl::isFormatAvailable(Format format) {
+ switch (format) {
+ case FormatHTML:
+ return !m_htmlText.isEmpty();
+
+ case FormatSmartPaste:
+ return m_writeSmartPaste;
+
+ default:
+ NOTREACHED();
+ return false;
+ }
+ return true;
+}
+
+WebKit::WebString MockWebClipboardImpl::readPlainText() {
+ return m_plainText;
+}
+
+WebKit::WebString MockWebClipboardImpl::readHTML(WebKit::WebURL* url) {
+ return m_htmlText;
+}
+
+void MockWebClipboardImpl::writeHTML(
+ const WebKit::WebString& htmlText, const WebKit::WebURL& url,
+ const WebKit::WebString& plainText, bool writeSmartPaste) {
+ m_htmlText = htmlText;
+ m_plainText = plainText;
+ m_writeSmartPaste = writeSmartPaste;
+}
+
+void MockWebClipboardImpl::writeURL(
+ const WebKit::WebURL& url, const WebKit::WebString& title) {
+ m_htmlText = UTF8ToUTF16(
+ webkit_glue::WebClipboardImpl::URLToMarkup(url, title));
+ m_plainText = UTF8ToUTF16(url.spec());
+ m_writeSmartPaste = false;
+}
+
+void MockWebClipboardImpl::writeImage(const WebKit::WebImage& image,
+ const WebKit::WebURL& url, const WebKit::WebString& title) {
+ if (!image.isNull()) {
+ m_htmlText = UTF8ToUTF16(
+ webkit_glue::WebClipboardImpl::URLToImageMarkup(url, title));
+ m_plainText = m_htmlText;
+ m_writeSmartPaste = false;
+ }
+}
diff --git a/webkit/tools/test_shell/mock_webclipboard_impl.h b/webkit/tools/test_shell/mock_webclipboard_impl.h
new file mode 100644
index 0000000..6420244
--- /dev/null
+++ b/webkit/tools/test_shell/mock_webclipboard_impl.h
@@ -0,0 +1,38 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
+// source code is governed by a BSD-style license that can be found in the
+// LICENSE file.
+//
+// This file mocks out just enough of the WebClipboard API for running the
+// webkit tests. This is so we can run webkit tests without them sharing a
+// clipboard, which allows for running them in parallel and having the tests
+// not interact with actual user actions.
+
+#ifndef WEBKIT_TOOLS_TEST_SHELL_MOCK_WEBCLIPBOARD_IMPL_H_
+#define WEBKIT_TOOLS_TEST_SHELL_MOCK_WEBCLIPBOARD_IMPL_H_
+
+#include "third_party/WebKit/WebKit/chromium/public/WebClipboard.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebString.h"
+
+class MockWebClipboardImpl : public WebKit::WebClipboard {
+ public:
+ virtual bool isFormatAvailable(WebKit::WebClipboard::Format);
+
+ virtual WebKit::WebString readPlainText();
+ virtual WebKit::WebString readHTML(WebKit::WebURL*);
+
+ virtual void writeHTML(
+ const WebKit::WebString& htmlText, const WebKit::WebURL&,
+ const WebKit::WebString& plainText, bool writeSmartPaste);
+ virtual void writeURL(
+ const WebKit::WebURL&, const WebKit::WebString& title);
+ virtual void writeImage(
+ const WebKit::WebImage&, const WebKit::WebURL&,
+ const WebKit::WebString& title);
+
+ private:
+ WebKit::WebString m_plainText;
+ WebKit::WebString m_htmlText;
+ bool m_writeSmartPaste;
+};
+
+#endif // WEBKIT_TOOLS_TEST_SHELL_MOCK_WEBCLIPBOARD_IMPL_H_
diff --git a/webkit/tools/test_shell/test_shell.gyp b/webkit/tools/test_shell/test_shell.gyp
index 5c3094f..e6f3a1e 100644
--- a/webkit/tools/test_shell/test_shell.gyp
+++ b/webkit/tools/test_shell/test_shell.gyp
@@ -40,6 +40,8 @@
'foreground_helper.h',
'layout_test_controller.cc',
'layout_test_controller.h',
+ 'mock_webclipboard_impl.cc',
+ 'mock_webclipboard_impl.h',
'resource.h',
'simple_resource_loader_bridge.cc',
'simple_resource_loader_bridge.h',
diff --git a/webkit/tools/test_shell/test_shell.vcproj b/webkit/tools/test_shell/test_shell.vcproj
index 8ced6eb..b4d6410 100644
--- a/webkit/tools/test_shell/test_shell.vcproj
+++ b/webkit/tools/test_shell/test_shell.vcproj
@@ -242,6 +242,14 @@
>
</File>
<File
+ RelativePath=".\mock_webclipboard_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\mock_webclipboard_impl.h"
+ >
+ </File>
+ <File
RelativePath="..\..\glue\simple_clipboard_impl.cc"
>
</File>
diff --git a/webkit/tools/test_shell/test_shell_tests.vcproj b/webkit/tools/test_shell/test_shell_tests.vcproj
index ac9db53..4311ba6 100644
--- a/webkit/tools/test_shell/test_shell_tests.vcproj
+++ b/webkit/tools/test_shell/test_shell_tests.vcproj
@@ -183,6 +183,14 @@
>
</File>
<File
+ RelativePath=".\mock_webclipboard_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\mock_webclipboard_impl.h"
+ >
+ </File>
+ <File
RelativePath="$(OutDir)\obj\global_intermediate\net\net_resources.rc"
>
</File>
diff --git a/webkit/tools/test_shell/test_shell_webkit_init.h b/webkit/tools/test_shell/test_shell_webkit_init.h
index b0ae2d2..6a87100 100644
--- a/webkit/tools/test_shell/test_shell_webkit_init.h
+++ b/webkit/tools/test_shell/test_shell_webkit_init.h
@@ -11,10 +11,12 @@
#include "third_party/WebKit/WebKit/chromium/public/WebString.h"
#include "third_party/WebKit/WebKit/chromium/public/WebURL.h"
#include "webkit/glue/simple_webmimeregistry_impl.h"
+#include "webkit/glue/webclipboard_impl.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/glue/webkitclient_impl.h"
#include "webkit/extensions/v8/gears_extension.h"
#include "webkit/extensions/v8/interval_extension.h"
+#include "webkit/tools/test_shell/mock_webclipboard_impl.h"
#include "webkit/tools/test_shell/simple_resource_loader_bridge.h"
#include "v8/include/v8.h"
@@ -40,6 +42,19 @@ class TestShellWebKitInit : public webkit_glue::WebKitClientImpl {
virtual WebKit::WebMimeRegistry* mimeRegistry() {
return &mime_registry_;
}
+
+ WebKit::WebClipboard* clipboard() {
+ if (!clipboard_.get()) {
+ // Mock out clipboard calls in layout test mode so that tests don't mess
+ // with each other's copies/pastes when running in parallel.
+ if (TestShell::layout_test_mode()) {
+ clipboard_.reset(new MockWebClipboardImpl());
+ } else {
+ clipboard_.reset(new webkit_glue::WebClipboardImpl());
+ }
+ }
+ return clipboard_.get();
+ }
virtual WebKit::WebSandboxSupport* sandboxSupport() {
return NULL;
@@ -93,6 +108,7 @@ class TestShellWebKitInit : public webkit_glue::WebKitClientImpl {
private:
webkit_glue::SimpleWebMimeRegistryImpl mime_registry_;
+ scoped_ptr<WebKit::WebClipboard> clipboard_;
};
#endif // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBKIT_INIT_H_
diff --git a/webkit/tools/test_shell/webwidget_host_gtk.cc b/webkit/tools/test_shell/webwidget_host_gtk.cc
index 90194c5..599d580 100644
--- a/webkit/tools/test_shell/webwidget_host_gtk.cc
+++ b/webkit/tools/test_shell/webwidget_host_gtk.cc
@@ -15,6 +15,7 @@
#include "third_party/WebKit/WebKit/chromium/public/gtk/WebInputEventFactory.h"
#include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h"
#include "webkit/glue/webwidget.h"
+#include "webkit/tools/test_shell/test_shell.h"
using WebKit::WebInputEventFactory;
using WebKit::WebKeyboardEvent;
@@ -178,7 +179,10 @@ class WebWidgetHostGtkWidget {
static gboolean HandleFocusIn(GtkWidget* widget,
GdkEventFocus* focus,
WebWidgetHost* host) {
- host->webwidget()->SetFocus(true);
+ // Ignore focus calls in layout test mode so that tests don't mess with each
+ // other's focus when running in parallel.
+ if (!TestShell::layout_test_mode())
+ host->webwidget()->SetFocus(true);
return FALSE;
}
@@ -186,7 +190,10 @@ class WebWidgetHostGtkWidget {
static gboolean HandleFocusOut(GtkWidget* widget,
GdkEventFocus* focus,
WebWidgetHost* host) {
- host->webwidget()->SetFocus(false);
+ // Ignore focus calls in layout test mode so that tests don't mess with each
+ // other's focus when running in parallel.
+ if (!TestShell::layout_test_mode())
+ host->webwidget()->SetFocus(false);
return FALSE;
}
diff --git a/webkit/tools/test_shell/webwidget_host_win.cc b/webkit/tools/test_shell/webwidget_host_win.cc
index 76a5973..8ea5ca0 100644
--- a/webkit/tools/test_shell/webwidget_host_win.cc
+++ b/webkit/tools/test_shell/webwidget_host_win.cc
@@ -12,6 +12,7 @@
#include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h"
#include "third_party/WebKit/WebKit/chromium/public/win/WebInputEventFactory.h"
#include "webkit/glue/webwidget.h"
+#include "webkit/tools/test_shell/test_shell.h"
using WebKit::WebInputEvent;
using WebKit::WebInputEventFactory;
@@ -322,7 +323,10 @@ void WebWidgetHost::CaptureLostEvent() {
}
void WebWidgetHost::SetFocus(bool enable) {
- webwidget_->SetFocus(enable);
+ // Ignore focus calls in layout test mode so that tests don't mess with each
+ // other's focus when running in parallel.
+ if (!TestShell::layout_test_mode())
+ webwidget_->SetFocus(enable);
}
void WebWidgetHost::TrackMouseLeave(bool track) {