diff options
| author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-24 17:03:20 +0200 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-24 17:03:20 +0200 |
| commit | 08d4a74d56ca431877819fc4566e27eafe150342 (patch) | |
| tree | ebd8530838ab390c015c6b7e659a22852c1663ae /Tools | |
| parent | 1de6cd4794bbd5a52189384189a2b8df1848b39b (diff) | |
| download | qtwebkit-08d4a74d56ca431877819fc4566e27eafe150342.tar.gz | |
Imported WebKit commit 0fbd41c4e13f5a190faf160bf993eee614e6e18e (http://svn.webkit.org/repository/webkit/trunk@123477)
New snapshot that adapts to latest Qt API changes
Diffstat (limited to 'Tools')
29 files changed, 667 insertions, 108 deletions
diff --git a/Tools/ChangeLog b/Tools/ChangeLog index 6cfa656ef..c124a3ed3 100644 --- a/Tools/ChangeLog +++ b/Tools/ChangeLog @@ -1,9 +1,9 @@ -2012-07-16 Simon Hausmann <simon.hausmann@nokia.com> +2012-07-24 Simon Hausmann <simon.hausmann@nokia.com> [Qt] MSVC: unresolved external symbol __DllMainCRTStartup@12 https://bugs.webkit.org/show_bug.cgi?id=91229 - Reviewed by NOBODY (OOPS!). + Reviewed by Jocelyn Turcotte. In order to successfully link a DLL on Windows we need to have at least one object file (or compilation unit). The forward export header files were @@ -28,6 +28,353 @@ consider the last argument to be the output file and everything else input. * qmake/mkspecs/features/win32/default_post.prf: +2012-07-24 Balazs Kelemen <kbalazs@webkit.org> + + [Qt] Add quirks for running the web process in a profiler shell, like valgrind + https://bugs.webkit.org/show_bug.cgi?id=87672 + + Reviewed by Jocelyn Turcotte. + + Add --no-timeout-at-all command line switch to not time out no matter how + long the web process does it's job. --no-timeout is not enough for profiling + purposes because it only affects the timeout when we are waiting for the end + of the test. We use another timeout to control how much we wait for the web + process to initialize before and reset after the test and it could also easily + expire when running under valgrind. We should keep the behavior of --no-timeout + to not disable this timout check because --no-timeout is used by performace tests + and those should not wait for the web process to initialize and reset more than + normal tests. + + * WebKitTestRunner/TestController.cpp: + (WTR::TestController::TestController): + (WTR::TestController::initialize): + (WTR::TestController::runUntil): + * WebKitTestRunner/TestController.h: + +2012-07-24 Peter Beverloo <peter@chromium.org> + + [Chromium] Fix a class/struct mismatch error in TestDelegate.h (showing up on clang) + https://bugs.webkit.org/show_bug.cgi?id=92097 + + Unreviewed build fix. + + WebContextMenuData is declared as a struct in Source/WebKit/chromium/public/WebContextMenuData.h, + but TestDelegate.h forward declares it as a class. + + * DumpRenderTree/chromium/TestRunner/TestDelegate.h: + (WebKit): + +2012-07-23 Oswald Buddenhagen <oswald.buddenhagen@nokia.com> + + [Qt] Fix compilation against namespaced Qt + + Reviewed by Simon Hausmann. + + * QtTestBrowser/launcherwindow.h: + * WebKitTestRunner/PlatformWebView.h: + +2012-07-24 Peter Beverloo <peter@chromium.org> + + Update a few Chromium Android contributors in committers.py + https://bugs.webkit.org/show_bug.cgi?id=92090 + + Reviewed by Kent Tamura. + + Add Sami Kyostila, who has been doing significant work on Chromium's + compositor. Add IRC nicknames for John Mellor and Tien-Ren Chen, and + remove John Grabowski who changed projects, and add my webkit.org alias. + + * Scripts/webkitpy/common/config/committers.py: + +2012-07-24 Pierre Rossi <pierre.rossi@gmail.com> + + [Qt] Enable touch slider when touch events are enabled + https://bugs.webkit.org/show_bug.cgi?id=91013 + + Reviewed by Kenneth Rohde Christiansen. + + TOUCH_SLIDER guards are used in WebCore, so we should really + be setting the corresponding ENABLE define in features.prf. + + * qmake/mkspecs/features/features.prf: + +2012-07-24 Ryuan Choi <ryuan.choi@samsung.com> + + [EFL] EWebLauncher should not require config.h in the style check + https://bugs.webkit.org/show_bug.cgi?id=92070 + + Reviewed by Kentaro Hara. + + * Scripts/webkitpy/style/checker.py: + Remove the include rules from the style-check for EWebLauncher because + EWebLauncher is simple EFL application. + +2012-07-24 Jochen Eisinger <jochen@chromium.or> + + [Chromium] EventSender shouldn't know about TestShell + https://bugs.webkit.org/show_bug.cgi?id=91449 + + Reviewed by Adam Barth. + + Original patch by Adam Barth. + + This patch removes the dependency from EventSender to TestShell. Most + of EventSender works directly with a WebView, but there are a handful + of references to WebViewHost. We don't want to re-use WebViewHost in + ContentShell because we want to use the multi-process embedding + environment for WebViews. + + To avoid the dependency on WebViewHost, this patch introduces + TestDelegate, which is an abstract base class for WebViewHost. In + ContentShell, we'll need another object to implement these functions. + + * DumpRenderTree/chromium/EventSender.cpp: + (EventSender::EventSender): + (EventSender::keyDown): + (makeMenuItemStringsFor): + (EventSender::contextClick): + * DumpRenderTree/chromium/EventSender.h: + (EventSender): + (EventSender::setDelegate): + (EventSender::setWebView): + (EventSender::webview): + * DumpRenderTree/chromium/TestRunner/TestDelegate.h: Added. + (WebKit): + (TestDelegate): + * DumpRenderTree/chromium/TestShell.cpp: + (TestShell::initialize): + (TestShell::createMainWindow): + (TestShell::~TestShell): + * DumpRenderTree/chromium/WebViewHost.cpp: + (WebViewHost::fillSpellingSuggestionList): + * DumpRenderTree/chromium/WebViewHost.h: + (WebViewHost): + +2012-07-24 Thiago Marcos P. Santos <thiago.santos@intel.com> + + Make WebIntents and WebIntentsTag a build option for the build-webkit script + https://bugs.webkit.org/show_bug.cgi?id=91841 + + Reviewed by Philippe Normand. + + And it will also be disabled when building with --minimal. + + * Scripts/webkitperl/FeatureList.pm: + +2012-07-23 Dirk Pranke <dpranke@chromium.org> + + Unreviewed, rolling out r123360. + http://trac.webkit.org/changeset/123360 + https://bugs.webkit.org/show_bug.cgi?id=91890 + + broke the chromium bots + + * Scripts/webkitpy/layout_tests/port/chromium.py: + (ChromiumPort._static_build_path): + (ChromiumPort.default_results_directory): + (ChromiumPort._build_path): + (ChromiumPort._path_to_image_diff): + * Scripts/webkitpy/layout_tests/port/chromium_android.py: + (ChromiumAndroidPort._build_path): + (ChromiumAndroidPort._path_to_driver): + (ChromiumAndroidPort._path_to_forwarder): + (ChromiumAndroidPort._push_executable): + (ChromiumAndroidPort._push_fonts): + * Scripts/webkitpy/layout_tests/port/chromium_linux.py: + (ChromiumLinuxPort._determine_driver_path_statically): + (ChromiumLinuxPort._modules_to_search_for_symbols): + (ChromiumLinuxPort._path_to_driver): + * Scripts/webkitpy/layout_tests/port/chromium_linux_unittest.py: + (ChromiumLinuxPortTest.test_build_path): + * Scripts/webkitpy/layout_tests/port/chromium_mac.py: + (ChromiumMacPort._modules_to_search_for_symbols): + (ChromiumMacPort._path_to_driver): + (ChromiumMacPort._path_to_helper): + * Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py: + (ChromiumMacPortTest.test_build_path): + * Scripts/webkitpy/layout_tests/port/chromium_win.py: + (ChromiumWinPort._path_to_driver): + (ChromiumWinPort._path_to_helper): + (ChromiumWinPort._path_to_image_diff): + * Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py: + (ChromiumWinTest.test_build_path): + +2012-07-23 Adam Barth <abarth@webkit.org> + + [Chromium] TestInterfaces should be responsible for owning and binding AccessibilityController and TextInputController + https://bugs.webkit.org/show_bug.cgi?id=91459 + + Reviewed by Ryosuke Niwa. + + Rather than having TestShell own and bind each of these JavaScript APIs + individually, TestShell should delegate that work to TestInterfaces. + This patch moves AccessibilityController and TextInputController to be + the responsibility of TestInterfaces. + + * DumpRenderTree/chromium/TestRunner/TestInterfaces.cpp: + (TestInterfaces::TestInterfaces): + (TestInterfaces::~TestInterfaces): + (TestInterfaces::setWebView): + (TestInterfaces::bindTo): + (TestInterfaces::resetAll): + * DumpRenderTree/chromium/TestRunner/TestInterfaces.h: + (WebKit): + (TestInterfaces): + (TestInterfaces::accessibilityController): + * DumpRenderTree/chromium/TestShell.cpp: + (TestShell::initialize): + (TestShell::createMainWindow): + (TestShell::~TestShell): + (TestShell::resetTestController): + (TestShell::bindJSObjectsToWindow): + * DumpRenderTree/chromium/TestShell.h: + (TestShell::accessibilityController): + (TestShell): + +2012-07-23 Balazs Kelemen <kbalazs@webkit.org> + + nrwt swallows early exceptions + https://bugs.webkit.org/show_bug.cgi?id=91884 + + Reviewed by Dirk Pranke. + + Put everything in a try block so we won't miss any error. + + * Scripts/webkitpy/layout_tests/run_webkit_tests.py: + (run): + (main): + +2012-07-23 Christophe Dumez <christophe.dumez@intel.com> + + [WK2] WebKitTestRunner needs to print information about Web intents + https://bugs.webkit.org/show_bug.cgi?id=90873 + + Reviewed by Anders Carlsson. + + Print out information about new intents requests and intent + services registrations in WebKitTestRunner. This is expected + by tests under webintents/*. + + * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: + (WTR::InjectedBundlePage::InjectedBundlePage): + (WTR::InjectedBundlePage::didReceiveIntentForFrame): + (WTR): + (WTR::InjectedBundlePage::registerIntentServiceForFrame): + * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h: + (InjectedBundlePage): + +2012-07-23 Dirk Pranke <dpranke@chromium.org> + + nrwt: never finds binaries in the 'out' dir on chromium win + https://bugs.webkit.org/show_bug.cgi?id=91890 + + Reviewed by Tony Chang. + + We were figuring out which directory look in for binaries by + testing for the base directory (the directory above + Debug/Release). In chromium-win's case, we look in src/build, + which always exists because there are checked-in files in it, + which means we'd always pick that directory over src/out. All of + the other ports' build_path() implementation was including + Debug/Release. If we matched that, we wouldn't have a problem, + so this change fixes that and updates all of the callers of the + chromium ports' implementation to not pass configuration as part + of the path to look up; we still need to pass configuration in + some cases (to test if the build is out of date between debug + and release) so the implementation gets slightly more + complicated. + + * Scripts/webkitpy/layout_tests/port/chromium.py: + (ChromiumPort._static_build_path): + (ChromiumPort.default_results_directory): + (ChromiumPort._build_path): + (ChromiumPort._path_to_image_diff): + * Scripts/webkitpy/layout_tests/port/chromium_android.py: + (ChromiumAndroidPort._build_path): + (ChromiumAndroidPort._path_to_driver): + (ChromiumAndroidPort._path_to_forwarder): + (ChromiumAndroidPort._push_executable): + (ChromiumAndroidPort._push_fonts): + * Scripts/webkitpy/layout_tests/port/chromium_linux.py: + (ChromiumLinuxPort._determine_driver_path_statically): + (ChromiumLinuxPort._modules_to_search_for_symbols): + (ChromiumLinuxPort._path_to_driver): + * Scripts/webkitpy/layout_tests/port/chromium_linux_unittest.py: + (ChromiumLinuxPortTest.test_build_path): + * Scripts/webkitpy/layout_tests/port/chromium_mac.py: + (ChromiumMacPort._modules_to_search_for_symbols): + (ChromiumMacPort._path_to_driver): + (ChromiumMacPort._path_to_helper): + * Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py: + (ChromiumMacPortTest.test_build_path): + * Scripts/webkitpy/layout_tests/port/chromium_win.py: + (ChromiumWinPort._path_to_driver): + (ChromiumWinPort._path_to_helper): + (ChromiumWinPort._path_to_image_diff): + * Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py: + (ChromiumWinTest.test_build_path): + +2012-07-23 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r123339. + http://trac.webkit.org/changeset/123339 + https://bugs.webkit.org/show_bug.cgi?id=92006 + + massive media tests failure (Requested by philn on #webkit). + + * Scripts/webkitdirs.pm: + (buildAutotoolsProject): + * gtk/jhbuild.modules: + +2012-07-23 Tommy Widenflycht <tommyw@google.com> + + [chromium] MediaStream API: Clean up the MockWebKitPlatformSupport object at shutdown + https://bugs.webkit.org/show_bug.cgi?id=91857 + + Reviewed by Adam Barth. + + Made a few changes so that the destructor could be called at shutdown. + + * DumpRenderTree/chromium/DumpRenderTree.cpp: + (WebKitSupportTestEnvironment::WebKitSupportTestEnvironment): + (WebKitSupportTestEnvironment): + * DumpRenderTree/chromium/MockWebKitPlatformSupport.cpp: + (MockWebKitPlatformSupport::create): + * DumpRenderTree/chromium/MockWebKitPlatformSupport.h: + (MockWebKitPlatformSupport): + (MockWebKitPlatformSupport::~MockWebKitPlatformSupport): + +2012-07-23 Philippe Normand <pnormand@igalia.com> + + [GTK][jhbuild] Switch to GStreamer 0.11 build + https://bugs.webkit.org/show_bug.cgi?id=91727 + + Reviewed by Gustavo Noronha Silva. + + Switch build-webkit --gtk to GStreamer 0.11 support and build the + necessary GStreamer git modules from JHBuild. + + * Scripts/webkitdirs.pm: + (buildAutotoolsProject): Build WebKit with GStreamer 0.11 support. + * gtk/jhbuild.modules: GStreamer build support. + +2012-07-23 Christophe Dumez <christophe.dumez@intel.com> + + WebKit2 needs layoutTestController.setAlwaysAcceptCookies + https://bugs.webkit.org/show_bug.cgi?id=42778 + + Reviewed by Kenneth Rohde Christiansen. + + Add support for layoutTestController.setAlwaysAcceptCookies() + since it is required by some tests. + + * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl: + * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp: + (WTR::LayoutTestController::setAlwaysAcceptCookies): + (WTR): + * WebKitTestRunner/InjectedBundle/LayoutTestController.h: + (LayoutTestController): + 2012-07-23 Kent Tamura <tkent@chromium.org> Rename ENABLE_METER_TAG and ENABLE_PROGRESS_TAG to ENABLE_METER_ELEMENT and ENABLE_PROGRESS_ELEMENT respectively diff --git a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp index e589df2bf..6155f441f 100644 --- a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp @@ -36,6 +36,7 @@ #include "webkit/support/webkit_support.h" #include <v8/include/v8-testing.h> #include <v8/include/v8.h> +#include <wtf/OwnPtr.h> #include <wtf/Vector.h> using namespace std; @@ -73,12 +74,15 @@ class WebKitSupportTestEnvironment { public: WebKitSupportTestEnvironment() { - webkit_support::SetUpTestEnvironment(MockWebKitPlatformSupport::create()); + m_mockPlatform = MockWebKitPlatformSupport::create(); + webkit_support::SetUpTestEnvironment(m_mockPlatform.get()); } ~WebKitSupportTestEnvironment() { webkit_support::TearDownTestEnvironment(); } +private: + OwnPtr<MockWebKitPlatformSupport> m_mockPlatform; }; static void runTest(TestShell& shell, TestParams& params, const string& testName) diff --git a/Tools/DumpRenderTree/chromium/EventSender.cpp b/Tools/DumpRenderTree/chromium/EventSender.cpp index 7e81f3b54..5f49b8fdf 100644 --- a/Tools/DumpRenderTree/chromium/EventSender.cpp +++ b/Tools/DumpRenderTree/chromium/EventSender.cpp @@ -43,14 +43,14 @@ #include "config.h" #include "EventSender.h" -#include "TestShell.h" +#include "TestDelegate.h" #include "WebContextMenuData.h" -#include "platform/WebDragData.h" #include "WebDragOperation.h" -#include "platform/WebPoint.h" -#include "platform/WebString.h" #include "WebTouchPoint.h" #include "WebView.h" +#include "platform/WebDragData.h" +#include "platform/WebPoint.h" +#include "platform/WebString.h" #include "webkit/support/webkit_support.h" #include <wtf/Deque.h> #include <wtf/StringExtras.h> @@ -244,8 +244,8 @@ enum KeyLocationCode { DOMKeyLocationNumpad = 0x03 }; -EventSender::EventSender(TestShell* shell) - : m_shell(shell) +EventSender::EventSender() + : m_delegate(0) { // Initialize the map that associates methods of this class with the names // they will use when called by JavaScript. The actual binding of those @@ -338,11 +338,6 @@ void EventSender::reset() m_currentGestureLocation = WebPoint(0, 0); } -WebView* EventSender::webview() -{ - return m_shell->webView(); -} - void EventSender::doDragDrop(const WebDragData& dragData, WebDragOperationsMask mask) { WebMouseEvent event; @@ -646,11 +641,11 @@ void EventSender::keyDown(const CppArgumentList& arguments, CppVariant* result) // We just simulate the same behavior here. string editCommand; if (getEditCommand(eventDown, &editCommand)) - m_shell->webViewHost()->setEditCommand(editCommand, ""); + m_delegate->setEditCommand(editCommand, ""); webview()->handleInputEvent(eventDown); - m_shell->webViewHost()->clearEditCommand(); + m_delegate->clearEditCommand(); if (generateChar) { eventChar.type = WebInputEvent::Char; @@ -800,7 +795,7 @@ void EventSender::replaySavedEvents() // also makes sense. This function is doing such for some flags. // - Some test even checks actual string content. So providing it would be also helpful. // -static Vector<WebString> makeMenuItemStringsFor(WebContextMenuData* contextMenu, MockSpellCheck* spellcheck) +static Vector<WebString> makeMenuItemStringsFor(WebContextMenuData* contextMenu, TestDelegate* delegate) { // These constants are based on Safari's context menu because tests are made for it. static const char* nonEditableMenuStrings[] = { "Back", "Reload Page", "Open in Dashbaord", "<separator>", "View Source", "Save Page As", "Print Page", "Inspect Element", 0 }; @@ -816,7 +811,7 @@ static Vector<WebString> makeMenuItemStringsFor(WebContextMenuData* contextMenu, for (const char** item = editableMenuStrings; *item; ++item) strings.append(WebString::fromUTF8(*item)); Vector<WebString> suggestions; - spellcheck->fillSuggestionList(contextMenu->misspelledWord, &suggestions); + delegate->fillSpellingSuggestionList(contextMenu->misspelledWord, &suggestions); for (size_t i = 0; i < suggestions.size(); ++i) strings.append(suggestions[i]); } else { @@ -827,7 +822,6 @@ static Vector<WebString> makeMenuItemStringsFor(WebContextMenuData* contextMenu, return strings; } - void EventSender::contextClick(const CppArgumentList& arguments, CppVariant* result) { webview()->layout(); @@ -836,7 +830,7 @@ void EventSender::contextClick(const CppArgumentList& arguments, CppVariant* res // Clears last context menu data because we need to know if the context menu be requested // after following mouse events. - m_shell->webViewHost()->clearContextMenuData(); + m_delegate->clearContextMenuData(); // Generate right mouse down and up. WebMouseEvent event; @@ -849,8 +843,8 @@ void EventSender::contextClick(const CppArgumentList& arguments, CppVariant* res pressedButton = WebMouseEvent::ButtonNone; - WebContextMenuData* lastContextMenu = m_shell->webViewHost()->lastContextMenuData(); - result->set(WebBindings::makeStringArray(makeMenuItemStringsFor(lastContextMenu, m_shell->webViewHost()->mockSpellCheck()))); + WebContextMenuData* lastContextMenu = m_delegate->lastContextMenuData(); + result->set(WebBindings::makeStringArray(makeMenuItemStringsFor(lastContextMenu, m_delegate))); } class MouseDownTask: public MethodTask<EventSender> { diff --git a/Tools/DumpRenderTree/chromium/EventSender.h b/Tools/DumpRenderTree/chromium/EventSender.h index 9de2f760b..c187f0e47 100644 --- a/Tools/DumpRenderTree/chromium/EventSender.h +++ b/Tools/DumpRenderTree/chromium/EventSender.h @@ -43,18 +43,19 @@ #include "WebInputEvent.h" #include "platform/WebPoint.h" -class TestShell; - namespace WebKit { class WebDragData; class WebView; } +class TestDelegate; + class EventSender : public CppBoundClass { public: - // Builds the property and method lists needed to bind this class to a JS - // object. - EventSender(TestShell*); + EventSender(); + + void setDelegate(TestDelegate* delegate) { m_delegate = delegate; } + void setWebView(WebKit::WebView* webView) { m_webView = webView; } // Resets some static variable state. void reset(); @@ -129,8 +130,7 @@ public: TaskList* taskList() { return &m_taskList; } private: - // Returns the test shell's webview. - WebKit::WebView* webview(); + WebKit::WebView* webview() { return m_webView; } // Returns true if dragMode is true. bool isDragMode() { return dragMode.isBool() && dragMode.toBoolean(); } @@ -163,8 +163,8 @@ private: TaskList m_taskList; - // Non-owning pointer. The EventSender is owned by the TestShell. - TestShell* m_shell; + TestDelegate* m_delegate; + WebKit::WebView* m_webView; // Location of the touch point that initiated a gesture. WebKit::WebPoint m_currentGestureLocation; diff --git a/Tools/DumpRenderTree/chromium/MockWebKitPlatformSupport.cpp b/Tools/DumpRenderTree/chromium/MockWebKitPlatformSupport.cpp index d487b88aa..23b5aa7db 100644 --- a/Tools/DumpRenderTree/chromium/MockWebKitPlatformSupport.cpp +++ b/Tools/DumpRenderTree/chromium/MockWebKitPlatformSupport.cpp @@ -35,15 +35,19 @@ using namespace WebKit; -Platform* MockWebKitPlatformSupport::create() +PassOwnPtr<MockWebKitPlatformSupport> MockWebKitPlatformSupport::create() { - return new MockWebKitPlatformSupport(); + return WTF::adoptPtr(new MockWebKitPlatformSupport()); } MockWebKitPlatformSupport::MockWebKitPlatformSupport() { } +MockWebKitPlatformSupport::~MockWebKitPlatformSupport() +{ +} + void MockWebKitPlatformSupport::cryptographicallyRandomValues(unsigned char*, size_t) { CRASH(); diff --git a/Tools/DumpRenderTree/chromium/MockWebKitPlatformSupport.h b/Tools/DumpRenderTree/chromium/MockWebKitPlatformSupport.h index c5daa6f0f..5e8977d55 100644 --- a/Tools/DumpRenderTree/chromium/MockWebKitPlatformSupport.h +++ b/Tools/DumpRenderTree/chromium/MockWebKitPlatformSupport.h @@ -32,10 +32,12 @@ #define MockWebKitPlatformSupport_h #include <public/Platform.h> +#include <wtf/PassOwnPtr.h> class MockWebKitPlatformSupport : public WebKit::Platform { public: - static WebKit::Platform* create(); + static PassOwnPtr<MockWebKitPlatformSupport> create(); + ~MockWebKitPlatformSupport(); virtual void cryptographicallyRandomValues(unsigned char* buffer, size_t length) OVERRIDE; diff --git a/Tools/DumpRenderTree/chromium/TestRunner/TestDelegate.h b/Tools/DumpRenderTree/chromium/TestRunner/TestDelegate.h new file mode 100644 index 000000000..4d1af7a72 --- /dev/null +++ b/Tools/DumpRenderTree/chromium/TestRunner/TestDelegate.h @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2012 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef TestDelegate_h +#define TestDelegate_h + +#include "platform/WebString.h" +#include <wtf/Vector.h> + +namespace WebKit { +struct WebContextMenuData; +} + +class TestDelegate { +public: + virtual void clearContextMenuData() = 0; + virtual void clearEditCommand() = 0; + virtual void fillSpellingSuggestionList(const WebKit::WebString& word, Vector<WebKit::WebString>* suggestions) = 0; + virtual void setEditCommand(const std::string& name, const std::string& value) = 0; + virtual WebKit::WebContextMenuData* lastContextMenuData() const = 0; +}; + +#endif // TestDelegate_h diff --git a/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.cpp b/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.cpp index c0d532a07..b7c85edfb 100644 --- a/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.cpp +++ b/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.cpp @@ -31,43 +31,67 @@ #include "config.h" #include "TestInterfaces.h" +#include "AccessibilityController.h" #include "GamepadController.h" +#include "TextInputController.h" #include "platform/WebString.h" #include <wtf/OwnPtr.h> using WebKit::WebFrame; using WebKit::WebString; +using WebKit::WebView; class TestInterfaces::Internal { public: Internal(); ~Internal(); + void setWebView(WebView* webView); void bindTo(WebFrame*); void resetAll(); + AccessibilityController* accessibilityController() { return m_accessibilityController.get(); } + private: + OwnPtr<AccessibilityController> m_accessibilityController; OwnPtr<GamepadController> m_gamepadController; + OwnPtr<TextInputController> m_textInputController; }; TestInterfaces::Internal::Internal() { + m_accessibilityController = adoptPtr(new AccessibilityController()); m_gamepadController = adoptPtr(new GamepadController()); + m_textInputController = adoptPtr(new TextInputController()); } TestInterfaces::Internal::~Internal() { + m_accessibilityController->setWebView(0); + // m_gamepadController doesn't depend on WebView. + m_textInputController->setWebView(0); +} + +void TestInterfaces::Internal::setWebView(WebView* webView) +{ + m_accessibilityController->setWebView(webView); + // m_gamepadController doesn't depend on WebView. + m_textInputController->setWebView(webView); } void TestInterfaces::Internal::bindTo(WebFrame* frame) { + m_accessibilityController->bindToJavascript(frame, WebString::fromUTF8("accessibilityController")); m_gamepadController->bindToJavascript(frame, WebString::fromUTF8("gamepadController")); + m_textInputController->bindToJavascript(frame, WebString::fromUTF8("textInputController")); } void TestInterfaces::Internal::resetAll() { + m_accessibilityController->reset(); m_gamepadController->reset(); + // m_textInputController doesn't have any state to reset. } TestInterfaces::TestInterfaces() @@ -80,6 +104,11 @@ TestInterfaces::~TestInterfaces() delete m_internal; } +void TestInterfaces::setWebView(WebView* webView) +{ + m_internal->setWebView(webView); +} + void TestInterfaces::bindTo(WebFrame* frame) { m_internal->bindTo(frame); @@ -89,3 +118,8 @@ void TestInterfaces::resetAll() { m_internal->resetAll(); } + +AccessibilityController* TestInterfaces::accessibilityController() +{ + return m_internal->accessibilityController(); +} diff --git a/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.h b/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.h index 16ed5a69e..304434fb9 100644 --- a/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.h +++ b/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.h @@ -33,16 +33,22 @@ namespace WebKit { class WebFrame; +class WebView; } +class AccessibilityController; + class TestInterfaces { public: TestInterfaces(); ~TestInterfaces(); + void setWebView(WebKit::WebView* webView); void bindTo(WebKit::WebFrame*); void resetAll(); + AccessibilityController* accessibilityController(); + private: class Internal; Internal* m_internal; diff --git a/Tools/DumpRenderTree/chromium/TestShell.cpp b/Tools/DumpRenderTree/chromium/TestShell.cpp index b4142eacf..0cc942a19 100644 --- a/Tools/DumpRenderTree/chromium/TestShell.cpp +++ b/Tools/DumpRenderTree/chromium/TestShell.cpp @@ -145,11 +145,9 @@ TestShell::TestShell() void TestShell::initialize() { m_webPermissions = adoptPtr(new WebPermissions(this)); - m_accessibilityController = adoptPtr(new AccessibilityController()); m_testInterfaces = adoptPtr(new TestInterfaces()); m_layoutTestController = adoptPtr(new LayoutTestController(this)); - m_eventSender = adoptPtr(new EventSender(this)); - m_textInputController = adoptPtr(new TextInputController()); + m_eventSender = adoptPtr(new EventSender()); #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) m_notificationPresenter = adoptPtr(new NotificationPresenter(this)); #endif @@ -173,15 +171,17 @@ void TestShell::createMainWindow() m_drtDevToolsAgent = adoptPtr(new DRTDevToolsAgent); m_webViewHost = adoptPtr(createNewWindow(WebURL(), m_drtDevToolsAgent.get())); m_webView = m_webViewHost->webView(); - m_accessibilityController->setWebView(m_webView); - m_textInputController->setWebView(m_webView); + m_testInterfaces->setWebView(m_webView); + m_eventSender->setDelegate(m_webViewHost.get()); + m_eventSender->setWebView(m_webView); m_drtDevToolsAgent->setWebView(m_webView); } TestShell::~TestShell() { - m_accessibilityController->setWebView(0); - m_textInputController->setWebView(0); + m_testInterfaces->setWebView(0); + m_eventSender->setDelegate(0); + m_eventSender->setWebView(0); m_drtDevToolsAgent->setWebView(0); } @@ -292,7 +292,6 @@ void TestShell::resetTestController() { resetWebSettings(*webView()); m_webPermissions->reset(); - m_accessibilityController->reset(); m_testInterfaces->resetAll(); m_layoutTestController->reset(); m_eventSender->reset(); @@ -721,12 +720,10 @@ void TestShell::dumpImage(SkCanvas* canvas) const void TestShell::bindJSObjectsToWindow(WebFrame* frame) { WebTestingSupport::injectInternalsObject(frame); - m_accessibilityController->bindToJavascript(frame, WebString::fromUTF8("accessibilityController")); m_testInterfaces->bindTo(frame); m_layoutTestController->bindToJavascript(frame, WebString::fromUTF8("layoutTestController")); m_layoutTestController->bindToJavascript(frame, WebString::fromUTF8("testRunner")); m_eventSender->bindToJavascript(frame, WebString::fromUTF8("eventSender")); - m_textInputController->bindToJavascript(frame, WebString::fromUTF8("textInputController")); } WebViewHost* TestShell::createNewWindow(const WebKit::WebURL& url) diff --git a/Tools/DumpRenderTree/chromium/TestShell.h b/Tools/DumpRenderTree/chromium/TestShell.h index 7ea579056..07781636b 100644 --- a/Tools/DumpRenderTree/chromium/TestShell.h +++ b/Tools/DumpRenderTree/chromium/TestShell.h @@ -38,7 +38,6 @@ #include "NotificationPresenter.h" #include "TestEventPrinter.h" #include "TestInterfaces.h" -#include "TextInputController.h" #include "WebPreferences.h" #include "WebViewHost.h" #include <string> @@ -93,7 +92,7 @@ public: WebViewHost* webViewHost() const { return m_webViewHost.get(); } LayoutTestController* layoutTestController() const { return m_layoutTestController.get(); } EventSender* eventSender() const { return m_eventSender.get(); } - AccessibilityController* accessibilityController() const { return m_accessibilityController.get(); } + AccessibilityController* accessibilityController() const { return m_testInterfaces->accessibilityController(); } #if ENABLE(NOTIFICATIONS) NotificationPresenter* notificationPresenter() const { return m_notificationPresenter.get(); } #endif @@ -214,11 +213,9 @@ private: OwnPtr<WebPermissions> m_webPermissions; OwnPtr<DRTDevToolsAgent> m_drtDevToolsAgent; OwnPtr<DRTDevToolsClient> m_drtDevToolsClient; - OwnPtr<AccessibilityController> m_accessibilityController; OwnPtr<TestInterfaces> m_testInterfaces; OwnPtr<EventSender> m_eventSender; OwnPtr<LayoutTestController> m_layoutTestController; - OwnPtr<TextInputController> m_textInputController; #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) OwnPtr<NotificationPresenter> m_notificationPresenter; #endif diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.cpp b/Tools/DumpRenderTree/chromium/WebViewHost.cpp index 88e07378f..1dca46053 100644 --- a/Tools/DumpRenderTree/chromium/WebViewHost.cpp +++ b/Tools/DumpRenderTree/chromium/WebViewHost.cpp @@ -763,6 +763,11 @@ MockSpellCheck* WebViewHost::mockSpellCheck() return &m_spellcheck; } +void WebViewHost::fillSpellingSuggestionList(const WebKit::WebString& word, Vector<WebKit::WebString>* suggestions) +{ + mockSpellCheck()->fillSuggestionList(word, suggestions); +} + WebDeviceOrientationClient* WebViewHost::deviceOrientationClient() { return deviceOrientationClientMock(); diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.h b/Tools/DumpRenderTree/chromium/WebViewHost.h index ce189d915..4ff4921d1 100644 --- a/Tools/DumpRenderTree/chromium/WebViewHost.h +++ b/Tools/DumpRenderTree/chromium/WebViewHost.h @@ -33,6 +33,7 @@ #include "MockSpellCheck.h" #include "Task.h" +#include "TestDelegate.h" #include "TestNavigationController.h" #include "WebAccessibilityNotification.h" #include "WebCursorInfo.h" @@ -77,7 +78,8 @@ class TestMediaStreamClient; } class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient, public NavigationHost, - public WebKit::WebPrerendererClient, public WebKit::WebSpellCheckClient { + public WebKit::WebPrerendererClient, public WebKit::WebSpellCheckClient, + public TestDelegate { public: WebViewHost(TestShell*); virtual ~WebViewHost(); @@ -93,8 +95,8 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient, WebKit::WebFrame* topLoadingFrame() { return m_topLoadingFrame; } void setBlockRedirects(bool block) { m_blocksRedirects = block; } void setRequestReturnNull(bool returnNull) { m_requestReturnNull = returnNull; } - void setEditCommand(const std::string& name, const std::string& value); - void clearEditCommand(); + virtual void setEditCommand(const std::string& name, const std::string& value) OVERRIDE; + virtual void clearEditCommand() OVERRIDE; void setPendingExtraData(PassOwnPtr<TestShellExtraData>); void paintRect(const WebKit::WebRect&); @@ -111,8 +113,8 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient, const HashSet<WTF::String>& clearHeaders() const { return m_clearHeaders; } void closeWidget(); - WebKit::WebContextMenuData* lastContextMenuData() const; - void clearContextMenuData(); + virtual WebKit::WebContextMenuData* lastContextMenuData() const OVERRIDE; + virtual void clearContextMenuData() OVERRIDE; #if ENABLE(INPUT_SPEECH) MockWebSpeechInputController* speechInputControllerMock() { return m_speechInputControllerMock.get(); } @@ -271,6 +273,7 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient, // Spellcheck related helper APIs MockSpellCheck* mockSpellCheck(); void finishLastTextCheck(); + virtual void fillSpellingSuggestionList(const WebKit::WebString& word, Vector<WebKit::WebString>* suggestions) OVERRIDE; // Geolocation client mocks for LayoutTestController WebKit::WebGeolocationClientMock* geolocationClientMock(); diff --git a/Tools/QtTestBrowser/launcherwindow.h b/Tools/QtTestBrowser/launcherwindow.h index 9aed6c01a..348bf127d 100644 --- a/Tools/QtTestBrowser/launcherwindow.h +++ b/Tools/QtTestBrowser/launcherwindow.h @@ -59,8 +59,10 @@ #include "webpage.h" #include "webview.h" +QT_BEGIN_NAMESPACE class QPropertyAnimation; class QLineEdit; +QT_END_NAMESPACE class WindowOptions { public: diff --git a/Tools/Scripts/generate-win32-export-forwards b/Tools/Scripts/generate-win32-export-forwards index 768b3ba93..ece574387 100755 --- a/Tools/Scripts/generate-win32-export-forwards +++ b/Tools/Scripts/generate-win32-export-forwards @@ -28,21 +28,21 @@ import sys import re def exportForwardsForLibrary(library): - dumpBin = subprocess.Popen("dumpbin /directives " + library, stdout=subprocess.PIPE, universal_newlines=True); + dumpBin = subprocess.Popen("dumpbin /directives " + library, stdout=subprocess.PIPE, universal_newlines=True) - output, errors = dumpBin.communicate(); + output = dumpBin.communicate()[0] return output -libraries = sys.argv[1 : len(sys.argv) - 1] -outputFileName = sys.argv[len(sys.argv) - 1] +libraries = sys.argv[1 : -1] +outputFileName = sys.argv[-1] -exportedSymbolRegexp = re.compile("\s*(?P<symbol>/EXPORT:.+)"); +exportedSymbolRegexp = re.compile("\s*(?P<symbol>/EXPORT:.+)") symbols = set() for lib in libraries: for line in exportForwardsForLibrary(lib).splitlines(): match = exportedSymbolRegexp.match(line) - if match != None: + if match: symbols.add(match.group("symbol")) print "Forwarding %s symbols from %s" % (len(symbols), " ".join(libraries)) diff --git a/Tools/Scripts/webkitperl/FeatureList.pm b/Tools/Scripts/webkitperl/FeatureList.pm index 796dff8ea..6306b6138 100644 --- a/Tools/Scripts/webkitperl/FeatureList.pm +++ b/Tools/Scripts/webkitperl/FeatureList.pm @@ -127,6 +127,8 @@ my ( $videoTrackSupport, $webglSupport, $webAudioSupport, + $webIntentsSupport, + $webIntentsTagSupport, $webSocketsSupport, $webTimingSupport, $workersSupport, @@ -386,6 +388,12 @@ my @features = ( { option => "web-audio", desc => "Toggle Web Audio support", define => "ENABLE_WEB_AUDIO", default => 0, value => \$webAudioSupport }, + { option => "web-intents", desc => "Toggle Web Intents support", + define => "ENABLE_WEB_INTENTS", default => isEfl(), value => \$webIntentsSupport }, + + { option => "web-intents-tag", desc => "Toggle Web Intents Tag support", + define => "ENABLE_WEB_INTENTS_TAG", default => isEfl(), value => \$webIntentsTagSupport }, + { option => "web-sockets", desc => "Toggle Web Sockets support", define => "ENABLE_WEB_SOCKETS", default => 1, value => \$webSocketsSupport }, diff --git a/Tools/Scripts/webkitpy/common/config/committers.py b/Tools/Scripts/webkitpy/common/config/committers.py index efa5aac89..c1878849d 100644 --- a/Tools/Scripts/webkitpy/common/config/committers.py +++ b/Tools/Scripts/webkitpy/common/config/committers.py @@ -139,8 +139,7 @@ contributors_who_are_not_committers = [ Contributor("Jing Zhao", "jingzhao@chromium.org"), Contributor("John Bates", ["jbates@google.com", "jbates@chromium.org"], "jbates"), Contributor("John Bauman", ["jbauman@chromium.org", "jbauman@google.com"], "jbauman"), - Contributor("John Grabowski", "jrg@chromium.org"), - Contributor("John Mellor", "johnme@chromium.org"), + Contributor("John Mellor", "johnme@chromium.org", "johnme"), Contributor("Kulanthaivel Palanichamy", "kulanthaivel@codeaurora.org", "kvel"), Contributor(u"Michael Br\u00fcning", "michael.bruning@nokia.com", "mibrunin"), Contributor("Mihai Balan", "mibalan@adobe.com", "miChou"), @@ -153,11 +152,12 @@ contributors_who_are_not_committers = [ Contributor("Radar WebKit Bug Importer", "webkit-bug-importer@group.apple.com"), Contributor("Raul Hudea", "rhudea@adobe.com", "rhudea"), Contributor("Roland Takacs", "rtakacs@inf.u-szeged.hu", "rtakacs"), + Contributor(u"Sami Ky\u00f6stil\u00e4", "skyostil@chromium.org", "skyostil"), Contributor("Szilard Ledan-Muntean", "szledan@inf.u-szeged.hu", "szledan"), Contributor("Tab Atkins", ["tabatkins@google.com", "jackalmage@gmail.com"], "tabatkins"), Contributor("Tamas Czene", ["tczene@inf.u-szeged.hu", "Czene.Tamas@stud.u-szeged.hu"], "tczene"), Contributor("Terry Anderson", "tdanderson@chromium.org", "tdanderson"), - Contributor("Tien-Ren Chen", "trchen@chromium.org"), + Contributor("Tien-Ren Chen", "trchen@chromium.org", "trchen"), Contributor("Tom Hudson", "tomhudson@google.com"), Contributor("WebKit Review Bot", "webkit.review.bot@gmail.com", "sheriff-bot"), Contributor("Wyatt Carss", ["wcarss@chromium.org", "wcarss@google.com"], "wcarss"), @@ -343,7 +343,7 @@ committers_unable_to_review = [ Committer("Pam Greene", "pam@chromium.org", "pamg"), Committer("Patrick Gansterer", ["paroga@paroga.com", "paroga@webkit.org"], "paroga"), Committer("Pavel Podivilov", "podivilov@chromium.org", "podivilov"), - Committer("Peter Beverloo", ["peter@chromium.org", "beverloo@google.com"], "beverloo"), + Committer("Peter Beverloo", ["peter@chromium.org", "peter@webkit.org", "beverloo@google.com"], "beverloo"), Committer("Peter Kasting", ["pkasting@google.com", "pkasting@chromium.org"], "pkasting"), Committer("Peter Varga", ["pvarga@webkit.org", "pvarga@inf.u-szeged.hu"], "stampho"), Committer("Philip Rogers", ["pdr@google.com", "pdr@chromium.org"], "pdr"), diff --git a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py index d15166606..455a8c2dc 100755 --- a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py +++ b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py @@ -89,25 +89,26 @@ def lint(port, options): def run(port, options, args, regular_output=sys.stderr, buildbot_output=sys.stdout): - warnings = _set_up_derived_options(port, options) + try: + warnings = _set_up_derived_options(port, options) - printer = printing.Printer(port, options, regular_output, buildbot_output, logger=logging.getLogger()) + printer = printing.Printer(port, options, regular_output, buildbot_output, logger=logging.getLogger()) - for warning in warnings: - _log.warning(warning) + for warning in warnings: + _log.warning(warning) - if options.help_printing: - printer.help_printing() - printer.cleanup() - return 0 + if options.help_printing: + printer.help_printing() + printer.cleanup() + return 0 - if options.lint_test_files: - return lint(port, options) + if options.lint_test_files: + return lint(port, options) + + # We wrap any parts of the run that are slow or likely to raise exceptions + # in a try/finally to ensure that we clean up the logging configuration. + unexpected_result_count = -1 - # We wrap any parts of the run that are slow or likely to raise exceptions - # in a try/finally to ensure that we clean up the logging configuration. - unexpected_result_count = -1 - try: manager = Manager(port, options, printer) printer.print_config() @@ -462,17 +463,16 @@ def parse_args(args=None): def main(argv=None): - options, args = parse_args(argv) - if options.platform and 'test' in options.platform: - # It's a bit lame to import mocks into real code, but this allows the user - # to run tests against the test platform interactively, which is useful for - # debugging test failures. - from webkitpy.common.host_mock import MockHost - host = MockHost() - else: - host = Host() - try: + options, args = parse_args(argv) + if options.platform and 'test' in options.platform: + # It's a bit lame to import mocks into real code, but this allows the user + # to run tests against the test platform interactively, which is useful for + # debugging test failures. + from webkitpy.common.host_mock import MockHost + host = MockHost() + else: + host = Host() port = host.port_factory.get(options.platform, options) except NotImplementedError, e: # FIXME: is this the best way to handle unsupported port names? diff --git a/Tools/Scripts/webkitpy/style/checker.py b/Tools/Scripts/webkitpy/style/checker.py index 10f3448ec..ed0860cc0 100644 --- a/Tools/Scripts/webkitpy/style/checker.py +++ b/Tools/Scripts/webkitpy/style/checker.py @@ -194,12 +194,13 @@ _PATH_RULES_SPECIFIER = [ ["-readability/naming", "-readability/parameter_name"]), ([# EWebLauncher and MiniBrowser are EFL simple application. - # They need to use efl coding style. + # They need to use efl coding style and they don't have config.h. "Tools/EWebLauncher/", "Tools/MiniBrowser/efl/"], ["-readability/naming", "-readability/parameter_name", - "-whitespace/declaration"]), + "-whitespace/declaration", + "-build/include_order"]), # WebKit2 rules: # WebKit2 and certain directories have idiosyncracies. diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl index 240221287..43062c5cc 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl +++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl @@ -139,6 +139,9 @@ module WTR { void setWindowIsKey(in boolean isKey); + // Cookies testing + void setAlwaysAcceptCookies(in boolean accept); + // FIXME: handle non-boolean preferences. void overridePreference(in DOMString preference, in boolean value); diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp index dc2ad3d39..c5bd14083 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp @@ -49,6 +49,13 @@ #include "DumpRenderTreeSupportQt.h" #endif +#if ENABLE(WEB_INTENTS) +#include <WebKit2/WKIntentData.h> +#endif +#if ENABLE(WEB_INTENTS_TAG) +#include <WebKit2/WKIntentServiceInfo.h> +#endif + using namespace std; namespace WTR { @@ -241,7 +248,9 @@ InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page) 0, // didReconnectDOMWindowExtensionToGlobalObject 0, // willDestroyGlobalObjectForDOMWindowExtension didFinishProgress, // didFinishProgress - 0 // shouldForceUniversalAccessFromLocalURL + 0, // shouldForceUniversalAccessFromLocalURL + didReceiveIntentForFrame, // didReceiveIntentForFrame + registerIntentServiceForFrame // registerIntentServiceForFrame }; WKBundlePageSetPageLoaderClient(m_page, &loaderClient); @@ -416,6 +425,75 @@ void InjectedBundlePage::didFinishProgress(WKBundlePageRef, const void *clientIn static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFinishProgress(); } +void InjectedBundlePage::didReceiveIntentForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKIntentDataRef intent, WKTypeRef* userData, const void* clientInfo) +{ +#if ENABLE(WEB_INTENTS) + InjectedBundle::shared().stringBuilder()->append("Received Web Intent: action="); + WKRetainPtr<WKStringRef> wkAction(AdoptWK, WKIntentDataCopyAction(intent)); + InjectedBundle::shared().stringBuilder()->append(toWTFString(wkAction.get())); + InjectedBundle::shared().stringBuilder()->append(" type="); + WKRetainPtr<WKStringRef> wkType(AdoptWK, WKIntentDataCopyType(intent)); + InjectedBundle::shared().stringBuilder()->append(toWTFString(wkType.get())); + InjectedBundle::shared().stringBuilder()->append("\n"); + + // FIXME: Print number of ports when exposed in WebKit2 + + WKRetainPtr<WKURLRef> wkServiceUrl(AdoptWK, WKIntentDataCopyService(intent)); + if (wkServiceUrl) { + WKRetainPtr<WKStringRef> wkService(AdoptWK, WKURLCopyString(wkServiceUrl.get())); + if (wkService && !WKStringIsEmpty(wkService.get())) { + InjectedBundle::shared().stringBuilder()->append("Explicit intent service: "); + InjectedBundle::shared().stringBuilder()->append(toWTFString(wkService.get())); + InjectedBundle::shared().stringBuilder()->append("\n"); + } + } + + WKRetainPtr<WKDictionaryRef> wkExtras(AdoptWK, WKIntentDataCopyExtras(intent)); + WKRetainPtr<WKArrayRef> wkExtraKeys(AdoptWK, WKDictionaryCopyKeys(wkExtras.get())); + const size_t numExtraKeys = WKArrayGetSize(wkExtraKeys.get()); + for (size_t i = 0; i < numExtraKeys; ++i) { + WKStringRef wkKey = static_cast<WKStringRef>(WKArrayGetItemAtIndex(wkExtraKeys.get(), i)); + WKStringRef wkValue = static_cast<WKStringRef>(WKDictionaryGetItemForKey(wkExtras.get(), wkKey)); + InjectedBundle::shared().stringBuilder()->append("Extras["); + InjectedBundle::shared().stringBuilder()->append(toWTFString(wkKey)); + InjectedBundle::shared().stringBuilder()->append("] = "); + InjectedBundle::shared().stringBuilder()->append(toWTFString(wkValue)); + InjectedBundle::shared().stringBuilder()->append("\n"); + } + + WKRetainPtr<WKArrayRef> wkSuggestions(AdoptWK, WKIntentDataCopySuggestions(intent)); + const size_t numSuggestions = WKArrayGetSize(wkSuggestions.get()); + for (size_t i = 0; i < numSuggestions; ++i) { + WKStringRef wkSuggestion = static_cast<WKStringRef>(WKArrayGetItemAtIndex(wkSuggestions.get(), i)); + InjectedBundle::shared().stringBuilder()->append("Have suggestion "); + InjectedBundle::shared().stringBuilder()->append(toWTFString(wkSuggestion)); + InjectedBundle::shared().stringBuilder()->append("\n"); + } +#endif +} + +void InjectedBundlePage::registerIntentServiceForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKIntentServiceInfoRef serviceInfo, WKTypeRef* userData, const void* clientInfo) +{ +#if ENABLE(WEB_INTENTS_TAG) + InjectedBundle::shared().stringBuilder()->append("Registered Web Intent Service: action="); + WKRetainPtr<WKStringRef> wkAction(AdoptWK, WKIntentServiceInfoCopyAction(serviceInfo)); + InjectedBundle::shared().stringBuilder()->append(toWTFString(wkAction.get())); + InjectedBundle::shared().stringBuilder()->append(" type="); + WKRetainPtr<WKStringRef> wkType(AdoptWK, WKIntentServiceInfoCopyType(serviceInfo)); + InjectedBundle::shared().stringBuilder()->append(toWTFString(wkType.get())); + InjectedBundle::shared().stringBuilder()->append(" title="); + WKRetainPtr<WKStringRef> wkTitle(AdoptWK, WKIntentServiceInfoCopyTitle(serviceInfo)); + InjectedBundle::shared().stringBuilder()->append(toWTFString(wkTitle.get())); + InjectedBundle::shared().stringBuilder()->append(" url="); + WKRetainPtr<WKURLRef> wkUrl(AdoptWK, WKIntentServiceInfoCopyHref(serviceInfo)); + InjectedBundle::shared().stringBuilder()->append(toWTFString(adoptWK(WKURLCopyString(wkUrl.get())))); + InjectedBundle::shared().stringBuilder()->append(" disposition="); + WKRetainPtr<WKStringRef> wkDisposition(AdoptWK, WKIntentServiceInfoCopyDisposition(serviceInfo)); + InjectedBundle::shared().stringBuilder()->append(toWTFString(wkDisposition.get())); + InjectedBundle::shared().stringBuilder()->append("\n"); +#endif +} + void InjectedBundlePage::didFinishDocumentLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void* clientInfo) { static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFinishDocumentLoadForFrame(frame); diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h index 4e1fce171..824b1dfbd 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h +++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h @@ -72,6 +72,8 @@ private: static void didReceiveContentLengthForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, uint64_t length, const void*); static void didFinishLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, const void*); static void didFailLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKErrorRef, const void*); + static void didReceiveIntentForFrame(WKBundlePageRef, WKBundleFrameRef, WKIntentDataRef, WKTypeRef*, const void*); + static void registerIntentServiceForFrame(WKBundlePageRef, WKBundleFrameRef, WKIntentServiceInfoRef, WKTypeRef*, const void*); void didStartProvisionalLoadForFrame(WKBundleFrameRef); void didReceiveServerRedirectForProvisionalLoadForFrame(WKBundleFrameRef); diff --git a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp b/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp index 1ee9c38f9..a365bff55 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp @@ -613,6 +613,11 @@ void LayoutTestController::overridePreference(JSStringRef preference, bool value WKBundleOverrideBoolPreferenceForTestRunner(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), toWK(preference).get(), value); } +void LayoutTestController::setAlwaysAcceptCookies(bool accept) +{ + WKBundleSetAlwaysAcceptCookies(InjectedBundle::shared().bundle(), accept); +} + double LayoutTestController::preciseTime() { return currentTime(); diff --git a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h b/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h index a3e33eff3..35033e29f 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h +++ b/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h @@ -206,6 +206,9 @@ public: void overridePreference(JSStringRef preference, bool value); + // Cookies testing + void setAlwaysAcceptCookies(bool); + // Custom full screen behavior. void setHasCustomFullScreenBehavior(bool value) { m_customFullScreenBehavior = value; } bool hasCustomFullScreenBehavior() const { return m_customFullScreenBehavior; } diff --git a/Tools/WebKitTestRunner/PlatformWebView.h b/Tools/WebKitTestRunner/PlatformWebView.h index a8cf0d66c..d3ad21a9e 100644 --- a/Tools/WebKitTestRunner/PlatformWebView.h +++ b/Tools/WebKitTestRunner/PlatformWebView.h @@ -29,11 +29,13 @@ #include <WebKit2/WKRetainPtr.h> #if defined(BUILDING_QT__) +QT_BEGIN_NAMESPACE +class QQuickView; +class QEventLoop; +QT_END_NAMESPACE class QQuickWebView; typedef QQuickWebView* PlatformWKView; -class QQuickView; typedef QQuickView* PlatformWindow; -class QEventLoop; #elif defined(__APPLE__) && __APPLE__ #if __OBJC__ @class WKView; diff --git a/Tools/WebKitTestRunner/TestController.cpp b/Tools/WebKitTestRunner/TestController.cpp index 0a2cb2bdd..8c2250831 100644 --- a/Tools/WebKitTestRunner/TestController.cpp +++ b/Tools/WebKitTestRunner/TestController.cpp @@ -78,6 +78,7 @@ TestController::TestController(int argc, const char* argv[]) , m_shortTimeout(defaultShortTimeout) , m_noTimeout(defaultNoTimeout) , m_useWaitToDumpWatchdogTimer(true) + , m_forceNoTimeout(false) , m_didPrintWebProcessCrashedMessage(false) , m_shouldExitWhenWebProcessCrashes(true) , m_beforeUnloadReturnValue(true) @@ -260,6 +261,12 @@ void TestController::initialize(int argc, const char* argv[]) continue; } + if (argument == "--no-timeout-at-all") { + m_useWaitToDumpWatchdogTimer = false; + m_forceNoTimeout = true; + continue; + } + if (argument == "--pixel-tests") { m_dumpPixels = true; continue; @@ -560,18 +567,20 @@ void TestController::run() void TestController::runUntil(bool& done, TimeoutDuration timeoutDuration) { - double timeout; - switch (timeoutDuration) { - case ShortTimeout: - timeout = m_shortTimeout; - break; - case LongTimeout: - timeout = m_longTimeout; - break; - case NoTimeout: - default: - timeout = m_noTimeout; - break; + double timeout = m_noTimeout; + if (!m_forceNoTimeout) { + switch (timeoutDuration) { + case ShortTimeout: + timeout = m_shortTimeout; + break; + case LongTimeout: + timeout = m_longTimeout; + break; + case NoTimeout: + default: + timeout = m_noTimeout; + break; + } } platformRunUntil(done, timeout); diff --git a/Tools/WebKitTestRunner/TestController.h b/Tools/WebKitTestRunner/TestController.h index b9465ef96..20188ad55 100644 --- a/Tools/WebKitTestRunner/TestController.h +++ b/Tools/WebKitTestRunner/TestController.h @@ -129,6 +129,7 @@ private: double m_shortTimeout; double m_noTimeout; bool m_useWaitToDumpWatchdogTimer; + bool m_forceNoTimeout; bool m_didPrintWebProcessCrashedMessage; bool m_shouldExitWhenWebProcessCrashes; diff --git a/Tools/qmake/mkspecs/features/features.prf b/Tools/qmake/mkspecs/features/features.prf index 363713b84..4a6443427 100644 --- a/Tools/qmake/mkspecs/features/features.prf +++ b/Tools/qmake/mkspecs/features/features.prf @@ -244,3 +244,8 @@ for(define, DEFINES) { haveQt(4):contains(DEFINES, ENABLE_WEBGL=1):contains(DEFINES, WTF_USE_3D_GRAPHICS=0) { error("WebGL requires Qt to be configured with OpenGL. Please reconfigure Qt with OpenGL, or build WebKit without WebGL.") } + +# Slider Touch is sensible to use when compiling WebKit2 +haveQt(5):contains(DEFINES, ENABLE_TOUCH_EVENTS=1) { + DEFINES += ENABLE_TOUCH_SLIDER=1 +} diff --git a/Tools/qmake/mkspecs/features/win32/default_post.prf b/Tools/qmake/mkspecs/features/win32/default_post.prf index 116556701..061d69da7 100644 --- a/Tools/qmake/mkspecs/features/win32/default_post.prf +++ b/Tools/qmake/mkspecs/features/win32/default_post.prf @@ -31,10 +31,7 @@ shared:contains(TEMPLATE, lib) { !isEmpty(LIBSWITHEXPORTS) { suffix = - CONFIG(debug, debug|release) { - win32: suffix = d - mac: suffix = _debug - } + CONFIG(debug, debug|release): suffix = d forwarded_exports.target = forwarded-exports$${suffix}.cpp forwarded_exports.commands = python $${ROOT_WEBKIT_DIR}$${QMAKE_DIR_SEP}Tools$${QMAKE_DIR_SEP}Scripts$${QMAKE_DIR_SEP}generate-win32-export-forwards $$LIBSWITHEXPORTS $$forwarded_exports.target forwarded_exports.depends = $$LIBSWITHEXPORTS |
