summaryrefslogtreecommitdiff
path: root/Tools/DumpRenderTree/chromium
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-25 15:09:11 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-25 15:09:11 +0200
commita89b2ebb8e192c5e8cea21079bda2ee2c0c7dddd (patch)
treeb7abd9f49ae1d4d2e426a5883bfccd42b8e2ee12 /Tools/DumpRenderTree/chromium
parent8d473cf9743f1d30a16a27114e93bd5af5648d23 (diff)
downloadqtwebkit-a89b2ebb8e192c5e8cea21079bda2ee2c0c7dddd.tar.gz
Imported WebKit commit eb5c1b8fe4d4b1b90b5137433fc58a91da0e6878 (http://svn.webkit.org/repository/webkit/trunk@118516)
Diffstat (limited to 'Tools/DumpRenderTree/chromium')
-rw-r--r--Tools/DumpRenderTree/chromium/EventSender.cpp18
-rw-r--r--Tools/DumpRenderTree/chromium/LayoutTestController.cpp29
-rw-r--r--Tools/DumpRenderTree/chromium/LayoutTestController.h4
-rw-r--r--Tools/DumpRenderTree/chromium/MockGrammarCheck.cpp78
-rw-r--r--Tools/DumpRenderTree/chromium/MockGrammarCheck.h (renamed from Tools/DumpRenderTree/chromium/TestShellGtk.cpp)38
-rw-r--r--Tools/DumpRenderTree/chromium/TestShellAndroid.cpp130
-rw-r--r--Tools/DumpRenderTree/chromium/TestShellPosix.cpp71
-rw-r--r--Tools/DumpRenderTree/chromium/TestShellX11.cpp (renamed from Tools/DumpRenderTree/chromium/TestShellLinux.cpp)53
-rw-r--r--Tools/DumpRenderTree/chromium/WebPreferences.cpp2
-rw-r--r--Tools/DumpRenderTree/chromium/WebPreferences.h1
-rw-r--r--Tools/DumpRenderTree/chromium/WebViewHost.cpp21
-rw-r--r--Tools/DumpRenderTree/chromium/WebViewHost.h8
12 files changed, 368 insertions, 85 deletions
diff --git a/Tools/DumpRenderTree/chromium/EventSender.cpp b/Tools/DumpRenderTree/chromium/EventSender.cpp
index 7ddaafbe6..05e4eb83f 100644
--- a/Tools/DumpRenderTree/chromium/EventSender.cpp
+++ b/Tools/DumpRenderTree/chromium/EventSender.cpp
@@ -557,6 +557,24 @@ void EventSender::keyDown(const CppArgumentList& arguments, CppVariant* result)
else if ("menu" == codeStr)
// FIXME: Change this to webkit_support::VKEY_APPS.
code = 0x5D;
+ else if ("leftControl" == codeStr)
+ // FIXME: Change this to webkit_support::VKEY_LCONTROL.
+ code = 0xA2;
+ else if ("rightControl" == codeStr)
+ // FIXME: Change this to webkit_support::VKEY_RCONTROL.
+ code = 0xA3;
+ else if ("leftShift" == codeStr)
+ // FIXME: Change this to webkit_support::VKEY_LSHIFT.
+ code = 0xA0;
+ else if ("rightShift" == codeStr)
+ // FIXME: Change this to webkit_support::VKEY_RSHIFT.
+ code = 0xA1;
+ else if ("leftAlt" == codeStr)
+ // FIXME: Change this to webkit_support::VKEY_LMENU.
+ code = 0xA4;
+ else if ("rightAlt" == codeStr)
+ // FIXME: Change this to webkit_support::VKEY_RMENU.
+ code = 0xA5;
else {
// Compare the input string with the function-key names defined by the
// DOM spec (i.e. "F1",...,"F24"). If the input string is a function-key
diff --git a/Tools/DumpRenderTree/chromium/LayoutTestController.cpp b/Tools/DumpRenderTree/chromium/LayoutTestController.cpp
index d2823afdb..38c2ad652 100644
--- a/Tools/DumpRenderTree/chromium/LayoutTestController.cpp
+++ b/Tools/DumpRenderTree/chromium/LayoutTestController.cpp
@@ -54,6 +54,7 @@
#include "WebKit.h"
#include "WebNotificationPresenter.h"
#include "WebPermissions.h"
+#include "WebPrintParams.h"
#include "WebScriptSource.h"
#include "WebSecurityPolicy.h"
#include "platform/WebSerializedScriptValue.h"
@@ -191,7 +192,6 @@ LayoutTestController::LayoutTestController(TestShell* shell)
bindMethod("setDatabaseQuota", &LayoutTestController::setDatabaseQuota);
bindMethod("setDeferMainResourceDataLoad", &LayoutTestController::setDeferMainResourceDataLoad);
bindMethod("setDomainRelaxationForbiddenForURLScheme", &LayoutTestController::setDomainRelaxationForbiddenForURLScheme);
- bindMethod("setEditingBehavior", &LayoutTestController::setEditingBehavior);
bindMethod("setAudioData", &LayoutTestController::setAudioData);
bindMethod("setGeolocationPermission", &LayoutTestController::setGeolocationPermission);
bindMethod("setIconDatabaseEnabled", &LayoutTestController::setIconDatabaseEnabled);
@@ -1557,6 +1557,8 @@ void LayoutTestController::overridePreference(const CppArgumentList& arguments,
prefs->experimentalWebGLEnabled = cppVariantToBool(value);
else if (key == "WebKitCSSRegionsEnabled")
prefs->experimentalCSSRegionsEnabled = cppVariantToBool(value);
+ else if (key == "WebKitCSSGridLayoutEnabled")
+ prefs->experimentalCSSGridLayoutEnabled = cppVariantToBool(value);
else if (key == "WebKitHyperlinkAuditingEnabled")
prefs->hyperlinkAuditingEnabled = cppVariantToBool(value);
else if (key == "WebKitEnableCaretBrowsing")
@@ -1806,8 +1808,8 @@ void LayoutTestController::numberOfPages(const CppArgumentList& arguments, CppVa
WebFrame* frame = m_shell->webView()->mainFrame();
if (!frame)
return;
- WebSize size(pageWidthInPixels, pageHeightInPixels);
- int numberOfPages = frame->printBegin(size);
+ WebPrintParams printParams(WebSize(pageWidthInPixels, pageHeightInPixels));
+ int numberOfPages = frame->printBegin(printParams);
frame->printEnd();
result->set(numberOfPages);
}
@@ -1875,22 +1877,6 @@ void LayoutTestController::addUserStyleSheet(const CppArgumentList& arguments, C
WebView::UserStyleInjectInExistingDocuments);
}
-void LayoutTestController::setEditingBehavior(const CppArgumentList& arguments, CppVariant* results)
-{
- string key = arguments[0].toString();
- if (key == "mac") {
- m_shell->preferences()->editingBehavior = WebSettings::EditingBehaviorMac;
- m_shell->applyPreferences();
- } else if (key == "win") {
- m_shell->preferences()->editingBehavior = WebSettings::EditingBehaviorWin;
- m_shell->applyPreferences();
- } else if (key == "unix") {
- m_shell->preferences()->editingBehavior = WebSettings::EditingBehaviorUnix;
- m_shell->applyPreferences();
- } else
- logErrorToConsole("Passed invalid editing behavior. Should be 'mac', 'win', or 'unix'.");
-}
-
void LayoutTestController::setMockDeviceOrientation(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
@@ -2216,6 +2202,11 @@ void LayoutTestController::setPageVisibility(const CppArgumentList& arguments, C
}
}
+void LayoutTestController::setAutomaticLinkDetectionEnabled(bool)
+{
+ // Not Implemented
+}
+
void LayoutTestController::setTextDirection(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
diff --git a/Tools/DumpRenderTree/chromium/LayoutTestController.h b/Tools/DumpRenderTree/chromium/LayoutTestController.h
index 793afdfb9..0703ef010 100644
--- a/Tools/DumpRenderTree/chromium/LayoutTestController.h
+++ b/Tools/DumpRenderTree/chromium/LayoutTestController.h
@@ -257,7 +257,6 @@ public:
void setDomainRelaxationForbiddenForURLScheme(const CppArgumentList&, CppVariant*);
void setDeferMainResourceDataLoad(const CppArgumentList&, CppVariant*);
- void setEditingBehavior(const CppArgumentList&, CppVariant*);
// Deals with Web Audio WAV file data.
void setAudioData(const CppArgumentList&, CppVariant*);
@@ -430,6 +429,9 @@ public:
void selectionAsMarkup(const CppArgumentList&, CppVariant*);
+ // Switch the link detection.
+ void setAutomaticLinkDetectionEnabled(bool);
+
#if ENABLE(POINTER_LOCK)
void didLosePointerLock(const CppArgumentList&, CppVariant*);
void setPointerLockWillFailSynchronously(const CppArgumentList&, CppVariant*);
diff --git a/Tools/DumpRenderTree/chromium/MockGrammarCheck.cpp b/Tools/DumpRenderTree/chromium/MockGrammarCheck.cpp
new file mode 100644
index 000000000..e004476ed
--- /dev/null
+++ b/Tools/DumpRenderTree/chromium/MockGrammarCheck.cpp
@@ -0,0 +1,78 @@
+/*
+ * 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.
+ */
+
+#include "config.h"
+#include "MockGrammarCheck.h"
+
+#include "WebTextCheckingResult.h"
+#include "platform/WebString.h"
+
+#include <wtf/ASCIICType.h>
+#include <wtf/Assertions.h>
+#include <wtf/text/WTFString.h>
+
+using namespace WebKit;
+
+bool MockGrammarCheck::checkGrammarOfString(const WebString& text, Vector<WebTextCheckingResult>* results)
+{
+ ASSERT(results);
+ WTF::String stringText(text.data(), text.length());
+ if (stringText.find(isASCIIAlpha) == static_cast<size_t>(-1))
+ return true;
+
+ // Find matching grammatical errors from known ones. This function has to
+ // check all errors because the given text may consist of two or more
+ // sentences that have grammatical errors.
+ static const struct {
+ const char* text;
+ int location;
+ int length;
+ } grammarErrors[] = {
+ {"I have a issue.", 7, 1},
+ {"I have an grape.", 7, 2},
+ {"I have an kiwi.", 7, 2},
+ {"I have an muscat.", 7, 2},
+ {"You has the right.", 4, 3},
+ {"apple orange zz.", 0, 16},
+ {"apple zz orange.", 0, 16},
+ {"apple,zz,orange.", 0, 16},
+ {"orange,zz,apple.", 0, 16},
+ {"the the adlj adaasj sdklj. there there", 0, 38},
+ {"zz apple orange.", 0, 16},
+ };
+ for (size_t i = 0; i < ARRAYSIZE_UNSAFE(grammarErrors); ++i) {
+ int offset = 0;
+ while ((offset = stringText.find(grammarErrors[i].text, offset)) != -1) {
+ results->append(WebTextCheckingResult(WebTextCheckingTypeGrammar, offset + grammarErrors[i].location, grammarErrors[i].length));
+ offset += grammarErrors[i].length;
+ }
+ }
+ return false;
+}
diff --git a/Tools/DumpRenderTree/chromium/TestShellGtk.cpp b/Tools/DumpRenderTree/chromium/MockGrammarCheck.h
index 4228f2afd..64271b3fa 100644
--- a/Tools/DumpRenderTree/chromium/TestShellGtk.cpp
+++ b/Tools/DumpRenderTree/chromium/MockGrammarCheck.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ * 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
@@ -28,25 +28,27 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "config.h"
-#include "TestShell.h"
+#ifndef MockGrammarCheck_h
+#define MockGrammarCheck_h
-#include "webkit/support/webkit_support.h"
-#include <fontconfig/fontconfig.h>
-#include <gtk/gtk.h>
-#include <signal.h>
+#include <wtf/Vector.h>
+#include <wtf/text/WTFString.h>
+namespace WebKit {
-void openStartupDialog()
-{
- GtkWidget* dialog = gtk_message_dialog_new(
- 0, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "Attach to me?");
- gtk_window_set_title(GTK_WINDOW(dialog), "DumpRenderTree");
- gtk_dialog_run(GTK_DIALOG(dialog)); // Runs a nested message loop.
- gtk_widget_destroy(dialog);
-}
+class WebString;
+struct WebTextCheckingResult;
-bool checkLayoutTestSystemDependencies()
-{
- return true;
}
+
+// A mock implementation of a grammar-checker used for WebKit tests. This class
+// only implements the minimal functionarities required by WebKit tests, i.e.
+// this class just compares the given string with known grammar mistakes in
+// webkit tests and adds grammar markers on them. Even though this is sufficent
+// for webkit tests, this class is not suitable for any other usages.
+class MockGrammarCheck {
+public:
+ static bool checkGrammarOfString(const WebKit::WebString&, Vector<WebKit::WebTextCheckingResult>*);
+};
+
+#endif // MockSpellCheck_h
diff --git a/Tools/DumpRenderTree/chromium/TestShellAndroid.cpp b/Tools/DumpRenderTree/chromium/TestShellAndroid.cpp
new file mode 100644
index 000000000..e77d80d48
--- /dev/null
+++ b/Tools/DumpRenderTree/chromium/TestShellAndroid.cpp
@@ -0,0 +1,130 @@
+/*
+ * 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.
+ */
+
+#include "config.h"
+#include "TestShell.h"
+
+#include <android/log.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <wtf/Assertions.h>
+
+namespace {
+
+const char optionInFIFO[] = "--in-fifo=";
+const char optionOutFIFO[] = "--out-fifo=";
+const char optionErrFile[] = "--err-file=";
+
+void androidLogError(const char* format, ...) WTF_ATTRIBUTE_PRINTF(1, 2);
+
+void androidLogError(const char* format, ...)
+{
+ va_list args;
+ va_start(args, format);
+ __android_log_vprint(ANDROID_LOG_ERROR, "DumpRenderTree", format, args);
+ va_end(args);
+}
+
+void removeArg(int index, int* argc, char*** argv)
+{
+ for (int i = index; i < *argc; ++i)
+ (*argv)[i] = (*argv)[i + 1];
+ --*argc;
+}
+
+void createFIFO(const char* fifoPath)
+{
+ unlink(fifoPath);
+ if (mkfifo(fifoPath, 0600)) {
+ androidLogError("Failed to create fifo %s: %s\n", fifoPath, strerror(errno));
+ exit(EXIT_FAILURE);
+ }
+}
+
+void createFile(const char* filePath)
+{
+ unlink(filePath);
+ int fd = creat(filePath, 0600);
+ if (fd < 0) {
+ androidLogError("Failed to create file %s: %s\n", filePath, strerror(errno));
+ exit(EXIT_FAILURE);
+ }
+ close(fd);
+}
+
+void redirectToFile(FILE* stream, const char* path, const char* mode)
+{
+ if (!freopen(path, mode, stream)) {
+ androidLogError("Failed to redirect stream to file: %s: %s\n", path, strerror(errno));
+ exit(EXIT_FAILURE);
+ }
+}
+
+} // namespace
+
+void platformInit(int* argc, char*** argv)
+{
+ const char* inFIFO = 0;
+ const char* outFIFO = 0;
+ const char* errFile = 0;
+ for (int i = 1; i < *argc; ) {
+ const char* argument = (*argv)[i];
+ if (strstr(argument, optionInFIFO) == argument) {
+ inFIFO = argument + WTF_ARRAY_LENGTH(optionInFIFO) - 1;
+ createFIFO(inFIFO);
+ removeArg(i, argc, argv);
+ } else if (strstr(argument, optionOutFIFO) == argument) {
+ outFIFO = argument + WTF_ARRAY_LENGTH(optionOutFIFO) - 1;
+ createFIFO(outFIFO);
+ removeArg(i, argc, argv);
+ } else if (strstr(argument, optionErrFile) == argument) {
+ errFile = argument + WTF_ARRAY_LENGTH(optionErrFile) - 1;
+ createFile(errFile);
+ removeArg(i, argc, argv);
+ } else
+ ++i;
+ }
+
+ // The order of createFIFO() and redirectToFIFO() is important to avoid deadlock.
+ if (outFIFO)
+ redirectToFile(stdout, outFIFO, "w");
+ if (inFIFO)
+ redirectToFile(stdin, inFIFO, "r");
+ if (errFile)
+ redirectToFile(stderr, errFile, "w");
+ else {
+ // Redirect stderr to stdout.
+ dup2(1, 2);
+ }
+}
diff --git a/Tools/DumpRenderTree/chromium/TestShellPosix.cpp b/Tools/DumpRenderTree/chromium/TestShellPosix.cpp
new file mode 100644
index 000000000..a6d8a541c
--- /dev/null
+++ b/Tools/DumpRenderTree/chromium/TestShellPosix.cpp
@@ -0,0 +1,71 @@
+/*
+ * 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.
+ */
+
+#include "config.h"
+#include "TestShell.h"
+
+#include "webkit/support/webkit_support.h"
+
+#include <signal.h>
+#include <unistd.h>
+
+static void AlarmHandler(int)
+{
+ // If the alarm alarmed, kill the process since we have a really bad hang.
+ puts("\n#TEST_TIMED_OUT\n");
+ puts("#EOF\n");
+ fflush(stdout);
+ exit(0);
+}
+
+void TestShell::waitTestFinished()
+{
+ ASSERT(!m_testIsPending);
+ m_testIsPending = true;
+
+ // Install an alarm signal handler that will kill us if we time out.
+ struct sigaction alarmAction;
+ alarmAction.sa_handler = AlarmHandler;
+ sigemptyset(&alarmAction.sa_mask);
+ alarmAction.sa_flags = 0;
+
+ struct sigaction oldAction;
+ sigaction(SIGALRM, &alarmAction, &oldAction);
+ alarm(layoutTestTimeoutForWatchDog() / 1000);
+
+ // TestFinished() will post a quit message to break this loop when the page
+ // finishes loading.
+ while (m_testIsPending)
+ webkit_support::RunMessageLoop();
+
+ // Remove the alarm.
+ alarm(0);
+ sigaction(SIGALRM, &oldAction, 0);
+}
diff --git a/Tools/DumpRenderTree/chromium/TestShellLinux.cpp b/Tools/DumpRenderTree/chromium/TestShellX11.cpp
index b8259b6e7..4b25aa34b 100644
--- a/Tools/DumpRenderTree/chromium/TestShellLinux.cpp
+++ b/Tools/DumpRenderTree/chromium/TestShellX11.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
+ * 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
@@ -31,55 +31,26 @@
#include "config.h"
#include "TestShell.h"
-#include "SkTypeface.h"
-#include "WebView.h"
-#include "webkit/support/webkit_support.h"
-
-#if !OS(ANDROID)
#include <fontconfig/fontconfig.h>
-#endif
#if USE(GTK)
#include <gtk/gtk.h>
-#endif
-#include <signal.h>
-#include <unistd.h>
-static void AlarmHandler(int)
+void openStartupDialog()
{
- // If the alarm alarmed, kill the process since we have a really bad hang.
- puts("\n#TEST_TIMED_OUT\n");
- puts("#EOF\n");
- fflush(stdout);
- exit(0);
+ GtkWidget* dialog = gtk_message_dialog_new(
+ 0, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "Attach to me?");
+ gtk_window_set_title(GTK_WINDOW(dialog), "DumpRenderTree");
+ gtk_dialog_run(GTK_DIALOG(dialog)); // Runs a nested message loop.
+ gtk_widget_destroy(dialog);
}
-void TestShell::waitTestFinished()
+bool checkLayoutTestSystemDependencies()
{
- ASSERT(!m_testIsPending);
- m_testIsPending = true;
-
- // Install an alarm signal handler that will kill us if we time out.
- struct sigaction alarmAction;
- alarmAction.sa_handler = AlarmHandler;
- sigemptyset(&alarmAction.sa_mask);
- alarmAction.sa_flags = 0;
-
- struct sigaction oldAction;
- sigaction(SIGALRM, &alarmAction, &oldAction);
- alarm(layoutTestTimeoutForWatchDog() / 1000);
-
- // TestFinished() will post a quit message to break this loop when the page
- // finishes loading.
- while (m_testIsPending)
- webkit_support::RunMessageLoop();
-
- // Remove the alarm.
- alarm(0);
- sigaction(SIGALRM, &oldAction, 0);
+ return true;
}
+#endif // USE(GTK)
-#if !OS(ANDROID)
static bool checkAndLoadFontFile(FcConfig* fontcfg, const char* path1, const char* path2)
{
const char* font = path1;
@@ -206,7 +177,6 @@ static void setupFontconfig()
exit(1);
}
}
-#endif // !OS(ANDROID)
void platformInit(int* argc, char*** argv)
{
@@ -216,8 +186,5 @@ void platformInit(int* argc, char*** argv)
gtk_init(argc, argv);
#endif
-#if !OS(ANDROID)
setupFontconfig();
-#endif
}
-
diff --git a/Tools/DumpRenderTree/chromium/WebPreferences.cpp b/Tools/DumpRenderTree/chromium/WebPreferences.cpp
index b46c7f650..3227c0231 100644
--- a/Tools/DumpRenderTree/chromium/WebPreferences.cpp
+++ b/Tools/DumpRenderTree/chromium/WebPreferences.cpp
@@ -81,6 +81,7 @@ void WebPreferences::reset()
developerExtrasEnabled = true;
experimentalWebGLEnabled = false;
experimentalCSSRegionsEnabled = true;
+ experimentalCSSGridLayoutEnabled = false;
javaEnabled = false;
javaScriptCanAccessClipboard = true;
javaScriptCanOpenWindowsAutomatically = true;
@@ -195,6 +196,7 @@ void WebPreferences::applyTo(WebView* webView)
settings->setDeveloperExtrasEnabled(developerExtrasEnabled);
settings->setExperimentalWebGLEnabled(experimentalWebGLEnabled);
settings->setExperimentalCSSRegionsEnabled(experimentalCSSRegionsEnabled);
+ settings->setExperimentalCSSGridLayoutEnabled(experimentalCSSGridLayoutEnabled);
settings->setExperimentalCSSCustomFilterEnabled(cssCustomFilterEnabled);
settings->setJavaEnabled(javaEnabled);
settings->setJavaScriptCanAccessClipboard(javaScriptCanAccessClipboard);
diff --git a/Tools/DumpRenderTree/chromium/WebPreferences.h b/Tools/DumpRenderTree/chromium/WebPreferences.h
index b60c70e34..31de331ed 100644
--- a/Tools/DumpRenderTree/chromium/WebPreferences.h
+++ b/Tools/DumpRenderTree/chromium/WebPreferences.h
@@ -83,6 +83,7 @@ struct WebPreferences {
bool developerExtrasEnabled;
bool experimentalWebGLEnabled;
bool experimentalCSSRegionsEnabled;
+ bool experimentalCSSGridLayoutEnabled;
bool javaEnabled;
bool javaScriptCanAccessClipboard;
bool javaScriptCanOpenWindowsAutomatically;
diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.cpp b/Tools/DumpRenderTree/chromium/WebViewHost.cpp
index 366546015..ef82f2b88 100644
--- a/Tools/DumpRenderTree/chromium/WebViewHost.cpp
+++ b/Tools/DumpRenderTree/chromium/WebViewHost.cpp
@@ -32,6 +32,7 @@
#include "WebViewHost.h"
#include "LayoutTestController.h"
+#include "MockGrammarCheck.h"
#include "MockWebSpeechInputController.h"
#include "TestNavigationController.h"
#include "TestShell.h"
@@ -55,6 +56,7 @@
#include "WebPluginParams.h"
#include "WebPopupMenu.h"
#include "WebPopupType.h"
+#include "WebPrintParams.h"
#include "WebRange.h"
#include "platform/WebRect.h"
#include "WebScreenInfo.h"
@@ -470,7 +472,6 @@ void WebViewHost::requestCheckingOfText(const WebString& text, WebTextCheckingCo
void WebViewHost::finishLastTextCheck()
{
Vector<WebTextCheckingResult> results;
- // FIXME: Do the grammar check.
int offset = 0;
String text(m_lastRequestedTextCheckString.data(), m_lastRequestedTextCheckString.length());
while (text.length()) {
@@ -486,7 +487,7 @@ void WebViewHost::finishLastTextCheck()
text = text.substring(misspelledPosition + misspelledLength);
offset += misspelledPosition + misspelledLength;
}
-
+ MockGrammarCheck::checkGrammarOfString(m_lastRequestedTextCheckString, &results);
m_lastRequestedTextCheckingCompletion->didFinishCheckingText(results);
m_lastRequestedTextCheckingCompletion = 0;
}
@@ -676,10 +677,12 @@ void WebViewHost::postAccessibilityNotification(const WebAccessibilityObject& ob
}
}
+#if ENABLE(NOTIFICATIONS)
WebNotificationPresenter* WebViewHost::notificationPresenter()
{
return m_shell->notificationPresenter();
}
+#endif
WebKit::WebGeolocationClient* WebViewHost::geolocationClient()
{
@@ -693,12 +696,14 @@ WebKit::WebGeolocationClientMock* WebViewHost::geolocationClientMock()
return m_geolocationClientMock.get();
}
+#if ENABLE(INPUT_SPEECH)
WebSpeechInputController* WebViewHost::speechInputController(WebKit::WebSpeechInputListener* listener)
{
if (!m_speechInputControllerMock)
m_speechInputControllerMock = MockWebSpeechInputController::create(listener);
return m_speechInputControllerMock.get();
}
+#endif
WebDeviceOrientationClientMock* WebViewHost::deviceOrientationClientMock()
{
@@ -1346,13 +1351,19 @@ void WebViewHost::dispatchIntent(WebFrame* source, const WebIntentRequest& reque
(*ports)[i]->destroy();
delete ports;
}
+
if (!request.intent().service().isEmpty())
printf("Explicit intent service: %s\n", request.intent().service().spec().data());
+
WebVector<WebString> extras = request.intent().extrasNames();
for (size_t i = 0; i < extras.size(); ++i) {
printf("Extras[%s] = %s\n", extras[i].utf8().data(),
request.intent().extrasValue(extras[i]).utf8().data());
}
+
+ WebVector<WebURL> suggestions = request.intent().suggestions();
+ for (size_t i = 0; i < suggestions.size(); ++i)
+ printf("Have suggestion %s\n", suggestions[i].spec().data());
}
void WebViewHost::deliveredIntentResult(WebFrame* frame, int id, const WebSerializedScriptValue& data)
@@ -1451,8 +1462,10 @@ void WebViewHost::reset()
if (m_geolocationClientMock.get())
m_geolocationClientMock->resetMock();
+#if ENABLE(INPUT_SPEECH)
if (m_speechInputControllerMock.get())
m_speechInputControllerMock->clearResults();
+#endif
m_currentCursor = WebCursorInfo();
m_windowRect = WebRect();
@@ -1841,7 +1854,7 @@ void WebViewHost::displayRepaintMask()
void WebViewHost::printPage(WebKit::WebFrame* frame)
{
WebSize pageSizeInPixels = webWidget()->size();
-
- frame->printBegin(pageSizeInPixels);
+ WebPrintParams printParams(pageSizeInPixels);
+ frame->printBegin(printParams);
frame->printEnd();
}
diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.h b/Tools/DumpRenderTree/chromium/WebViewHost.h
index a830f593c..c5f930127 100644
--- a/Tools/DumpRenderTree/chromium/WebViewHost.h
+++ b/Tools/DumpRenderTree/chromium/WebViewHost.h
@@ -111,7 +111,9 @@ class WebViewHost : public WebKit::WebSpellCheckClient, public WebKit::WebViewCl
WebKit::WebContextMenuData* lastContextMenuData() const;
void clearContextMenuData();
+#if ENABLE(INPUT_SPEECH)
MockWebSpeechInputController* speechInputControllerMock() { return m_speechInputControllerMock.get(); }
+#endif
#if ENABLE(POINTER_LOCK)
void didLosePointerLock();
@@ -162,9 +164,13 @@ class WebViewHost : public WebKit::WebSpellCheckClient, public WebKit::WebViewCl
virtual int historyBackListCount();
virtual int historyForwardListCount();
virtual void postAccessibilityNotification(const WebKit::WebAccessibilityObject&, WebKit::WebAccessibilityNotification);
+#if ENABLE(NOTIFICATIONS)
virtual WebKit::WebNotificationPresenter* notificationPresenter();
+#endif
virtual WebKit::WebGeolocationClient* geolocationClient();
+#if ENABLE(INPUT_SPEECH)
virtual WebKit::WebSpeechInputController* speechInputController(WebKit::WebSpeechInputListener*);
+#endif
virtual WebKit::WebDeviceOrientationClient* deviceOrientationClient();
#if ENABLE(MEDIA_STREAM)
virtual WebKit::WebUserMediaClient* userMediaClient();
@@ -397,7 +403,9 @@ private:
OwnPtr<WebKit::WebGeolocationClientMock> m_geolocationClientMock;
OwnPtr<WebKit::WebDeviceOrientationClientMock> m_deviceOrientationClientMock;
+#if ENABLE(INPUT_SPEECH)
OwnPtr<MockWebSpeechInputController> m_speechInputControllerMock;
+#endif
#if ENABLE(MEDIA_STREAM)
OwnPtr<WebKit::WebUserMediaClientMock> m_userMediaClientMock;