From 9daf1655d7e4eaaa6ed5f44055a4b4fd399fd25c Mon Sep 17 00:00:00 2001 From: Konstantin Tokarev Date: Wed, 28 Sep 2016 16:39:37 +0300 Subject: Imported WebKit commit eb954cdcf58f9b915b2fcb6f8e4cb3a60650a4f3 Change-Id: I8dda875c38075d43b76fe3a21acb0ffa102bb82d Reviewed-by: Konstantin Tokarev --- Tools/QtTestBrowser/webpage.h | 14 ++++---- Tools/Scripts/webkitperl/FeatureList.pm | 2 +- .../WebKit2Cocoa/LocalStorageNullEntries.html | 6 ++++ .../LocalStorageNullEntries.localstorage | Bin 0 -> 12288 bytes .../LocalStorageNullEntries.localstorage-shm | Bin 0 -> 32768 bytes Tools/TestWebKitAPI/qt/PlatformUtilitiesQt.cpp | 6 ++-- Tools/TestWebKitAPI/qt/PlatformWebViewQt.cpp | 2 +- .../atk/AccessibilityUIElementAtk.cpp | 13 ++++--- .../InjectedBundle/qt/TestRunnerQt.cpp | 12 +++---- Tools/WebKitTestRunner/TestController.h | 4 +-- Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp | 6 ++-- Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp | 9 +++-- Tools/WebKitTestRunner/qt/TestControllerQt.cpp | 27 ++++++++------ Tools/WebKitTestRunner/qt/TestInvocationQt.cpp | 2 +- Tools/qt/make-snapshot.pl | 40 +++++++++++++++++++++ 15 files changed, 99 insertions(+), 44 deletions(-) create mode 100644 Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageNullEntries.html create mode 100644 Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageNullEntries.localstorage create mode 100644 Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageNullEntries.localstorage-shm create mode 100755 Tools/qt/make-snapshot.pl (limited to 'Tools') diff --git a/Tools/QtTestBrowser/webpage.h b/Tools/QtTestBrowser/webpage.h index 959318018..1a6ef2e38 100644 --- a/Tools/QtTestBrowser/webpage.h +++ b/Tools/QtTestBrowser/webpage.h @@ -42,17 +42,17 @@ class WebPage : public QWebPage { public: WebPage(QObject* parent = 0); - virtual QWebPage* createWindow(QWebPage::WebWindowType); - virtual QObject* createPlugin(const QString&, const QUrl&, const QStringList&, const QStringList&); - virtual bool supportsExtension(QWebPage::Extension) const; - virtual bool extension(Extension, const ExtensionOption*, ExtensionReturn*); + QWebPage* createWindow(QWebPage::WebWindowType) override; + QObject* createPlugin(const QString&, const QUrl&, const QStringList&, const QStringList&) override; + bool supportsExtension(QWebPage::Extension) const override; + bool extension(Extension, const ExtensionOption*, ExtensionReturn*) override; - virtual bool acceptNavigationRequest(QWebFrame*, const QNetworkRequest&, NavigationType); + bool acceptNavigationRequest(QWebFrame*, const QNetworkRequest&, NavigationType) override; - QString userAgentForUrl(const QUrl&) const; + QString userAgentForUrl(const QUrl&) const override; void setInterruptingJavaScriptEnabled(bool enabled) { m_interruptingJavaScriptEnabled = enabled; } - virtual bool shouldInterruptJavaScript(); + bool shouldInterruptJavaScript() override; void javaScriptConsoleMessage(const QString &message, int lineNumber, const QString &sourceID) override; diff --git a/Tools/Scripts/webkitperl/FeatureList.pm b/Tools/Scripts/webkitperl/FeatureList.pm index 81264636a..8301d9bc6 100644 --- a/Tools/Scripts/webkitperl/FeatureList.pm +++ b/Tools/Scripts/webkitperl/FeatureList.pm @@ -470,7 +470,7 @@ my @features = ( define => "ENABLE_XSLT", default => 1, value => \$xsltSupport }, { option => "ftl-jit", desc => "Toggle FTLJIT support", - define => "ENABLE_FTL_JIT", default => (isX86_64() && (isGtk() || isEfl()) || (isQt() && !isAnyWindows())) , value => \$ftlJITSupport }, + define => "ENABLE_FTL_JIT", default => (isX86_64() && (isGtk() || isEfl() || (isQt() && !isAnyWindows()))) , value => \$ftlJITSupport }, ); sub getFeatureOptionList() diff --git a/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageNullEntries.html b/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageNullEntries.html new file mode 100644 index 000000000..9878f36ac --- /dev/null +++ b/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageNullEntries.html @@ -0,0 +1,6 @@ + diff --git a/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageNullEntries.localstorage b/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageNullEntries.localstorage new file mode 100644 index 000000000..0b41b25c7 Binary files /dev/null and b/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageNullEntries.localstorage differ diff --git a/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageNullEntries.localstorage-shm b/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageNullEntries.localstorage-shm new file mode 100644 index 000000000..fe9ac2845 Binary files /dev/null and b/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageNullEntries.localstorage-shm differ diff --git a/Tools/TestWebKitAPI/qt/PlatformUtilitiesQt.cpp b/Tools/TestWebKitAPI/qt/PlatformUtilitiesQt.cpp index b210a4a1d..6b67622b7 100644 --- a/Tools/TestWebKitAPI/qt/PlatformUtilitiesQt.cpp +++ b/Tools/TestWebKitAPI/qt/PlatformUtilitiesQt.cpp @@ -21,9 +21,9 @@ #include "config.h" #include "PlatformUtilities.h" -#include -#include -#include +#include +#include +#include #include #include diff --git a/Tools/TestWebKitAPI/qt/PlatformWebViewQt.cpp b/Tools/TestWebKitAPI/qt/PlatformWebViewQt.cpp index 17c786e8e..553462285 100644 --- a/Tools/TestWebKitAPI/qt/PlatformWebViewQt.cpp +++ b/Tools/TestWebKitAPI/qt/PlatformWebViewQt.cpp @@ -31,7 +31,7 @@ #include "qquickwebpage_p.h" #include "qquickwebview_p.h" -#include +#include #include #include diff --git a/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp b/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp index ded3a329d..cab9a21c5 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp @@ -379,6 +379,8 @@ const gchar* roleToString(AtkObject* object) return "AXInvalid"; case ATK_ROLE_LABEL: return "AXLabel"; + case ATK_ROLE_LEVEL_BAR: + return "AXProgressIndicator"; case ATK_ROLE_LINK: return "AXLink"; case ATK_ROLE_LIST: @@ -1217,15 +1219,15 @@ JSRetainPtr AccessibilityUIElement::helpText() const AtkRelationSet* relationSet = atk_object_ref_relation_set(ATK_OBJECT(m_element.get())); if (!relationSet) - return nullptr; + return JSStringCreateWithCharacters(0, 0); AtkRelation* relation = atk_relation_set_get_relation_by_type(relationSet, ATK_RELATION_DESCRIBED_BY); if (!relation) - return nullptr; + return JSStringCreateWithCharacters(0, 0); GPtrArray* targetList = atk_relation_get_target(relation); if (!targetList || !targetList->len) - return nullptr; + return JSStringCreateWithCharacters(0, 0); StringBuilder builder; builder.append("AXHelp: "); @@ -1400,8 +1402,9 @@ double AccessibilityUIElement::maxValue() JSRetainPtr AccessibilityUIElement::valueDescription() { - // FIXME: implement - return JSStringCreateWithCharacters(0, 0); + String valueText = getAttributeSetValueForId(ATK_OBJECT(m_element.get()), ObjectAttributeType, "valuetext"); + GUniquePtr valueDescription(g_strdup_printf("AXValueDescription: %s", valueText.utf8().data())); + return JSStringCreateWithUTF8CString(valueDescription.get()); } int AccessibilityUIElement::insertionPointLineNumber() diff --git a/Tools/WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp b/Tools/WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp index 95ed46d00..7a30b9d6e 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp @@ -52,7 +52,7 @@ public: public Q_SLOTS: void timerFired() { - InjectedBundle::shared().testRunner()->waitToDumpWatchdogTimerFired(); + InjectedBundle::singleton().testRunner()->waitToDumpWatchdogTimerFired(); } private: @@ -80,11 +80,8 @@ void TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded() if (m_waitToDumpWatchdogTimer.isActive()) return; - if (m_timeout > 0) - timerInterval = m_timeout; - else - timerInterval = waitToDumpWatchdogTimerInterval * 1000; + timerInterval = m_timeout; m_waitToDumpWatchdogTimer.start(timerInterval); } @@ -107,10 +104,9 @@ JSRetainPtr TestRunner::pathToLocalResource(JSStringRef url) return url; } -JSRetainPtr TestRunner::platformName() +JSRetainPtr TestRunner::inspectorTestStubURL() { - JSRetainPtr platformName(Adopt, JSStringCreateWithUTF8CString("qt")); - return platformName; + return JSStringCreateWithUTF8CString("qrc:/webkit/inspector/UserInterface/TestStub.html"); } } // namespace WTR diff --git a/Tools/WebKitTestRunner/TestController.h b/Tools/WebKitTestRunner/TestController.h index 461d87990..56bfbee88 100644 --- a/Tools/WebKitTestRunner/TestController.h +++ b/Tools/WebKitTestRunner/TestController.h @@ -314,8 +314,8 @@ private: std::unique_ptr m_eventSenderProxy; #if PLATFORM(QT) - class RunLoop; - RunLoop* m_runLoop; + class RunLoopQt; + RunLoopQt* m_runLoop; #endif WorkQueueManager m_workQueueManager; diff --git a/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp b/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp index e16e3efe0..8fdf331db 100644 --- a/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp +++ b/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp @@ -28,11 +28,11 @@ #include "PlatformWebView.h" #include "TestController.h" -#include +#include #include #include -#include -#include +#include +#include #include namespace WTR { diff --git a/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp b/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp index 510b0465e..ea322093c 100644 --- a/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp +++ b/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp @@ -30,12 +30,12 @@ #include "qquickwebpage_p.h" #include "qquickwebview_p.h" -#include +#include #include #include #include #include -#include +#include #include namespace WTR { @@ -107,6 +107,11 @@ PlatformWebView::~PlatformWebView() m_modalEventLoop->exit(); } +void PlatformWebView::setWindowIsKey(bool isKey) +{ + m_windowIsKey = isKey; +} + void PlatformWebView::resizeTo(unsigned width, unsigned height) { // If we do not have a platform window we will never get the necessary diff --git a/Tools/WebKitTestRunner/qt/TestControllerQt.cpp b/Tools/WebKitTestRunner/qt/TestControllerQt.cpp index 9d3515c82..dd1f3cfbf 100644 --- a/Tools/WebKitTestRunner/qt/TestControllerQt.cpp +++ b/Tools/WebKitTestRunner/qt/TestControllerQt.cpp @@ -28,7 +28,6 @@ #include "TestController.h" #include "PlatformWebView.h" -#include "WKStringQt.h" #include #include @@ -38,16 +37,17 @@ #include #include #include +#include #include #include #include namespace WTR { -class TestController::RunLoop : public QObject { +class TestController::RunLoopQt : public QObject { Q_OBJECT public: - RunLoop(); + RunLoopQt(); void runUntil(double timeout); void notifyDone(); @@ -61,14 +61,14 @@ private: bool m_runUntilLoopClosePending; }; -TestController::RunLoop::RunLoop() +TestController::RunLoopQt::RunLoopQt() : m_runUntilLoopClosePending(false) { m_runUntilLoopTimer.setSingleShot(true); QObject::connect(&m_runUntilLoopTimer, SIGNAL(timeout()), this, SLOT(timerFired())); } -void TestController::RunLoop::runUntil(double timeout) +void TestController::RunLoopQt::runUntil(double timeout) { ASSERT(!m_runUntilLoop.isRunning()); if (timeout) { @@ -78,7 +78,7 @@ void TestController::RunLoop::runUntil(double timeout) m_runUntilLoop.exec(QEventLoop::ExcludeUserInputEvents); } -void TestController::RunLoop::notifyDone() +void TestController::RunLoopQt::notifyDone() { if (m_modalLoop.isRunning()) { // Wait for the modal loop first. We only kill it if we timeout. @@ -90,7 +90,7 @@ void TestController::RunLoop::notifyDone() m_runUntilLoop.exit(); } -void TestController::RunLoop::timerFired() +void TestController::RunLoopQt::timerFired() { if (m_modalLoop.isRunning()) { m_runUntilLoopClosePending = true; @@ -101,7 +101,7 @@ void TestController::RunLoop::timerFired() m_runUntilLoop.exit(); } -void TestController::RunLoop::runModal(PlatformWebView* view) +void TestController::RunLoopQt::runModal(PlatformWebView* view) { ASSERT(!m_modalLoop.isRunning()); view->setModalEventLoop(&m_modalLoop); @@ -118,10 +118,15 @@ void TestController::notifyDone() void TestController::platformInitialize() { - m_runLoop = new RunLoop; + m_runLoop = new RunLoopQt; QQuickWebView::platformInitialize(); } +WKPreferencesRef TestController::platformPreferences() +{ + return WKPageGroupGetPreferences(m_pageGroup.get()); +} + void TestController::platformDestroy() { delete m_runLoop; @@ -130,7 +135,7 @@ void TestController::platformDestroy() void TestController::platformRunUntil(bool& condition, double timeout) { UNUSED_PARAM(condition); - const bool shouldTimeout = !(qgetenv("QT_WEBKIT2_DEBUG") == "1" || timeout == m_noTimeout); + const bool shouldTimeout = !(qgetenv("QT_WEBKIT2_DEBUG") == "1" || timeout <= 0); m_runLoop->runUntil(shouldTimeout ? timeout : 0); } @@ -175,7 +180,7 @@ void TestController::platformInitializeContext() void TestController::runModal(PlatformWebView* view) { - shared().m_runLoop->runModal(view); + singleton().m_runLoop->runModal(view); } const char* TestController::platformLibraryPathForTesting() diff --git a/Tools/WebKitTestRunner/qt/TestInvocationQt.cpp b/Tools/WebKitTestRunner/qt/TestInvocationQt.cpp index ac6aaf1ec..a1237a05e 100644 --- a/Tools/WebKitTestRunner/qt/TestInvocationQt.cpp +++ b/Tools/WebKitTestRunner/qt/TestInvocationQt.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include diff --git a/Tools/qt/make-snapshot.pl b/Tools/qt/make-snapshot.pl new file mode 100755 index 000000000..27c5621d6 --- /dev/null +++ b/Tools/qt/make-snapshot.pl @@ -0,0 +1,40 @@ +#!/usr/bin/env perl + +use Cwd; +use File::Basename; +use strict; +use warnings; + +sub usage { + my $msg = shift || ""; + die $msg . "Usage: cd target/repo/path; $0 src/repo/path"; +} + +scalar @ARGV == 0 || usage(); +-f "ChangeLog" && die "This script must be run in snapshots repository"; +-d ".git" || usage(); + +`git status` =~ "nothing to commit, working tree clean" or die "Target working tree is dirty"; + +my $src_repo = dirname(dirname(dirname(__FILE__))); +my $target_repo = getcwd(); + +chdir $src_repo; +(-f "ChangeLog" && -x "Tools/gtk/make-dist.py") or usage("Target repository path is invalid!\n"); +my $commit = `git rev-parse HEAD` or usage("Cannot get HEAD revision in target repo!\n"); +chomp $commit; + +my @commands = ( + "Tools/gtk/make-dist.py -t snapshot Tools/qt/manifest.txt", + "cd $target_repo", + "git rm -rf *", + "tar -xf $src_repo/snapshot.tar --strip-components=1", + "git add -A", + "rm $src_repo/snapshot.tar", + "git commit -m 'Imported WebKit commit $commit'" +); + +my $cmd = join " && ", @commands; +print "Executing $cmd\n"; + +exec $cmd; -- cgit v1.2.1