diff options
Diffstat (limited to 'WebKitTools')
83 files changed, 3317 insertions, 263 deletions
diff --git a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json index db7379d..81e3f91 100644 --- a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json +++ b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json @@ -38,6 +38,9 @@ { "name": "google-windows-1", "platform": "chromium" }, { "name": "google-mac-1", "platform": "chromium" }, { "name": "google-linux-1", "platform": "chromium" }, + { "name": "google-windows-2", "platform": "chromium" }, + { "name": "google-mac-2", "platform": "chromium" }, + { "name": "google-linux-2", "platform": "chromium" }, { "name": "google-new-tests", "platform": "mac-leopard" } ], @@ -165,11 +168,26 @@ "platform": "chromium", "configuration": "release", "architectures": ["i386"], "slavenames": ["google-linux-1"] }, - { - "name": "New run-webkit-tests", "type": "NewBuildAndTest", "builddir": "google-new-tests", - "platform": "mac-leopard", "configuration": "release", "architectures": ["i386"], - "slavenames": ["google-new-tests"] - } + { + "name": "Chromium Win Release (Tests)", "type": "NewBuildAndTest", "builddir": "chromium-win-release-tests", + "platform": "chromium", "configuration": "release", "architectures": ["i386"], + "slavenames": ["google-windows-2"] + }, + { + "name": "Chromium Mac Release (Tests)", "type": "NewBuildAndTest", "builddir": "chromium-mac-release-tests", + "platform": "chromium", "configuration": "release", "architectures": ["i386"], + "slavenames": ["google-mac-2"] + }, + { + "name": "Chromium Linux Release (Tests)", "type": "NewBuildAndTest", "builddir": "chromium-linux-release-tests", + "platform": "chromium", "configuration": "release", "architectures": ["i386"], + "slavenames": ["google-linux-2"] + }, + { + "name": "New run-webkit-tests", "type": "NewBuildAndTest", "builddir": "google-new-tests", + "platform": "mac-leopard", "configuration": "release", "architectures": ["i386"], + "slavenames": ["google-new-tests"] + } ], "schedulers": [ { "type": "AnyBranchScheduler", "name": "trunk", "branches": ["trunk"], "treeStableTimer": 45.0, @@ -179,7 +197,8 @@ "GTK Linux 32-bit Release", "GTK Linux 32-bit Debug", "GTK Linux 64-bit Debug", "GTK Linux 64-bit Release", "Qt Linux Release", "Qt Linux Release minimal", "Qt Linux ARMv5 Release", "Qt Linux ARMv7 Release", "Qt Windows 32-bit Release", "Qt Windows 32-bit Debug", - "Chromium Win Release", "Chromium Mac Release", "Chromium Linux Release"] + "Chromium Win Release", "Chromium Mac Release", "Chromium Linux Release", + "Chromium Win Release (Tests)", "Chromium Mac Release (Tests)", "Chromium Linux Release (Tests)"] }, { "type": "Triggerable", "name": "leopard-intel-release-tests", "builderNames": ["Leopard Intel Release (Tests)"] diff --git a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg index 151225f..bbc94ec 100644 --- a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg +++ b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg @@ -238,9 +238,9 @@ class RunWebKitTests(shell.Test): class NewRunWebKitTests(RunWebKitTests): - command = ["./WebKitTools/Scripts/new-run-webkit-tests", "--noshow-results", + command = ["perl", "./WebKitTools/Scripts/new-run-webkit-tests", "--noshow-results", "--verbose", "--results-directory", "layout-test-results", - WithProperties("--%(configuration)s")] + WithProperties("--%(configuration)s"), "--use-drt"] class RunPythonTests(shell.Test): @@ -376,7 +376,8 @@ class BuildAndTestFactory(Factory): def __init__(self, platform, configuration, architectures): Factory.__init__(self, platform, configuration, architectures, False) self.addStep(CompileWebKit) - self.addStep(RunJavaScriptCoreTests) + if platform != "chromium": + self.addStep(RunJavaScriptCoreTests) self.addStep(self.TestClass) # Tiger's Python 2.3 is too old. WebKit Python requires 2.5+. # Sadly we have no way to detect the version on the slave from here. diff --git a/WebKitTools/BuildSlaveSupport/test-result-archive b/WebKitTools/BuildSlaveSupport/test-result-archive index 3b019c0..df02dbd 100644 --- a/WebKitTools/BuildSlaveSupport/test-result-archive +++ b/WebKitTools/BuildSlaveSupport/test-result-archive @@ -46,7 +46,7 @@ def main(): return archiveTestResults(options.configuration, options.platform) def archiveTestResults(configuration, platform): - assert platform in ('mac', 'win', 'gtk', 'qt') + assert platform in ('mac', 'win', 'gtk', 'qt', 'chromium') try: os.unlink(archiveFile) @@ -66,7 +66,7 @@ def archiveTestResults(configuration, platform): if platform == 'mac': if subprocess.call(["ditto", "-c", "-k", "--sequesterRsrc", layoutTestResultsDir, archiveFile]): return 1 - elif platform in ('win', 'gtk', 'qt'): + elif platform in ('win', 'gtk', 'qt', 'chromium'): if subprocess.call(["zip", "-r", archiveFile, "."], cwd=layoutTestResultsDir): return 1 diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog index 13d9f20..e7d06cd 100644 --- a/WebKitTools/ChangeLog +++ b/WebKitTools/ChangeLog @@ -1,3 +1,1025 @@ +2010-06-25 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Add a LOG macro that expands to a no-op by default. + + * MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj: + * MiniBrowser/mac/AppDelegate.m: + (_didRecieveMessageFromInjectedBundle): + * MiniBrowser/mac/BrowserWindowController.m: + (-[BrowserWindowController windowShouldClose:]): + (_didStartProvisionalLoadForFrame): + (_didReceiveServerRedirectForProvisionalLoadForFrame): + (_didFailProvisionalLoadWithErrorForFrame): + (_didCommitLoadForFrame): + (_didFinishLoadForFrame): + (_didFailLoadWithErrorForFrame): + (_didReceiveTitleForFrame): + (_didFirstLayoutForFrame): + (_didFirstVisuallyNonEmptyLayoutForFrame): + (_didBecomeUnresponsive): + (_didBecomeResponsive): + (_decidePolicyForNavigationAction): + (_decidePolicyForNewWindowAction): + (_createNewPage): + (_showPage): + (_closePage): + (_didNavigateWithNavigationData): + (_didPerformClientRedirect): + (_didPerformServerRedirect): + (_didUpdateHistoryTitle): + * MiniBrowser/mac/MiniBrowser_Prefix.pch: + * MiniBrowser/mac/WebBundle/WebBundleMain.m: + (_didClearWindowForFrame): + (_didCreatePage): + (_willDestroyPage): + (_didRecieveMessage): + +2010-06-24 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + commit-queue is taking too long to land patches because of red trees + https://bugs.webkit.org/show_bug.cgi?id=41194 + + Instead of checking for the tree to be green, we'll just spin hot + trying to land patches. This is probably too extreme in ignoring the + tree, but I think we should try it for a while to see if we have + trouble. That will help us find the right balance. + + * Scripts/webkitpy/tool/commands/queues.py: + * Scripts/webkitpy/tool/commands/queues_unittest.py: + +2010-06-24 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Xan Lopez. + + [GTK] Clean up the use of gdk_window_get_root_coords in EventSender + https://bugs.webkit.org/show_bug.cgi?id=40843 + + Define the version for old GTK+s in a way that is forward-compatible + and clean up the logic a bit. + + * DumpRenderTree/gtk/EventSender.cpp: + (gdk_window_get_root_coords): Renamed and cleaned up. + (prepareMouseButtonEvent): Remove #ifdefs. + (mouseMoveToCallback): Remove #ifdefs. + +2010-06-24 Dimitri Glazkov <dglazkov@chromium.org> + + Reviewed by Eric Seidel. + + Fix NewRunWebKitTests to work on Windows. + https://bugs.webkit.org/show_bug.cgi?id=41180 + + * BuildSlaveSupport/build.webkit.org-config/master.cfg: Added "perl" as first arguments, + because Windows fails to understand what we're asking of it. + +2010-06-24 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Xan Lopez. + + [GTK] The url passed to the WebView during layout tests is invalid + https://bugs.webkit.org/show_bug.cgi?id=40832 + + Set the test URL to the full real file URL and do a small cleanup. + Previously a URL like file://relative/path/to/test.html was passed + to the WebView. This malformed file URL would be returned by + webkit_web_view_get_url and webkit_web_frame_get_url. + + * DumpRenderTree/gtk/DumpRenderTree.cpp: + (shouldLogFrameLoadDelegates): Change to take a const string& as the argument. + (shouldOpenWebInspector): Change to take a const string& as the argument. + (shouldEnableDeveloperExtras): Change to take a const string& as the argument. + (runTest): Pass the full file:// URL to the view. Remove the superfluous url variable. + +2010-06-24 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + Fix WebKitTestRunner Makefile typos. + + * WebKitTestRunner/Makefile: + +2010-06-24 Adele Peterson <adele@apple.com> + + Reviewed by Eric Carlson. + + DumpRenderTree part of testing <rdar://problem/8093680> "Paste and Match Style" should fire paste events + https://bugs.webkit.org/show_bug.cgi?id=41085 + + * DumpRenderTree/mac/DumpRenderTree.mm: (resetWebViewToConsistentStateBeforeTesting): + Clear the general pasteboard in between tests so Cut,Copy, and setData on ClipboardData won't have lasting effects. + +2010-06-23 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + Patch for https://bugs.webkit.org/show_bug.cgi?id=41086 + Add new WebKitTestRunner project (ie. DRT for WebKit2). + + - Mac only. + - run-webkit-tests has not been modified to call it yet. + - Only dumps the render tree at this time. + + * WebKitTestRunner: Added. + * WebKitTestRunner/Configurations: Added. + * WebKitTestRunner/Configurations/Base.xcconfig: Added. + * WebKitTestRunner/Configurations/DebugRelease.xcconfig: Added. + * WebKitTestRunner/Configurations/InjectedBundle.xcconfig: Added. + * WebKitTestRunner/Configurations/WebKitTestRunner.xcconfig: Added. + * WebKitTestRunner/InjectedBundle: Added. + * WebKitTestRunner/InjectedBundle-Info.plist: Added. + * WebKitTestRunner/InjectedBundle/InjectedBundleMain.cpp: Added. + (_didStartProvisionalLoadForFrame): + (_didReceiveServerRedirectForProvisionalLoadForFrame): + (_didFailProvisionalLoadWithErrorForFrame): + (_didCommitLoadForFrame): + (_didFinishLoadForFrame): + (_didFailLoadWithErrorForFrame): + (_didReceiveTitleForFrame): + (_didClearWindow): + (_didCreatePage): + (_willDestroyPage): + (_didRecieveMessage): + (WKBundleInitialize): + * WebKitTestRunner/Makefile: Added. + * WebKitTestRunner/PlatformWebView.h: Added. + (WTR::PlatformWebView::platformView): + * WebKitTestRunner/TestController.cpp: Added. + (WTR::TestController::shared): + (WTR::TestController::TestController): + (WTR::TestController::initialize): + (WTR::TestController::runTest): + (WTR::TestController::runTestingServerLoop): + (WTR::TestController::run): + * WebKitTestRunner/TestController.h: Added. + (WTR::TestController::verbose): + (WTR::TestController::injectedBundlePath): + * WebKitTestRunner/TestInvocation.cpp: Added. + (WTR::createWKURL): + (WTR::TestInvocation::TestInvocation): + (WTR::TestInvocation::~TestInvocation): + (WTR::TestInvocation::invoke): + (WTR::TestInvocation::dump): + (WTR::TestInvocation::initializeMainWebView): + (WTR::TestInvocation::didStartProvisionalLoadForFrame): + (WTR::TestInvocation::didReceiveServerRedirectForProvisionalLoadForFrame): + (WTR::TestInvocation::didFailProvisionalLoadWithErrorForFrame): + (WTR::TestInvocation::didCommitLoadForFrame): + (WTR::TestInvocation::didFinishLoadForFrame): + (WTR::TestInvocation::didFailLoadForFrame): + (WTR::TestInvocation::renderTreeExternalRepresentationFunction): + (WTR::TestInvocation::renderTreeExternalRepresentationDisposeFunction): + * WebKitTestRunner/TestInvocation.h: Added. + * WebKitTestRunner/WebKitTestRunner.xcodeproj: Added. + * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: Added. + * WebKitTestRunner/WebKitTestRunnerPrefix.h: Added. + * WebKitTestRunner/mac: Added. + * WebKitTestRunner/mac/PlatformWebViewMac.mm: Added. + (WTR::PlatformWebView::PlatformWebView): + (WTR::PlatformWebView::~PlatformWebView): + (WTR::PlatformWebView::page): + * WebKitTestRunner/mac/TestInvocationMac.mm: Added. + (WTR::TestInvocation::runUntil): + * WebKitTestRunner/mac/main.mm: Added. + (main): + +2010-06-24 Luiz Agostini <luiz.agostini@openbossa.org> + + Unreviewed. Adding myself to the committers list. + + * Scripts/webkitpy/common/config/committers.py: + +2010-06-23 Kevin Ollivier <kevino@theolliviers.com> + + [wx] Build fix, adding new LayoutTestController methods and enabling SVG_FOREIGN_OBJECT. + + * DumpRenderTree/wx/LayoutTestControllerWx.cpp: + (LayoutTestController::isPageBoxVisible): + (LayoutTestController::pageAreaRectInPixels): + (LayoutTestController::preferredPageSizeInPixels): + * wx/build/settings.py: + +2010-06-23 James Robinson <jamesr@chromium.org> + + Unreviewed. Add my IRC handle to committers.py so the sheriffbot can yell at me. + + * Scripts/webkitpy/common/config/committers.py: + +2010-06-23 Kent Tamura <tkent@chromium.org> + + Reviewed by Dimitri Glazkov. + + Correct Chromium test configuration + https://bugs.webkit.org/show_bug.cgi?id=41057 + + * BuildSlaveSupport/build.webkit.org-config/master.cfg: + - Add "--use-drt" option for NRWT. It is required for Chromium and + ignored for other platforms. + - Skip JSC test on Chromium + * BuildSlaveSupport/test-result-archive: + Add Chromium support. + +2010-06-23 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + Fix for https://bugs.webkit.org/show_bug.cgi?id=41073 + WebKit2: Flesh out more of the InjectedBundle client API + + * MiniBrowser/mac/WebBundle/WebBundleMain.m: + (_didStartProvisionalLoadForFrame): + (_didReceiveServerRedirectForProvisionalLoadForFrame): + (_didFailProvisionalLoadWithErrorForFrame): + (_didCommitLoadForFrame): + (_didFinishLoadForFrame): + (_didFailLoadWithErrorForFrame): + (_didReceiveTitleForFrame): + (_didClearWindowForFrame): + (_didCreatePage): + (_willDestroyPage): + (WKBundleInitialize): + +2010-06-23 Yuzo Fujishima <yuzo@google.com> + + Reviewed by Shinichiro Hamaji. + + Implement page format data programming interface. + Add methods for testing. + https://bugs.webkit.org/show_bug.cgi?id=37538 + + * DumpRenderTree/LayoutTestController.cpp: + (parsePageNumber): + (isPageBoxVisibleCallback): + (pageAreaRectInPixelsCallback): + (preferredPageSizeInPixelsCallback): + (LayoutTestController::staticFunctions): + * DumpRenderTree/LayoutTestController.h: + * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: + (LayoutTestController::isPageBoxVisible): + (LayoutTestController::pageAreaRectInPixels): + (LayoutTestController::preferredPageSizeInPixels): + * DumpRenderTree/mac/LayoutTestControllerMac.mm: + (LayoutTestController::isPageBoxVisible): + (LayoutTestController::pageAreaRectInPixels): + (LayoutTestController::preferredPageSizeInPixels): + * DumpRenderTree/win/LayoutTestControllerWin.cpp: + (LayoutTestController::isPageBoxVisible): + (LayoutTestController::pageAreaRectInPixels): + (LayoutTestController::preferredPageSizeInPixels): + +2010-06-23 Sam Magnuson <smagnuson@netflix.com> + + Reviewed by Shinichiro Hamaji. + + Follow proper convention for if/switch/while as I've discovered + them to be through my review processes. + https://bugs.webkit.org/show_bug.cgi?id=40723 + + Modified test so that if( foo ) is not allowed as it appears not + to be the accepted convention. + + * Scripts/webkitpy/style/checkers/cpp.py: + * Scripts/webkitpy/style/checkers/cpp_unittest.py: + +2010-06-22 Eric Seidel <eric@webkit.org> + + Reviewed by Adam Barth. + + Run clean-header-guards to fix some header guards + https://bugs.webkit.org/show_bug.cgi?id=41044 + + No functional changes, thus no tests. + + This entire change was generated by running + clean-header-guards, and then reverting changes + to files which shouldn't be changed. Those which + are left all should be updated. + + Some of these changes are just fixing 755 permissions + to be 644, since it seems various files have the wrong + execute bit which don't need it. clean-header-guards + made those (welcome) permission fixes unintentionally. + + * DumpRenderTree/chromium/WebThemeControlDRT.h: + * DumpRenderTree/chromium/WebThemeEngineDRT.h: + * QtTestBrowser/fpstimer.h: + +2010-06-22 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Rename HTMLDocumentParser to LegacyHTMLDocumentParser + https://bugs.webkit.org/show_bug.cgi?id=41043 + + Update the hash. + + * Scripts/do-webcore-rename: + +2010-06-22 Sam Magnuson <smagnuson@netflix.com> + + Reviewed by Shinichiro Hamaji. + + Follow proper convention for variable declaration spacing. + https://bugs.webkit.org/show_bug.cgi?id=40724 + + Modified test so that 'int a;' is not allowed. + + * Scripts/webkitpy/style/checkers/cpp.py: + * Scripts/webkitpy/style/checkers/cpp_unittest.py: + +2010-06-22 Eric Seidel <eric@webkit.org> + + Unreviewed. Add Tony Gentilcore now that he's a committer. + + * Scripts/webkitpy/common/config/committers.py: + +2010-06-22 Eric Seidel <eric@webkit.org> + + Reviewed by Adam Barth. + + Remove Gtk 64-Release bot from core since it's broken + https://bugs.webkit.org/show_bug.cgi?id=41022 + + This bot alone has been responsible for more than 72 hours of + commit-queue blockage in the last week. The bot is broken -- keeps + losing its display server or similar. Until the Gtk folks can fix the + bot, we need to remove it from core. The WebKit community can't keep + it green as is. + + * Scripts/webkitpy/common/net/buildbot.py: + * Scripts/webkitpy/common/net/buildbot_unittest.py: + +2010-06-21 Dumitru Daniliuc <dumi@chromium.org> + + Reviewed by Eric Seidel. + + Fix the Windows build. + https://bugs.webkit.org/show_bug.cgi?id=40972 + + * DumpRenderTree/win/ImageDiff.vcproj: + +2010-06-21 Prasad Tammana <prasadt@chromium.org> + + Reviewed by Darin Adler, Dmitry Titov. + + DumpRenderTree should allow tests with modal dialogs + https://bugs.webkit.org/show_bug.cgi?id=35350 + + * DumpRenderTree/LayoutTestController.cpp: + (abortModalCallback): + (LayoutTestController::staticFunctions): + * DumpRenderTree/LayoutTestController.h: + * DumpRenderTree/mac/LayoutTestControllerMac.mm: + (LayoutTestController::abortModal): + Add abortModal method to LayoutTestController and make it available from script. + + * DumpRenderTree/mac/UIDelegate.mm: Add support for showModalDialog. + (-[UIDelegate modalWindowWillClose:]): Observer for NSWindowWillCloseNotifications to call + abortModal from when modal window closes. + (-[UIDelegate webViewRunModal:]): Delegate method for showModalDialog to run the modal loop. + +2010-06-21 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Anders Carlsson. + + Rename DrawingAreaProxyUpdateChunk to ChunkedUpdateDrawingArea + https://bugs.webkit.org/show_bug.cgi?id=40948 + + Have the script look in WebKit2. + + * Scripts/do-webcore-rename: + +2010-06-21 Robert Hogan <robert@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Unskip plugins/get-url-that-the-resource-load-delegate-will-disallow.html + + It's a Mac-specific test so just add the required LayoutTestController + function as a no-op to avoid failing. Similar approach adopted by other + ports. + + https://bugs.webkit.org/show_bug.cgi?id=33344 + + * DumpRenderTree/qt/LayoutTestControllerQt.h: + (LayoutTestController::addDisallowedURL): + +2010-06-21 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + Patch for https://bugs.webkit.org/show_bug.cgi?id=40940 + Add message passing support to the WebKit2 API. + + - Add some test messages. + + * MiniBrowser/mac/AppDelegate.m: + (_didRecieveMessageFromInjectedBundle): + (-[BrowserAppDelegate init]): + * MiniBrowser/mac/WebBundle/WebBundleMain.m: + (_didClearWindow): + (_didCreatePage): + (_didRecieveMessage): + (WKBundleInitialize): + +2010-06-21 Drew Wilson <atwilson@chromium.org> + + Unreviewed. + + Rolling back 61551 and 61555 due to test failures. + + * DumpRenderTree/LayoutTestController.cpp: + (LayoutTestController::staticFunctions): + * DumpRenderTree/LayoutTestController.h: + * DumpRenderTree/mac/LayoutTestControllerMac.mm: + (LayoutTestController::setEditingBehavior): + * DumpRenderTree/mac/UIDelegate.mm: + +2010-06-21 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Make DumpRenderTree build with clang++ + + * DumpRenderTree/mac/DumpRenderTreePasteboard.m: + (-[LocalPasteboard setPropertyList:forType:]): + * DumpRenderTree/mac/DumpRenderTreeWindow.mm: + (-[DumpRenderTreeWindow keyDown:]): + * DumpRenderTree/mac/LayoutTestControllerMac.mm: + (LayoutTestController::elementDoesAutoCompleteForElementWithId): + (LayoutTestController::isCommandEnabled): + +2010-06-21 Satish Sampath <satish@chromium.org> + + Reviewed by Steve Block. + + Speech Input Patch 0: Added compilation argument to conditionally compile pending patches. + https://bugs.webkit.org/show_bug.cgi?id=40878 + + * Scripts/build-webkit: + +2010-06-21 Kent Tamura <tkent@chromium.org> + + Reviewed by Dimitri Glazkov. + + [DRT/Chromium] Initialization for http/tests/loading/ + https://bugs.webkit.org/show_bug.cgi?id=40902 + + * DumpRenderTree/chromium/TestShell.cpp: + (TestShell::runFileTest): + +2010-06-21 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Unreviewed. + + Adding myself to the committers list. + + * Scripts/webkitpy/common/config/committers.py: + +2010-06-20 Kent Tamura <tkent@chromium.org> + + Reviewed by Dimitri Glazkov. + + [DRT/Chromium] Add --allow-external-pages option + https://bugs.webkit.org/show_bug.cgi?id=40762 + + Add --allow-external-pages introduced by Chromium r45403. + http://src.chromium.org/viewvc/chrome?view=rev&revision=45403 + + * DumpRenderTree/chromium/DumpRenderTree.cpp: + (main): + * DumpRenderTree/chromium/TestShell.cpp: + (TestShell::TestShell): + * DumpRenderTree/chromium/TestShell.h: + (TestShell::allowExternalPages): + (TestShell::setAllowExternalPages): + * DumpRenderTree/chromium/WebViewHost.cpp: + (WebViewHost::willSendRequest): + +2010-06-20 Joseph Pecoraro <joepeck@webkit.org> + + Reviewed by Adam Barth. + + Sheriffbot: Should allow "r" in SVN_REVISION + https://bugs.webkit.org/show_bug.cgi?id=40889 + + * Scripts/webkitpy/tool/bot/irc_command.py: remove a leading "r" from SVN_REVISION if it exists + * Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py: test an SVN_REVISION with a leading r. + +2010-06-20 Joseph Pecoraro <joepeck@webkit.org> + + Reviewed by Dimitri Glazkov. + + Python Tests Fail after r61508 + https://bugs.webkit.org/show_bug.cgi?id=40891 + + Test's regex list needed to be updated to match the new + regex list in the source code. Added new bots to the + example_buildbots list. + + Regex list fixed in r61512. Updated bot list. + + * Scripts/webkitpy/common/net/buildbot_unittest.py: + +2010-06-20 Dimitri Glazkov <dglazkov@chromium.org> + + Unreviewed, build fix. + + Tweak test regexp list to match the change in http://trac.webkit.org/changeset/61508. + + * Scripts/webkitpy/common/net/buildbot_unittest.py: Tweaked regexp. + +2010-06-19 Justin Schuh <jschuh@chromium.org> + + Unreviewed. + + Adding myself to the committers list. + + * Scripts/webkitpy/common/config/committers.py: + +2010-06-19 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + Fix for https://bugs.webkit.org/show_bug.cgi?id=40882 + Add ability to have a WebProcess per WebContext. + + Move to use new shared contexts API. + + * MiniBrowser/mac/AppDelegate.h: + * MiniBrowser/mac/AppDelegate.m: + (-[BrowserAppDelegate init]): + (-[BrowserAppDelegate getCurrentPageNamespace]): + (-[BrowserAppDelegate validateMenuItem:]): + (-[BrowserAppDelegate _setProcessModel:]): + (-[BrowserAppDelegate setSharedProcessProcessModel:]): + (-[BrowserAppDelegate setSharedThreadProcessModel:]): + * MiniBrowser/win/BrowserView.cpp: + (BrowserView::create): + +2010-06-02 Robert Hogan <robert@webkit.org> + + Reviewed by Adam Barth. + + [Qt] Support evaluateScriptInIsolatedWorld() + + https://bugs.webkit.org/show_bug.cgi?id=40079 + + * DumpRenderTree/qt/LayoutTestControllerQt.cpp: + (LayoutTestController::evaluateScriptInIsolatedWorld): + * DumpRenderTree/qt/LayoutTestControllerQt.h: + +2010-06-18 Dimitri Glazkov <dglazkov@chromium.org> + + Reviewed by Darin Adler. + + Add three more non-core Chromium builders to start testing DumpRenderTree. + https://bugs.webkit.org/show_bug.cgi?id=40335 + + * BuildSlaveSupport/build.webkit.org-config/config.json: Added 3 builders. + +2010-06-18 Drew Wilson <atwilson@chromium.org> + + Reviewed by Darin Fisher. + + [Chromium] Plumbing for top-level frame names + https://bugs.webkit.org/show_bug.cgi?id=40430 + + * DumpRenderTree/chromium/WebViewHost.cpp: + (WebViewHost::reset): + Changed obsolete call to clearName() to use setName(WebString()) instead. + +2010-06-18 Sam Weinig <weinig@apple.com> + + Rolling http://trac.webkit.org/changeset/61297 back in. + + * MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj: + * MiniBrowser/mac/WebBundle/WebBundleMain.c: Removed. + * MiniBrowser/mac/WebBundle/WebBundleMain.m: Added. + (_didClearWindow): + (_didCreatePage): + (WKBundleInitialize): + +2010-06-18 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=40803 + TestNetscapePlugin has an incorrect implementation of "property" property + + * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp: (pluginGetProperty): Don't + pass a static string back, it's going to be released by NPAPI implementation. + +2010-06-18 Leandro Pereira <leandro@profusion.mobi> + + Unreviewed. + + Adding myself to the committers list. + + * Scripts/webkitpy/common/config/committers.py: + +2010-06-17 Tony Chang <tony@chromium.org> + + Reviewed by Kent Tamura. + + [chromium] cleanup redundant DEPS value and remove buildbot cleanup code + https://bugs.webkit.org/show_bug.cgi?id=40615 + + * Scripts/update-webkit-chromium: remove directory removal of third_party in old checkouts + +2010-06-17 Ada Chan <adachan@apple.com> + + Rolling out http://trac.webkit.org/changeset/61297 due to build errors. + + * MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj: + * MiniBrowser/mac/WebBundle/WebBundleMain.c: Copied from MiniBrowser/mac/WebBundle/WebBundleMain.c. + * MiniBrowser/mac/WebBundle/WebBundleMain.m: Removed. + +2010-06-17 Darin Adler <darin@apple.com> + + One more try at fix for Chromium build. + + * DumpRenderTree/chromium/TestShell.cpp: + (TestShell::TestShell): Use set again instead of =. + +2010-06-17 Darin Adler <darin@apple.com> + + Fix Chromium build. + + I didn't realize that neither Chromium nor Qt share the DumpRenderTree + code with all the other platforms! Wow, that should be fixed at some point. + + * DumpRenderTree/chromium/TestShell.cpp: + (TestShell::TestShell): Changed back to using "new". + * DumpRenderTree/chromium/TestShell.h: Changed back to OwnPtr. + +2010-06-17 Simon Hausmann <simon.hausmann@nokia.com> + + Unreviewed Qt build fix. + + LayoutTestController in the Qt DRT is not using refs :) + + * DumpRenderTree/qt/DumpRenderTreeQt.cpp: + (WebCore::DumpRenderTree::DumpRenderTree): + +2010-06-17 Darin Adler <darin@apple.com> + + Reviewed by Sam Weinig. + + Use adoptRef and create functions in more code paths + https://bugs.webkit.org/show_bug.cgi?id=40760 + + * DumpRenderTree/DumpRenderTree.h: Change gLayoutTestController to a RefPtr. + + * DumpRenderTree/LayoutTestController.cpp: + (LayoutTestController::create): Added. + * DumpRenderTree/LayoutTestController.h: Declare the create function. + + * DumpRenderTree/chromium/TestShell.cpp: + (TestShell::TestShell): Use create instead of new. + * DumpRenderTree/chromium/TestShell.h: Use RefPtr instead of OwnPtr. + + * DumpRenderTree/gtk/DumpRenderTree.cpp: + (runTest): Use RefPtr and create instead of OwnPtr and new. + + * DumpRenderTree/mac/DumpRenderTree.mm: + (runTest): Use RefPtr and create instead of OwnPtr and new. + + * DumpRenderTree/qt/DumpRenderTreeQt.cpp: + (WebCore::DumpRenderTree::DumpRenderTree): Use create and releaseRef + instead of new. + + * DumpRenderTree/win/DumpRenderTree.cpp: + (runTest): Use RefPtr and create instead of OwnPtr and new. + + * DumpRenderTree/wx/DumpRenderTreeWx.cpp: + (runTest): Use RefPtr and create instead of OwnPtr and new. + (MyApp::OnInit): Removed unneeded code to delete the layout + test controller. This is done during each test. + +2010-06-17 Kent Tamura <tkent@chromium.org> + + Reviewed by Shinichiro Hamaji. + + [DRT/Chromium] Fix a bug of Windows pixel tests + https://bugs.webkit.org/show_bug.cgi?id=40763 + + * DumpRenderTree/chromium/TestEventPrinter.cpp: + (TestShellPrinter::handleImage): + +2010-06-16 Kent Tamura <tkent@chromium.org> + + Reviewed by Shinichiro Hamaji. + + [DRT/Chromium] Fix crash on Mac Release + https://bugs.webkit.org/show_bug.cgi?id=40759 + + * DumpRenderTree/chromium/WebViewHost.cpp: + (WebViewHost::paintRect): We should not use m_canvas directly because + it is created lazily in canvas(). + +2010-06-16 Kevin Ollivier <kevino@theolliviers.com> + + [wx] Build fix after new method addition. + + * DumpRenderTree/wx/LayoutTestControllerWx.cpp: + (LayoutTestController::pageProperty): + +2010-06-16 Kent Tamura <tkent@chromium.org> + + Reviewed by Dimitri Glazkov. + + [DRT/Chromium] Set current working directory for each of tests + https://bugs.webkit.org/show_bug.cgi?id=40668 + + This change fixes tests with eventSender.beginDragWithFiles(). + + * DumpRenderTree/chromium/DumpRenderTree.cpp: + (runTest): + +2010-06-16 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Gustavo Noronha Silva. + + [GTK] r60803 broke media/controls-drag-timebar.html + https://bugs.webkit.org/show_bug.cgi?id=40269 + + Only queue events while the mouse button is down, if drag mode is enabled. Some + tests may disable drag mode, to prevent the queuing of events in this situation. + + * DumpRenderTree/gtk/EventSender.cpp: + (sendOrQueueEvent): Only queue events here if dragMode is true. + +2010-06-16 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Gustavo Noronha Silva. + + [GTK] Remove the abuse of GDK_CURRENT_TIME in the DRT + https://bugs.webkit.org/show_bug.cgi?id=40600 + + * DumpRenderTree/gtk/EventSender.cpp: + (prepareMouseButtonEvent): Remove logic adding an offset to GDK_CURRENT_TIME. + +2010-06-16 Adam Barth <abarth@webkit.org> + + Reviewed by Dimitri Glazkov. + + Add a hidden land-cowboy command to webkit-patch to help land quick + build fixes. + + * Scripts/webkitpy/tool/commands/download.py: + * Scripts/webkitpy/tool/steps/preparechangelog.py: + +2010-06-16 Adam Roben <aroben@apple.com> + + Convert console messages to UTF-8 before printing them + + Speculative fix for <http://webkit.org/b/40731> REGRESSION (r61234): + http/tests/security/xssAuditor/embed-tag-null-char.html and + http/tests/security/xssAuditor/object-embed-tag-null-char.html fail on + Windows. (I can't test the fix because Apache is crashing on my + computer.) + + Reviewed by Alexey Proskuryakov. + + * DumpRenderTree/win/DumpRenderTree.cpp: + (toUTF8): Extracted the code into an overload that takes a wide string + and a length, then added an overload that takes a wstring. + + * DumpRenderTree/win/DumpRenderTreeWin.h: Declare the new toUTF8 + overload. + + * DumpRenderTree/win/UIDelegate.cpp: + (UIDelegate::webViewAddMessageToConsole): Use toUTF8 to convert to + UTF-8 instead of letting printf convert to the current code page. + +2010-06-16 Drew Wilson <atwilson@chromium.org> + + Reviewed by Kent Tamura. + + [Chromium] Plumbing for top-level frame names + https://bugs.webkit.org/show_bug.cgi?id=40430 + + * DumpRenderTree/chromium/WebViewHost.cpp: + (WebViewHost::createView): + Migrate to new createView() API. + * DumpRenderTree/chromium/WebViewHost.h: + Remove obsolete createView() methods, add new createView() API that takes a frameName parameter. + +2010-06-16 Diego Gonzalez <diegohcg@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Scroll wheel event support to graphics based DRT + https://bugs.webkit.org/show_bug.cgi?id=40577 + + * DumpRenderTree/qt/EventSenderQt.cpp: + (EventSender::continuousMouseScrollBy): + (EventSender::createGraphicsSceneWheelEvent): + * DumpRenderTree/qt/EventSenderQt.h: + +2010-06-16 Adam Roben <aroben@apple.com> + + Remove a stray newline from the Windows version of TestNetscapePlugin + + Reviewed by Alexey Proskuryakov. + + Fixes <http://webkit.org/b/40728> + plugins/geturlnotify-during-document-teardown.html fails on Windows + + * DumpRenderTree/win/TestNetscapePlugin/main.cpp: + (NPP_Destroy): Removed extra newline that the Mac version doesn't + have. + +2010-06-16 Adam Roben <aroben@apple.com> + + Respect LayoutTestController::isPrinting on Windows + + This gets some printing tests closer to passing (like + printing/page-rule-in-media-query.html). + + Fixes <http://webkit.org/b/40727>. + + Reviewed by Dan Bernstein. + + * DumpRenderTree/win/DumpRenderTree.cpp: + (dump): Pass LayoutTestController::isPrinting to + IWebFramePrivate::renderTreeAsExternalRepresentation. + +2010-06-15 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Enable HTML5 lexer + https://bugs.webkit.org/show_bug.cgi?id=40650 + + * DumpRenderTree/mac/DumpRenderTree.mm: + (initializeGlobalsFromCommandLineOptions): + +2010-06-10 Yuzo Fujishima <yuzo@google.com> + + Reviewed by Shinichiro Hamaji. + + Implement render style selection for pages to support CSS3 Paged Media. + https://bugs.webkit.org/show_bug.cgi?id=35961 + + * DumpRenderTree/LayoutTestController.cpp: + (parsePagePropertyParameters): + (pagePropertyCallback): + (LayoutTestController::staticFunctions): + * DumpRenderTree/LayoutTestController.h: + * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: + (LayoutTestController::pageProperty): + * DumpRenderTree/mac/LayoutTestControllerMac.mm: + (LayoutTestController::pageProperty): + * DumpRenderTree/win/LayoutTestControllerWin.cpp: + (LayoutTestController::pageProperty): + +2010-06-15 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + Fix for https://bugs.webkit.org/show_bug.cgi?id=40630 + WebKit2: Add mechanism to inject code into the WebProcess on startup + + Add initial InjectedBundle support. + + * MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj: + * MiniBrowser/WebBundle-Info.plist: Added. + Add test InjectedBundle to the project. + + * MiniBrowser/mac/AppDelegate.m: + (-[BrowserAppDelegate init]): + Get the path to the WebBundle from the the main bundle and pass it to the new + WKContextCreateWithInjectedBundlePath function. + + * MiniBrowser/mac/BrowserWindowController.m: + (_didChangeProgress): + Fix the build. This has been broken for a while. + + * MiniBrowser/mac/WebBundle: Added. + * MiniBrowser/mac/WebBundle/WebBundleMain.c: Added. + (_didCreatePage): + (WKBundleInitialize): + Add really basic InjectedBundle. + + * MiniBrowser/win/BrowserView.cpp: + (BrowserView::create): + Switch from WKContextCreateWithProcessModel to WKContextCreate and remove commented out code. + +2010-06-15 Dumitru Daniliuc <dumi@chromium.org> + + Reviewed by Darin Adler. + + Adding myself to the reviewers list. + https://bugs.webkit.org/show_bug.cgi?id=40693 + + * Scripts/webkitpy/common/config/committers.py: + +2010-06-15 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Xan Lopez. + + Switch to using GIO methods instead of realpath in GtkLauncher to determine + the file URI. This should remove warnings about realpath being undefined + when compiling with '-ansi'. + + * GtkLauncher/main.c: + (filenameToURL): Use GIO instead of realpath to determine file URI. + +2010-06-15 Adam Roben <aroben@apple.com> + + Remove the redundant set-apple-windows-environment-variables script + + Apparently update-webkit does this for you these days. + + Rubber-stamped by Steve Falkenburg. + + * Scripts/set-apple-windows-environment-variables: Removed. + +2010-06-14 Adam Roben <aroben@apple.com> + + Add a script to set the WebKitOutputDir and WebKitLibrariesDir + environment variables + + Fixes <http://webkit.org/b/40595>. + + Reviewed by Steve Falkenburg. + + * Scripts/set-apple-windows-environment-variables: Added. + (to_windows_path): Passes the passed-in path through cygpath to + generate a Windows-style path. + (main): Sets the WebKitOutputDir and WebKitLibrariesDir environment + variables to their defaults, if they aren't already set. + +2010-06-14 Adam Roben <aroben@apple.com> + + Speed up run-safari/debug-safari on Windows + + Fixes <http://webkit.org/b/40586>. + + Reviewed by Steve Falkenburg. + + * Scripts/webkitdirs.pm: + (runSafari): When debugging, set up the environment to run Safari + using the built WebKit.dll, then use "devenv /debugexe Safari.exe" to + actually launch the debugger. When not debugging, just run WebKit.exe + and it will do the rest for us. + +2010-06-15 Diego Gonzalez <diegohcg@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] DRT EventSender support to graphics context events + https://bugs.webkit.org/show_bug.cgi?id=40324 + + * DumpRenderTree/qt/EventSenderQt.cpp: + (EventSender::contextClick): + +2010-06-14 Tony Chang <tony@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] checkout chromium third_party directly + https://bugs.webkit.org/show_bug.cgi?id=40556 + + * Scripts/update-webkit-chromium: some migration code for the bots + +2010-06-14 Alexey Proskuryakov <ap@apple.com> + + Chromium build fix. + + * DumpRenderTree/chromium/EventSender.cpp: (EventSender::keyDown): Chromium uses differently + named constants for Windows virtual key codes, replacing VK_DELETE with VKEY_DELETE. + +2010-06-14 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=40529 + eventSender.keyDown("delete") incorrectly sends a backspace on some platforms + + * DumpRenderTree/mac/EventSendingController.mm: + (-[EventSendingController keyDown:withModifiers:withLocation:]): We were sending a broken + event for "delete" - it had virtual key code from forward delete, and text from backspace. + Fixed "delete" to mean forward delete. + + * DumpRenderTree/chromium/EventSender.cpp: (EventSender::keyDown): + * DumpRenderTree/gtk/EventSender.cpp: (keyDownCallback): + * DumpRenderTree/win/EventSender.cpp: (keyDownCallback): + Mac DRT confusion has propagated to other platforms, fixing those. + +2010-06-14 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Xan Lopez. + + Small GtkLauncher build fix for some systems. + + * GtkLauncher/main.c: Add <limit.h> include. + 2010-06-14 Mahesh Kulkarni <mahesh.kulkarni@nokia.com> Reviewed by Laszlo Gombos. diff --git a/WebKitTools/DumpRenderTree/DumpRenderTree.h b/WebKitTools/DumpRenderTree/DumpRenderTree.h index 8366e89..7a862f7 100644 --- a/WebKitTools/DumpRenderTree/DumpRenderTree.h +++ b/WebKitTools/DumpRenderTree/DumpRenderTree.h @@ -45,6 +45,7 @@ #endif #include <string> +#include <wtf/RefPtr.h> #if !OS(OPENBSD) std::wstring urlSuitableForTestResult(const std::wstring& url); @@ -55,7 +56,7 @@ class LayoutTestController; extern volatile bool done; // FIXME: This is a bad abstraction. We should insted pass this to other controller objects which need access to it. -extern LayoutTestController* gLayoutTestController; +extern RefPtr<LayoutTestController> gLayoutTestController; void dump(); void displayWebView(); diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/LayoutTestController.cpp index b96a9c9..02c77a4 100644 --- a/WebKitTools/DumpRenderTree/LayoutTestController.cpp +++ b/WebKitTools/DumpRenderTree/LayoutTestController.cpp @@ -83,6 +83,11 @@ LayoutTestController::LayoutTestController(const std::string& testPathOrURL, con { } +PassRefPtr<LayoutTestController> LayoutTestController::create(const std::string& testPathOrURL, const std::string& expectedPixelHash) +{ + return adoptRef(new LayoutTestController(testPathOrURL, expectedPixelHash)); +} + // Static Functions static JSValueRef dumpAsPDFCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) @@ -521,6 +526,41 @@ static bool parsePageParameters(JSContextRef context, int argumentCount, const J return true; } +// Caller needs to delete[] propertyName. +static bool parsePagePropertyParameters(JSContextRef context, int argumentCount, const JSValueRef* arguments, JSValueRef* exception, char*& propertyName, int& pageNumber) +{ + pageNumber = 0; + switch (argumentCount) { + case 2: + pageNumber = static_cast<float>(JSValueToNumber(context, arguments[1], exception)); + if (*exception) + return false; + // Fall through. + case 1: { + JSRetainPtr<JSStringRef> propertyNameString(Adopt, JSValueToStringCopy(context, arguments[0], exception)); + if (*exception) + return false; + + size_t maxLength = JSStringGetMaximumUTF8CStringSize(propertyNameString.get()); + propertyName = new char[maxLength + 1]; + JSStringGetUTF8CString(propertyNameString.get(), propertyName, maxLength + 1); + return true; + } + case 0: + default: + return false; + } +} + +static bool parsePageNumber(JSContextRef context, int argumentCount, const JSValueRef* arguments, JSValueRef* exception, int& pageNumber) +{ + pageNumber = 0; + if (argumentCount != 1) + return false; + pageNumber = static_cast<int>(JSValueToNumber(context, arguments[0], exception)); + return !*exception; +} + static JSValueRef pageNumberForElementByIdCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { float pageWidthInPixels = 0; @@ -548,6 +588,50 @@ static JSValueRef numberOfPagesCallback(JSContextRef context, JSObjectRef functi return JSValueMakeNumber(context, controller->numberOfPages(pageWidthInPixels, pageHeightInPixels)); } +static JSValueRef pagePropertyCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + char* propertyName = 0; + int pageNumber = 0; + if (!parsePagePropertyParameters(context, argumentCount, arguments, exception, propertyName, pageNumber)) + return JSValueMakeUndefined(context); + + LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + JSValueRef value = JSValueMakeString(context, controller->pageProperty(propertyName, pageNumber).get()); + + delete[] propertyName; + return value; +} + +static JSValueRef isPageBoxVisibleCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + int pageNumber = 0; + if (!parsePageNumber(context, argumentCount, arguments, exception, pageNumber)) + return JSValueMakeUndefined(context); + + LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + return JSValueMakeBoolean(context, controller->isPageBoxVisible(pageNumber)); +} + +static JSValueRef pageAreaRectInPixelsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + int pageNumber = 0; + if (!parsePageNumber(context, argumentCount, arguments, exception, pageNumber)) + return JSValueMakeUndefined(context); + + LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + return JSValueMakeString(context, controller->pageAreaRectInPixels(pageNumber).get()); +} + +static JSValueRef preferredPageSizeInPixelsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + int pageNumber = 0; + if (!parsePageNumber(context, argumentCount, arguments, exception, pageNumber)) + return JSValueMakeUndefined(context); + + LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + return JSValueMakeString(context, controller->preferredPageSizeInPixels(pageNumber).get()); +} + static JSValueRef queueBackNavigationCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { // Has mac & windows implementation @@ -1428,6 +1512,16 @@ static JSValueRef setWebViewEditableCallback(JSContextRef context, JSObjectRef f return JSValueMakeUndefined(context); } + +#if PLATFORM(MAC) +static JSValueRef abortModalCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + controller->abortModal(); + return JSValueMakeUndefined(context); +} +#endif + static JSValueRef markerTextForListItemCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); @@ -1554,6 +1648,9 @@ JSStaticValue* LayoutTestController::staticValues() JSStaticFunction* LayoutTestController::staticFunctions() { static JSStaticFunction staticFunctions[] = { +#if PLATFORM(MAC) + { "abortModal", abortModalCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, +#endif { "addDisallowedURL", addDisallowedURLCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "addUserScript", addUserScriptCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "addUserStyleSheet", addUserStyleSheetCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, @@ -1593,6 +1690,7 @@ JSStaticFunction* LayoutTestController::staticFunctions() { "counterValueForElementById", counterValueForElementByIdCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "grantDesktopNotificationPermission", grantDesktopNotificationPermissionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "isCommandEnabled", isCommandEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "isPageBoxVisible", isPageBoxVisibleCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "keepWebHistory", keepWebHistoryCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "layerTreeAsText", layerTreeAsTextCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "numberOfPages", numberOfPagesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, @@ -1601,9 +1699,12 @@ JSStaticFunction* LayoutTestController::staticFunctions() { "numberOfActiveAnimations", numberOfActiveAnimationsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "overridePreference", overridePreferenceCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "pageNumberForElementById", pageNumberForElementByIdCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "pageAreaRectInPixels", pageAreaRectInPixelsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "pageProperty", pagePropertyCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "pathToLocalResource", pathToLocalResourceCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "pauseAnimationAtTimeOnElementWithId", pauseAnimationAtTimeOnElementWithIdCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "pauseTransitionAtTimeOnElementWithId", pauseTransitionAtTimeOnElementWithIdCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "preferredPageSizeInPixels", preferredPageSizeInPixelsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "sampleSVGAnimationForElementAtTime", sampleSVGAnimationForElementAtTimeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "printToPDF", dumpAsPDFCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "queueBackNavigation", queueBackNavigationCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.h b/WebKitTools/DumpRenderTree/LayoutTestController.h index 8ff38d1..6af2c57 100644 --- a/WebKitTools/DumpRenderTree/LayoutTestController.h +++ b/WebKitTools/DumpRenderTree/LayoutTestController.h @@ -34,11 +34,12 @@ #include <set> #include <string> #include <vector> +#include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> class LayoutTestController : public RefCounted<LayoutTestController> { public: - LayoutTestController(const std::string& testPathOrURL, const std::string& expectedPixelHash); + static PassRefPtr<LayoutTestController> create(const std::string& testPathOrURL, const std::string& expectedPixelHash); ~LayoutTestController(); void makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception); @@ -62,6 +63,10 @@ public: int numberOfPages(float pageWidthInPixels, float pageHeightInPixels); void overridePreference(JSStringRef key, JSStringRef value); int pageNumberForElementById(JSStringRef id, float pageWidthInPixels, float pageHeightInPixels); + JSRetainPtr<JSStringRef> pageProperty(const char* propertyName, int pageNumber) const; + bool isPageBoxVisible(int pageNumber) const; + JSRetainPtr<JSStringRef> pageAreaRectInPixels(int pageNumber) const; + JSRetainPtr<JSStringRef> preferredPageSizeInPixels(int pageNumber) const; JSStringRef pathToLocalResource(JSContextRef, JSStringRef url); void queueBackNavigation(int howFarBackward); void queueForwardNavigation(int howFarForward); @@ -255,6 +260,11 @@ public: void setWebViewEditable(bool); + +#if PLATFORM(MAC) + void abortModal(); +#endif + // The following API test functions should probably be moved to platform-specific // unit tests outside of DRT once they exist. void apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL); @@ -271,6 +281,8 @@ public: static const unsigned maxViewHeight; private: + LayoutTestController(const std::string& testPathOrURL, const std::string& expectedPixelHash); + bool m_dumpAsPDF; bool m_dumpAsText; bool m_dumpBackForwardList; diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp index 60103a5..477ca17 100644 --- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp +++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp @@ -260,7 +260,10 @@ static bool pluginGetProperty(NPObject* obj, NPIdentifier name, NPVariant* resul { PluginObject* plugin = reinterpret_cast<PluginObject*>(obj); if (name == pluginPropertyIdentifiers[ID_PROPERTY_PROPERTY]) { - STRINGZ_TO_NPVARIANT("property", *result); + static const char* originalString = "property"; + char* buf = static_cast<char*>(browser->memalloc(strlen(originalString) + 1)); + strcpy(buf, originalString); + STRINGZ_TO_NPVARIANT(buf, *result); return true; } else if (name == pluginPropertyIdentifiers[ID_PROPERTY_EVENT_LOGGING]) { BOOLEAN_TO_NPVARIANT(plugin->eventLogging, *result); diff --git a/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp index b0cff82..7194279 100644 --- a/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp +++ b/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp @@ -47,6 +47,7 @@ static const char optionTree[] = "--tree"; static const char optionPixelTestsWithName[] = "--pixel-tests="; static const char optionTestShell[] = "--test-shell"; +static const char optionAllowExternalPages[] = "--allow-external-pages"; static void runTest(TestShell& shell, TestParams& params, const string& testName, bool testShellMode) { @@ -74,6 +75,7 @@ static void runTest(TestShell& shell, TestParams& params, const string& testName } } params.testUrl = webkit_support::CreateURLForPathOrURL(pathOrURL); + webkit_support::SetCurrentDirectoryForFileURL(params.testUrl); shell.resetTestController(); shell.runFileTest(params); shell.setLayoutTestTimeout(oldTimeoutMsec); @@ -88,6 +90,7 @@ int main(int argc, char* argv[]) Vector<string> tests; bool serverMode = false; bool testShellMode = false; + bool allowExternalPages = false; for (int i = 1; i < argc; ++i) { string argument(argv[i]); if (argument == "-") @@ -102,7 +105,9 @@ int main(int argc, char* argv[]) } else if (argument == optionTestShell) { testShellMode = true; serverMode = true; - } else if (argument.size() && argument[0] == '-') + } else if (argument == optionAllowExternalPages) + allowExternalPages = true; + else if (argument.size() && argument[0] == '-') fprintf(stderr, "Unknown option: %s\n", argv[i]); else tests.append(argument); @@ -114,6 +119,7 @@ int main(int argc, char* argv[]) { // Explicit scope for the TestShell instance. TestShell shell(testShellMode); + shell.setAllowExternalPages(allowExternalPages); if (serverMode && !tests.size()) { params.printSeparators = true; char testString[2048]; // 2048 is the same as the sizes of other platforms. diff --git a/WebKitTools/DumpRenderTree/chromium/EventSender.cpp b/WebKitTools/DumpRenderTree/chromium/EventSender.cpp index 7695095..fd7ba2d 100644 --- a/WebKitTools/DumpRenderTree/chromium/EventSender.cpp +++ b/WebKitTools/DumpRenderTree/chromium/EventSender.cpp @@ -542,7 +542,7 @@ void EventSender::keyDown(const CppArgumentList& arguments, CppVariant* result) else if ("upArrow" == codeStr) code = base::VKEY_UP; else if ("delete" == codeStr) - code = base::VKEY_BACK; + code = base::VKEY_DELETE; else if ("pageUp" == codeStr) code = base::VKEY_PRIOR; else if ("pageDown" == codeStr) diff --git a/WebKitTools/DumpRenderTree/chromium/TestEventPrinter.cpp b/WebKitTools/DumpRenderTree/chromium/TestEventPrinter.cpp index 929656d..d9e79a0 100644 --- a/WebKitTools/DumpRenderTree/chromium/TestEventPrinter.cpp +++ b/WebKitTools/DumpRenderTree/chromium/TestEventPrinter.cpp @@ -142,7 +142,7 @@ void TestShellPrinter::handleImage(const char* actualHash, const char*, const un if (imageData && imageSize) { ASSERT(fileName); FILE* fp = fopen(fileName, "wb"); - if (fp) { + if (!fp) { perror(fileName); exit(EXIT_FAILURE); } diff --git a/WebKitTools/DumpRenderTree/chromium/TestShell.cpp b/WebKitTools/DumpRenderTree/chromium/TestShell.cpp index 761f8d1..610248a 100644 --- a/WebKitTools/DumpRenderTree/chromium/TestShell.cpp +++ b/WebKitTools/DumpRenderTree/chromium/TestShell.cpp @@ -80,6 +80,7 @@ TestShell::TestShell(bool testShellMode) , m_testIsPreparing(false) , m_focusedWidget(0) , m_testShellMode(testShellMode) + , m_allowExternalPages(false) { WebRuntimeFeatures::enableGeolocation(true); m_accessibilityController.set(new AccessibilityController(this)); @@ -200,6 +201,11 @@ void TestShell::runFileTest(const TestParams& params) bool inspectorTestMode = testUrl.find("/inspector/") != string::npos || testUrl.find("\\inspector\\") != string::npos; m_webView->settings()->setDeveloperExtrasEnabled(inspectorTestMode); + + if (testUrl.find("loading/") != string::npos + || testUrl.find("loading\\") != string::npos) + m_layoutTestController->setShouldDumpFrameLoadCallbacks(true); + m_printer->handleTestHeader(testUrl.c_str()); loadURL(m_params.testUrl); diff --git a/WebKitTools/DumpRenderTree/chromium/TestShell.h b/WebKitTools/DumpRenderTree/chromium/TestShell.h index 2b99b3d..2397246 100644 --- a/WebKitTools/DumpRenderTree/chromium/TestShell.h +++ b/WebKitTools/DumpRenderTree/chromium/TestShell.h @@ -107,6 +107,9 @@ public: // the test results. void testTimedOut(); + bool allowExternalPages() const { return m_allowExternalPages; } + void setAllowExternalPages(bool allowExternalPages) { m_allowExternalPages = allowExternalPages; } + #if defined(OS_WIN) // Access to the finished event. Used by the static WatchDog thread. HANDLE finishedEvent() { return m_finishedEvent; } @@ -140,15 +143,16 @@ private: WebKit::WebWidget* m_focusedWidget; bool m_testShellMode; WebViewHost* m_webViewHost; - OwnPtr<AccessibilityController*> m_accessibilityController; - OwnPtr<EventSender*> m_eventSender; - OwnPtr<LayoutTestController*> m_layoutTestController; - OwnPtr<PlainTextController*> m_plainTextController; - OwnPtr<TextInputController*> m_textInputController; - OwnPtr<NotificationPresenter*> m_notificationPresenter; - OwnPtr<TestEventPrinter*> m_printer; + OwnPtr<AccessibilityController> m_accessibilityController; + OwnPtr<EventSender> m_eventSender; + OwnPtr<LayoutTestController> m_layoutTestController; + OwnPtr<PlainTextController> m_plainTextController; + OwnPtr<TextInputController> m_textInputController; + OwnPtr<NotificationPresenter> m_notificationPresenter; + OwnPtr<TestEventPrinter> m_printer; TestParams m_params; int m_timeout; // timeout value in millisecond + bool m_allowExternalPages; // List of all windows in this process. // The main window should be put into windowList[0]. diff --git a/WebKitTools/DumpRenderTree/chromium/WebThemeControlDRT.h b/WebKitTools/DumpRenderTree/chromium/WebThemeControlDRT.h index 1f73610..1f73610 100755..100644 --- a/WebKitTools/DumpRenderTree/chromium/WebThemeControlDRT.h +++ b/WebKitTools/DumpRenderTree/chromium/WebThemeControlDRT.h diff --git a/WebKitTools/DumpRenderTree/chromium/WebThemeEngineDRT.h b/WebKitTools/DumpRenderTree/chromium/WebThemeEngineDRT.h index 89805b1..89805b1 100755..100644 --- a/WebKitTools/DumpRenderTree/chromium/WebThemeEngineDRT.h +++ b/WebKitTools/DumpRenderTree/chromium/WebThemeEngineDRT.h diff --git a/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp b/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp index d3aadc8..ef821ce 100644 --- a/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp +++ b/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp @@ -253,12 +253,7 @@ static string textAffinityDescription(WebTextAffinity affinity) // WebViewClient ------------------------------------------------------------- -WebView* WebViewHost::createView(WebFrame* creator) -{ - return createView(creator, WebWindowFeatures()); -} - -WebView* WebViewHost::createView(WebFrame*, const WebWindowFeatures&) +WebView* WebViewHost::createView(WebFrame*, const WebWindowFeatures&, const WebString&) { if (!layoutTestController()->canOpenWindows()) return 0; @@ -923,7 +918,8 @@ void WebViewHost::willSendRequest(WebFrame*, unsigned identifier, WebURLRequest& if (!host.empty() && (url.SchemeIs("http") || url.SchemeIs("https")) && host != "127.0.0.1" && host != "255.255.255.255" - && host != "localhost") { + && host != "localhost" + && !m_shell->allowExternalPages()) { printf("Blocked access to external URL %s\n", requestURL.c_str()); // To block the request, we set its URL to an empty one. @@ -1036,7 +1032,7 @@ void WebViewHost::reset() this->~WebViewHost(); new (this) WebViewHost(shell); setWebWidget(widget); - webView()->mainFrame()->clearName(); + webView()->mainFrame()->setName(WebString()); } void WebViewHost::setSelectTrailingWhitespaceEnabled(bool enabled) @@ -1284,7 +1280,7 @@ void WebViewHost::paintRect(const WebRect& rect) ASSERT(canvas()); m_isPainting = true; #if PLATFORM(CG) - webWidget()->paint(m_canvas->getTopPlatformDevice().GetBitmapContext(), rect); + webWidget()->paint(canvas()->getTopPlatformDevice().GetBitmapContext(), rect); #else webWidget()->paint(canvas(), rect); #endif diff --git a/WebKitTools/DumpRenderTree/chromium/WebViewHost.h b/WebKitTools/DumpRenderTree/chromium/WebViewHost.h index 8fb9d04..1e51be7 100644 --- a/WebKitTools/DumpRenderTree/chromium/WebViewHost.h +++ b/WebKitTools/DumpRenderTree/chromium/WebViewHost.h @@ -90,8 +90,7 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient, virtual bool navigate(const TestNavigationEntry&, bool reload); // WebKit::WebViewClient - virtual WebKit::WebView* createView(WebKit::WebFrame*); - virtual WebKit::WebView* createView(WebKit::WebFrame*, const WebKit::WebWindowFeatures&); + virtual WebKit::WebView* createView(WebKit::WebFrame*, const WebKit::WebWindowFeatures&, const WebKit::WebString&); virtual WebKit::WebWidget* createPopupMenu(WebKit::WebPopupType); virtual WebKit::WebWidget* createPopupMenu(const WebKit::WebPopupMenuInfo&); virtual WebKit::WebStorageNamespace* createSessionStorageNamespace(unsigned quota); diff --git a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp index 14577f1..d79addf 100644 --- a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp +++ b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp @@ -2,6 +2,7 @@ * Copyright (C) 2007 Eric Seidel <eric@webkit.org> * Copyright (C) 2008 Alp Toker <alp@nuanti.com> * Copyright (C) 2009 Jan Alonzo <jmalonzo@gmail.com> + * Copyright (C) 2010 Igalia S.L. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -77,7 +78,7 @@ static int dumpPixels; static int dumpTree = 1; AccessibilityController* axController = 0; -LayoutTestController* gLayoutTestController = 0; +RefPtr<LayoutTestController> gLayoutTestController; static GCController* gcController = 0; static WebKitWebView* webView; static GtkWidget* window; @@ -96,30 +97,19 @@ static WebKitWebHistoryItem* prevTestBFItem = NULL; const unsigned historyItemIndent = 8; -static gchar* autocorrectURL(const gchar* url) +static bool shouldLogFrameLoadDelegates(const string& pathOrURL) { - if (strncmp("http://", url, 7) != 0 && strncmp("https://", url, 8) != 0) { - GString* string = g_string_new("file://"); - g_string_append(string, url); - return g_string_free(string, FALSE); - } - - return g_strdup(url); -} - -static bool shouldLogFrameLoadDelegates(const char* pathOrURL) -{ - return strstr(pathOrURL, "loading/"); + return pathOrURL.find("loading/") != string::npos; } -static bool shouldOpenWebInspector(const char* pathOrURL) +static bool shouldOpenWebInspector(const string& pathOrURL) { - return strstr(pathOrURL, "inspector/"); + return pathOrURL.find("inspector/") != string::npos; } -static bool shouldEnableDeveloperExtras(const char* pathOrURL) +static bool shouldEnableDeveloperExtras(const string& pathOrURL) { - return shouldOpenWebInspector(pathOrURL) || strstr(pathOrURL, "inspector-enabled/"); + return shouldOpenWebInspector(pathOrURL) || pathOrURL.find("inspector-enabled/") != string::npos; } void dumpFrameScrollPosition(WebKitWebFrame* frame) @@ -474,39 +464,45 @@ static void runTest(const string& testPathOrURL) ASSERT(!testPathOrURL.empty()); // Look for "'" as a separator between the path or URL, and the pixel dump hash that follows. - string pathOrURL(testPathOrURL); + string testURL(testPathOrURL); string expectedPixelHash; - - size_t separatorPos = pathOrURL.find("'"); + size_t separatorPos = testURL.find("'"); if (separatorPos != string::npos) { - pathOrURL = string(testPathOrURL, 0, separatorPos); + testURL = string(testPathOrURL, 0, separatorPos); expectedPixelHash = string(testPathOrURL, separatorPos + 1); } - gchar* url = autocorrectURL(pathOrURL.c_str()); - const string testURL(url); + // Convert the path into a full file URL if it does not look + // like an HTTP/S URL (doesn't start with http:// or https://). + if (testURL.find("http://") && testURL.find("https://")) { + GFile* testFile = g_file_new_for_path(testURL.c_str()); + gchar* testURLCString = g_file_get_uri(testFile); + testURL = testURLCString; + g_free(testURLCString); + g_object_unref(testFile); + } resetDefaultsToConsistentValues(); - gLayoutTestController = new LayoutTestController(testURL, expectedPixelHash); + gLayoutTestController = LayoutTestController::create(testURL, expectedPixelHash); topLoadingFrame = 0; done = false; gLayoutTestController->setIconDatabaseEnabled(false); - if (shouldLogFrameLoadDelegates(pathOrURL.c_str())) + if (shouldLogFrameLoadDelegates(testURL)) gLayoutTestController->setDumpFrameLoadCallbacks(true); - if (shouldEnableDeveloperExtras(pathOrURL.c_str())) { + if (shouldEnableDeveloperExtras(testURL)) { gLayoutTestController->setDeveloperExtrasEnabled(true); - if (shouldOpenWebInspector(pathOrURL.c_str())) + if (shouldOpenWebInspector(testURL)) gLayoutTestController->showWebInspector(); } WorkQueue::shared()->clear(); WorkQueue::shared()->setFrozen(false); - bool isSVGW3CTest = (gLayoutTestController->testPathOrURL().find("svg/W3C-SVG-1.1") != string::npos); + bool isSVGW3CTest = (testURL.find("svg/W3C-SVG-1.1") != string::npos); GtkAllocation size; size.x = size.y = 0; size.width = isSVGW3CTest ? 480 : LayoutTestController::maxViewWidth; @@ -527,15 +523,12 @@ static void runTest(const string& testPathOrURL) // Focus the web view before loading the test to avoid focusing problems gtk_widget_grab_focus(GTK_WIDGET(webView)); - webkit_web_view_open(webView, url); - - g_free(url); - url = NULL; + webkit_web_view_open(webView, testURL.c_str()); gtk_main(); // If developer extras enabled Web Inspector may have been open by the test. - if (shouldEnableDeveloperExtras(pathOrURL.c_str())) { + if (shouldEnableDeveloperExtras(testURL)) { gLayoutTestController->closeWebInspector(); gLayoutTestController->setDeveloperExtrasEnabled(false); } @@ -553,8 +546,7 @@ static void runTest(const string& testPathOrURL) // A blank load seems to be necessary to reset state after certain tests. webkit_web_view_open(webView, "about:blank"); - gLayoutTestController->deref(); - gLayoutTestController = 0; + gLayoutTestController.clear(); // terminate the (possibly empty) pixels block after all the state reset sendPixelResultsEOF(); diff --git a/WebKitTools/DumpRenderTree/gtk/EventSender.cpp b/WebKitTools/DumpRenderTree/gtk/EventSender.cpp index 0ef4a42..7836ff0 100644 --- a/WebKitTools/DumpRenderTree/gtk/EventSender.cpp +++ b/WebKitTools/DumpRenderTree/gtk/EventSender.cpp @@ -87,6 +87,15 @@ static void sendOrQueueEvent(GdkEvent, bool = true); static void dispatchEvent(GdkEvent event); static guint getStateFlags(); +#if !GTK_CHECK_VERSION(2, 17, 3) +static void gdk_window_get_root_coords(GdkWindow* window, gint x, gint y, gint* rootX, gint* rootY) +{ + gdk_window_get_root_origin(window, rootX, rootY); + *rootX = *rootX + x; + *rootY = *rootY + y; +} +#endif + static JSValueRef getDragModeCallback(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) { return JSValueMakeBoolean(context, dragMode); @@ -109,21 +118,6 @@ static JSValueRef leapForwardCallback(JSContextRef context, JSObjectRef function return JSValueMakeUndefined(context); } -#if !GTK_CHECK_VERSION(2,17,3) -static void getRootCoords(GtkWidget* view, int* rootX, int* rootY) -{ - GtkWidget* window = gtk_widget_get_toplevel(GTK_WIDGET(view)); - int tmpX, tmpY; - - gtk_widget_translate_coordinates(view, window, lastMousePositionX, lastMousePositionY, &tmpX, &tmpY); - - gdk_window_get_origin(window->window, rootX, rootY); - - *rootX += tmpX; - *rootY += tmpY; -} -#endif - bool prepareMouseButtonEvent(GdkEvent* event, int eventSenderButtonNumber) { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); @@ -148,19 +142,10 @@ bool prepareMouseButtonEvent(GdkEvent* event, int eventSenderButtonNumber) event->button.window = GTK_WIDGET(view)->window; event->button.device = gdk_device_get_core_pointer(); event->button.state = getStateFlags(); - - // Mouse up & down events dispatched via g_signal_emit_by_name must offset - // their time value, so that WebKit can detect where sequences of mouse - // clicks begin and end. This should not interfere with GDK or GTK+ event - // processing, because the event is only seen by the widget. - event->button.time = GDK_CURRENT_TIME + timeOffset; + event->button.time = GDK_CURRENT_TIME; int xRoot, yRoot; -#if GTK_CHECK_VERSION(2, 17, 3) gdk_window_get_root_coords(GTK_WIDGET(view)->window, lastMousePositionX, lastMousePositionY, &xRoot, &yRoot); -#else - getRootCoords(GTK_WIDGET(view), &xRoot, &yRoot); -#endif event->button.x_root = xRoot; event->button.y_root = yRoot; @@ -286,11 +271,7 @@ static JSValueRef mouseMoveToCallback(JSContextRef context, JSObjectRef function event.motion.state = getStateFlags(); int xRoot, yRoot; -#if GTK_CHECK_VERSION(2,17,3) gdk_window_get_root_coords(GTK_WIDGET(view)->window, lastMousePositionX, lastMousePositionY, &xRoot, &yRoot); -#else - getRootCoords(GTK_WIDGET(view), &xRoot, &yRoot); -#endif event.motion.x_root = xRoot; event.motion.y_root = yRoot; @@ -350,7 +331,7 @@ static void sendOrQueueEvent(GdkEvent event, bool shouldReplaySavedEvents) { // Mouse move events are queued if the previous event was queued or if a // delay was set up by leapForward(). - if (buttonCurrentlyDown || endOfQueue != startOfQueue || msgQueue[endOfQueue].delay) { + if ((dragMode && buttonCurrentlyDown) || endOfQueue != startOfQueue || msgQueue[endOfQueue].delay) { msgQueue[endOfQueue++].event = event; if (shouldReplaySavedEvents) @@ -467,7 +448,7 @@ static JSValueRef keyDownCallback(JSContextRef context, JSObjectRef function, JS else if (JSStringIsEqualToUTF8CString(character, "end")) gdkKeySym = GDK_End; else if (JSStringIsEqualToUTF8CString(character, "delete")) - gdkKeySym = GDK_BackSpace; + gdkKeySym = GDK_Delete; else if (JSStringIsEqualToUTF8CString(character, "F1")) gdkKeySym = GDK_F1; else if (JSStringIsEqualToUTF8CString(character, "F2")) diff --git a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp index e8b8627..6f8e637 100644 --- a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp +++ b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp @@ -171,6 +171,30 @@ int LayoutTestController::numberOfPages(float pageWidth, float pageHeight) return webkit_web_frame_number_of_pages(mainFrame, pageWidth, pageHeight); } +JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const +{ + // FIXME: implement + return JSRetainPtr<JSStringRef>(); +} + +bool LayoutTestController::isPageBoxVisible(int pageNumber) const +{ + // FIXME: implement + return false; +} + +JSRetainPtr<JSStringRef> LayoutTestController::pageAreaRectInPixels(int pageNumber) const +{ + // FIXME: implement + return JSRetainPtr<JSStringRef>(); +} + +JSRetainPtr<JSStringRef> LayoutTestController::preferredPageSizeInPixels(int pageNumber) const +{ + // FIXME: implement + return JSRetainPtr<JSStringRef>(); +} + size_t LayoutTestController::webHistoryItemCount() { // FIXME: implement diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm b/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm index 9e4b203..51ea004 100644 --- a/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm +++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm @@ -111,7 +111,7 @@ static void runTest(const string& testPathOrURL); volatile bool done; NavigationController* gNavigationController = 0; -LayoutTestController* gLayoutTestController = 0; +RefPtr<LayoutTestController> gLayoutTestController; WebFrame *mainFrame = 0; // This is the topmost frame that is loading, during a given load, or nil when no load is @@ -136,7 +136,7 @@ static int dumpPixels; static int threaded; static int dumpTree = YES; static int forceComplexText; -static int useHTML5Parser; +static int useHTML5Parser = YES; static BOOL printSeparators; static RetainPtr<CFStringRef> persistentUserStyleSheetLocation; @@ -562,7 +562,7 @@ static void initializeGlobalsFromCommandLineOptions(int argc, const char *argv[] {"tree", no_argument, &dumpTree, YES}, {"threaded", no_argument, &threaded, YES}, {"complex-text", no_argument, &forceComplexText, YES}, - {"html5-parser", no_argument, &useHTML5Parser, YES}, + {"legacy-parser", no_argument, &useHTML5Parser, NO}, {NULL, 0, NULL, 0} }; @@ -1185,6 +1185,9 @@ static void resetWebViewToConsistentStateBeforeTesting() [WebView _resetOriginAccessWhitelists]; [[MockGeolocationProvider shared] stopTimer]; + + // Clear the contents of the general pasteboard + [[NSPasteboard generalPasteboard] declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil]; } static void runTest(const string& testPathOrURL) @@ -1221,7 +1224,7 @@ static void runTest(const string& testPathOrURL) resetWebViewToConsistentStateBeforeTesting(); - gLayoutTestController = new LayoutTestController(testURL, expectedPixelHash); + gLayoutTestController = LayoutTestController::create(testURL, expectedPixelHash); topLoadingFrame = nil; ASSERT(!draggingInfo); // the previous test should have called eventSender.mouseUp to drop! releaseAndZero(&draggingInfo); @@ -1311,8 +1314,7 @@ static void runTest(const string& testPathOrURL) ASSERT(CFArrayGetCount(openWindowsRef) == 1); ASSERT(CFArrayGetValueAtIndex(openWindowsRef, 0) == [[mainFrame webView] window]); - gLayoutTestController->deref(); - gLayoutTestController = 0; + gLayoutTestController.clear(); if (ignoreWebCoreNodeLeaks) [WebCoreStatistics stopIgnoringWebCoreNodeLeaks]; diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTreePasteboard.m b/WebKitTools/DumpRenderTree/mac/DumpRenderTreePasteboard.m index 75be9de..b1b3b86 100644 --- a/WebKitTools/DumpRenderTree/mac/DumpRenderTreePasteboard.m +++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTreePasteboard.m @@ -177,7 +177,7 @@ static NSMutableDictionary *localPasteboards; return [dataByType objectForKey:dataType]; } -- (BOOL)setPropertyList:(id)propertyList forType:(NSString *)dataType; +- (BOOL)setPropertyList:(id)propertyList forType:(NSString *)dataType { CFDataRef data = NULL; if (propertyList) diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.mm b/WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.mm index 8845ef0..e0cdc6b 100644 --- a/WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.mm +++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.mm @@ -82,7 +82,7 @@ static CFArrayCallBacks NonRetainingArrayCallbacks = { return gLayoutTestController ? gLayoutTestController->windowIsKey() : YES; } -- (void)keyDown:(id)sender +- (void)keyDown:(NSEvent *)event { // Do nothing, avoiding the beep we'd otherwise get from NSResponder, // once we get to the end of the responder chain. diff --git a/WebKitTools/DumpRenderTree/mac/EventSendingController.mm b/WebKitTools/DumpRenderTree/mac/EventSendingController.mm index 73831ff..9d2fc75 100644 --- a/WebKitTools/DumpRenderTree/mac/EventSendingController.mm +++ b/WebKitTools/DumpRenderTree/mac/EventSendingController.mm @@ -598,7 +598,7 @@ static int buildModifierFlags(const WebScriptObject* modifiers) eventCharacter = [NSString stringWithCharacters:&ch length:1]; keyCode = 0x77; } else if ([character isEqualToString:@"delete"]) { - const unichar ch = 0x7f; + const unichar ch = NSDeleteFunctionKey; eventCharacter = [NSString stringWithCharacters:&ch length:1]; keyCode = 0x75; } diff --git a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm index eb01090..d0599e0 100644 --- a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm +++ b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm @@ -212,6 +212,29 @@ int LayoutTestController::pageNumberForElementById(JSStringRef id, float pageWid return [mainFrame pageNumberForElement:element:pageWidthInPixels:pageHeightInPixels]; } +JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const +{ + JSRetainPtr<JSStringRef> propertyValue(Adopt, JSStringCreateWithCFString((CFStringRef)[mainFrame pageProperty:propertyName:pageNumber])); + return propertyValue; +} + +bool LayoutTestController::isPageBoxVisible(int pageNumber) const +{ + return [mainFrame isPageBoxVisible:pageNumber]; +} + +JSRetainPtr<JSStringRef> LayoutTestController::pageAreaRectInPixels(int pageNumber) const +{ + JSRetainPtr<JSStringRef> propertyValue(Adopt, JSStringCreateWithCFString((CFStringRef)[mainFrame pageAreaRectInPixels:pageNumber])); + return propertyValue; +} + +JSRetainPtr<JSStringRef> LayoutTestController::preferredPageSizeInPixels(int pageNumber) const +{ + JSRetainPtr<JSStringRef> propertyValue(Adopt, JSStringCreateWithCFString((CFStringRef)[mainFrame preferredPageSizeInPixels:pageNumber])); + return propertyValue; +} + int LayoutTestController::numberOfPages(float pageWidthInPixels, float pageHeightInPixels) { return [mainFrame numberOfPages:pageWidthInPixels:pageHeightInPixels]; @@ -487,9 +510,9 @@ int LayoutTestController::windowCount() return CFArrayGetCount(openWindowsRef); } -bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id) +bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef jsString) { - RetainPtr<CFStringRef> idCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, id)); + RetainPtr<CFStringRef> idCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, jsString)); NSString *idNS = (NSString *)idCF.get(); DOMElement *element = [[mainFrame DOMDocument] getElementById:idNS]; @@ -520,7 +543,7 @@ void LayoutTestController::setCacheModel(int cacheModel) bool LayoutTestController::isCommandEnabled(JSStringRef name) { RetainPtr<CFStringRef> nameCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, name)); - NSString *nameNS = reinterpret_cast<const NSString *>(nameCF.get()); + NSString *nameNS = (NSString *)nameCF.get(); // Accept command strings with capital letters for first letter without trailing colon. if (![nameNS hasSuffix:@":"] && [nameNS length]) { @@ -860,3 +883,8 @@ void LayoutTestController::setEditingBehavior(const char* editingBehavior) [[WebPreferences standardPreferences] setEditingBehavior:WebKitEditingWinBehavior]; [editingBehaviorNS release]; } + +void LayoutTestController::abortModal() +{ + [NSApp abortModal]; +} diff --git a/WebKitTools/DumpRenderTree/mac/UIDelegate.mm b/WebKitTools/DumpRenderTree/mac/UIDelegate.mm index e6754c1..83bf0c6 100644 --- a/WebKitTools/DumpRenderTree/mac/UIDelegate.mm +++ b/WebKitTools/DumpRenderTree/mac/UIDelegate.mm @@ -67,6 +67,20 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; printf ("CONSOLE MESSAGE: line %d: %s\n", [lineNumber intValue], [message UTF8String]); } +- (void)modalWindowWillClose:(NSNotification *)notification +{ + [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowWillCloseNotification object:nil]; + [NSApp abortModal]; +} + +- (void)webViewRunModal:(WebView *)sender +{ + gLayoutTestController->setWindowIsKey(false); + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(modalWindowWillClose:) name:NSWindowWillCloseNotification object:nil]; + [NSApp runModalForWindow:[sender window]]; + gLayoutTestController->setWindowIsKey(true); +} + - (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame { if (!done) diff --git a/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp b/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp index 7ec505f..5f340e9 100644 --- a/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp +++ b/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp @@ -191,11 +191,23 @@ void EventSender::continuousMouseScrollBy(int x, int y) // continuousMouseScrollBy() mimics devices that send fine-grained scroll events where the 'delta' specified is not the usual // multiple of 120. See http://doc.qt.nokia.com/4.6/qwheelevent.html#delta for a good explanation of this. if (x) { - QWheelEvent* event = new QWheelEvent(m_mousePos, m_mousePos, x, m_mouseButtons, Qt::NoModifier, Qt::Horizontal); + QEvent* event; + if (isGraphicsBased()) { + event = createGraphicsSceneWheelEvent(QEvent::GraphicsSceneWheel, + m_mousePos, m_mousePos, x, Qt::NoModifier, Qt::Horizontal); + } else + event = new QWheelEvent(m_mousePos, m_mousePos, x, m_mouseButtons, Qt::NoModifier, Qt::Horizontal); + sendOrQueueEvent(event); } if (y) { - QWheelEvent* event = new QWheelEvent(m_mousePos, m_mousePos, y, m_mouseButtons, Qt::NoModifier, Qt::Vertical); + QEvent* event; + if (isGraphicsBased()) { + event = createGraphicsSceneWheelEvent(QEvent::GraphicsSceneWheel, + m_mousePos, m_mousePos, y, Qt::NoModifier, Qt::Vertical); + } else + event = new QWheelEvent(m_mousePos, m_mousePos, y, m_mouseButtons, Qt::NoModifier, Qt::Vertical); + sendOrQueueEvent(event); } } @@ -339,8 +351,18 @@ void EventSender::contextClick() sendEvent(m_page, &event); QMouseEvent event2(QEvent::MouseButtonRelease, m_mousePos, Qt::RightButton, Qt::RightButton, Qt::NoModifier); sendEvent(m_page, &event2); - QContextMenuEvent event3(QContextMenuEvent::Mouse, m_mousePos); - sendEvent(m_page->view(), &event3); + + if (isGraphicsBased()) { + QGraphicsSceneContextMenuEvent ctxEvent(QEvent::GraphicsSceneContextMenu); + ctxEvent.setReason(QGraphicsSceneContextMenuEvent::Mouse); + ctxEvent.setPos(m_mousePos); + WebCore::WebViewGraphicsBased* view = qobject_cast<WebCore::WebViewGraphicsBased*>(m_page->view()); + if (view) + sendEvent(view->graphicsView(), &ctxEvent); + } else { + QContextMenuEvent ctxEvent(QContextMenuEvent::Mouse, m_mousePos); + sendEvent(m_page->view(), &ctxEvent); + } } void EventSender::scheduleAsynchronousClick() @@ -601,6 +623,19 @@ QGraphicsSceneMouseEvent* EventSender::createGraphicsSceneMouseEvent(QEvent::Typ return event; } +QGraphicsSceneWheelEvent* EventSender::createGraphicsSceneWheelEvent(QEvent::Type type, const QPoint& pos, const QPoint& screenPos, int delta, Qt::KeyboardModifiers modifiers, Qt::Orientation orientation) +{ + QGraphicsSceneWheelEvent* event; + event = new QGraphicsSceneWheelEvent(type); + event->setPos(pos); + event->setScreenPos(screenPos); + event->setDelta(delta); + event->setModifiers(modifiers); + event->setOrientation(orientation); + + return event; +} + void EventSender::sendEvent(QObject* receiver, QEvent* event) { if (WebCore::WebViewGraphicsBased* view = qobject_cast<WebCore::WebViewGraphicsBased*>(receiver)) diff --git a/WebKitTools/DumpRenderTree/qt/EventSenderQt.h b/WebKitTools/DumpRenderTree/qt/EventSenderQt.h index 51c8325..c2ff746 100644 --- a/WebKitTools/DumpRenderTree/qt/EventSenderQt.h +++ b/WebKitTools/DumpRenderTree/qt/EventSenderQt.h @@ -88,6 +88,7 @@ protected: private: bool isGraphicsBased() const { return qobject_cast<WebCore::WebViewGraphicsBased*>(m_page->view()); } QGraphicsSceneMouseEvent* createGraphicsSceneMouseEvent(QEvent::Type, const QPoint& pos, const QPoint& screenPos, Qt::MouseButton, Qt::MouseButtons, Qt::KeyboardModifiers); + QGraphicsSceneWheelEvent* createGraphicsSceneWheelEvent(QEvent::Type, const QPoint& pos, const QPoint& screenPos, int delta, Qt::KeyboardModifiers, Qt::Orientation); void sendEvent(QObject* receiver, QEvent* event); private: diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp index 8450376..3cced7d 100644 --- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp +++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp @@ -35,6 +35,7 @@ #include "WorkQueueItemQt.h" #include <QDir> #include <QLocale> +#include <qwebscriptworld.h> #include <qwebsettings.h> LayoutTestController::LayoutTestController(WebCore::DumpRenderTree* drt) @@ -662,5 +663,19 @@ void LayoutTestController::setMockGeolocationPosition(double latitude, double lo DumpRenderTreeSupportQt::setMockGeolocationPosition(latitude, longitude, accuracy); } +void LayoutTestController::evaluateScriptInIsolatedWorld(int worldID, const QString& script) +{ + QWebScriptWorld* scriptWorld; + if (!worldID) { + scriptWorld = new QWebScriptWorld(); + } else if (!m_worldMap.contains(worldID)) { + scriptWorld = new QWebScriptWorld(); + m_worldMap.insert(worldID, scriptWorld); + } else + scriptWorld = m_worldMap.value(worldID); + + m_drt->webPage()->mainFrame()->evaluateScriptInIsolatedWorld(scriptWorld, script); +} + const unsigned LayoutTestController::maxViewWidth = 800; const unsigned LayoutTestController::maxViewHeight = 600; diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h index a041ad0..b56f1c9 100644 --- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h +++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h @@ -183,6 +183,10 @@ public slots: // For now, this is a no-op. This may change depending on outcome of // https://bugs.webkit.org/show_bug.cgi?id=33333 void setCallCloseOnWebViews() {} + // This is a no-op - it allows us to pass + // plugins/get-url-that-the-resource-load-delegate-will-disallow.html + // which is a Mac-specific test. + void addDisallowedURL(const QString&) {} void setMockGeolocationError(int code, const QString& message); void setMockGeolocationPosition(double latitude, double longitude, double accuracy); @@ -204,6 +208,8 @@ public slots: void setEditingBehavior(const QString& editingBehavior); + void evaluateScriptInIsolatedWorld(int worldID, const QString& script); + private slots: void processWork(); @@ -224,6 +230,7 @@ private: bool m_isGeolocationPermissionSet; bool m_geolocationPermission; + QMap<int, QWebScriptWorld*> m_worldMap; QUrl m_userStyleSheetLocation; QBasicTimer m_timeoutTimer; QWebFrame* m_topLoadingFrame; diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp index 1ed54d5..451ff86 100644 --- a/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp +++ b/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp @@ -104,7 +104,7 @@ COMPtr<HistoryDelegate> sharedHistoryDelegate; IWebFrame* frame; HWND webViewWindow; -LayoutTestController* gLayoutTestController = 0; +RefPtr<LayoutTestController> gLayoutTestController; UINT_PTR waitToDumpWatchdog = 0; @@ -140,17 +140,27 @@ wstring urlSuitableForTestResult(const wstring& url) return PathFindFileNameW(url.c_str()); } -string toUTF8(BSTR bstr) +static string toUTF8(const wchar_t* wideString, size_t length) { - int result = WideCharToMultiByte(CP_UTF8, 0, bstr, SysStringLen(bstr) + 1, 0, 0, 0, 0); + int result = WideCharToMultiByte(CP_UTF8, 0, wideString, length + 1, 0, 0, 0, 0); Vector<char> utf8Vector(result); - result = WideCharToMultiByte(CP_UTF8, 0, bstr, SysStringLen(bstr) + 1, utf8Vector.data(), result, 0, 0); + result = WideCharToMultiByte(CP_UTF8, 0, wideString, length + 1, utf8Vector.data(), result, 0, 0); if (!result) return string(); return string(utf8Vector.data(), utf8Vector.size() - 1); } +string toUTF8(BSTR bstr) +{ + return toUTF8(bstr, SysStringLen(bstr)); +} + +string toUTF8(const wstring& wideString) +{ + return toUTF8(wideString.c_str(), wideString.length()); +} + static LRESULT CALLBACK DumpRenderTreeWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { @@ -687,7 +697,7 @@ void dump() COMPtr<IWebFramePrivate> framePrivate; if (FAILED(frame->QueryInterface(&framePrivate))) goto fail; - framePrivate->renderTreeAsExternalRepresentation(&resultString); + framePrivate->renderTreeAsExternalRepresentation(gLayoutTestController->isPrinting(), &resultString); } if (!resultString) @@ -903,7 +913,7 @@ static void runTest(const string& testPathOrURL) CFRelease(url); - ::gLayoutTestController = new LayoutTestController(pathOrURL, expectedPixelHash); + ::gLayoutTestController = LayoutTestController::create(pathOrURL, expectedPixelHash); done = false; topLoadingFrame = 0; @@ -994,8 +1004,7 @@ static void runTest(const string& testPathOrURL) exit: SysFreeString(urlBStr); - ::gLayoutTestController->deref(); - ::gLayoutTestController = 0; + ::gLayoutTestController.clear(); return; } diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h b/WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h index eb5d312..cc4337b 100644 --- a/WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h +++ b/WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h @@ -50,6 +50,7 @@ extern HWND webViewWindow; std::wstring urlSuitableForTestResult(const std::wstring& url); std::string toUTF8(BSTR); +std::string toUTF8(const std::wstring&); IWebView* createWebViewAndOffscreenWindow(HWND* webViewWindow = 0); Vector<HWND>& openWindows(); typedef HashMap<HWND, COMPtr<IWebView> > WindowToWebViewMap; diff --git a/WebKitTools/DumpRenderTree/win/EventSender.cpp b/WebKitTools/DumpRenderTree/win/EventSender.cpp index 2a36d8d..c9749e7 100644 --- a/WebKitTools/DumpRenderTree/win/EventSender.cpp +++ b/WebKitTools/DumpRenderTree/win/EventSender.cpp @@ -468,7 +468,7 @@ static JSValueRef keyDownCallback(JSContextRef context, JSObjectRef function, JS else if (JSStringIsEqualToUTF8CString(character, "end")) virtualKeyCode = VK_END; else if (JSStringIsEqualToUTF8CString(character, "delete")) - virtualKeyCode = VK_BACK; + virtualKeyCode = VK_DELETE; else { charCode = JSStringGetCharactersPtr(character)[0]; virtualKeyCode = LOBYTE(VkKeyScan(charCode)); diff --git a/WebKitTools/DumpRenderTree/win/ImageDiff.vcproj b/WebKitTools/DumpRenderTree/win/ImageDiff.vcproj index 73d541b..361069a 100644 --- a/WebKitTools/DumpRenderTree/win/ImageDiff.vcproj +++ b/WebKitTools/DumpRenderTree/win/ImageDiff.vcproj @@ -51,7 +51,7 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib"
+ AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib"
AdditionalLibraryDirectories=""
SubSystem="1"
/>
@@ -119,7 +119,7 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib"
+ AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib"
AdditionalLibraryDirectories=""
SubSystem="1"
/>
@@ -186,7 +186,7 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib"
+ AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib"
AdditionalLibraryDirectories=""
SubSystem="1"
/>
@@ -253,7 +253,7 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib"
+ AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib"
AdditionalLibraryDirectories=""
SubSystem="1"
/>
diff --git a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp index c70b517..e0d5731 100644 --- a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp +++ b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp @@ -1237,11 +1237,35 @@ int LayoutTestController::numberOfPages(float pageWidthInPixels, float pageHeigh return pageNumber; } +JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const +{ + // FIXME: Implement this. + return JSRetainPtr<JSStringRef>(); +} + void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL) { } +bool LayoutTestController::isPageBoxVisible(int pageNumber) const +{ + // FIXME: implement + return false; +} + +JSRetainPtr<JSStringRef> LayoutTestController::pageAreaRectInPixels(int pageNumber) const +{ + // FIXME: implement + return JSRetainPtr<JSStringRef>(); +} + +JSRetainPtr<JSStringRef> LayoutTestController::preferredPageSizeInPixels(int pageNumber) const +{ + // FIXME: implement + return JSRetainPtr<JSStringRef>(); +} + void LayoutTestController::apiTestGoToCurrentBackForwardItem() { COMPtr<IWebView> webView; diff --git a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp b/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp index 321d9cf..24c6304 100644 --- a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp +++ b/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp @@ -142,7 +142,7 @@ NPError NPP_Destroy(NPP instance, NPSavedData **save) } if (obj->logDestroy) - pluginLog(instance, "NPP_Destroy\n"); + pluginLog(instance, "NPP_Destroy"); if (obj->onSetWindow) free(obj->onSetWindow); diff --git a/WebKitTools/DumpRenderTree/win/UIDelegate.cpp b/WebKitTools/DumpRenderTree/win/UIDelegate.cpp index 6637068..519b9e1 100755 --- a/WebKitTools/DumpRenderTree/win/UIDelegate.cpp +++ b/WebKitTools/DumpRenderTree/win/UIDelegate.cpp @@ -485,7 +485,7 @@ HRESULT STDMETHODCALLTYPE UIDelegate::webViewAddMessageToConsole( newMessage = newMessage.substr(0, fileProtocol) + urlSuitableForTestResult(newMessage.substr(fileProtocol)); } - printf("CONSOLE MESSAGE: line %d: %S\n", lineNumber, newMessage.c_str()); + printf("CONSOLE MESSAGE: line %d: %s\n", lineNumber, toUTF8(newMessage).c_str()); return S_OK; } diff --git a/WebKitTools/DumpRenderTree/wx/DumpRenderTreeWx.cpp b/WebKitTools/DumpRenderTree/wx/DumpRenderTreeWx.cpp index f905786..c56f129 100644 --- a/WebKitTools/DumpRenderTree/wx/DumpRenderTreeWx.cpp +++ b/WebKitTools/DumpRenderTree/wx/DumpRenderTreeWx.cpp @@ -58,7 +58,7 @@ using namespace std; FILE* logOutput; -LayoutTestController* gLayoutTestController = 0; +RefPtr<LayoutTestController> gLayoutTestController; static wxWebView* webView; static wxTimer* idleTimer; @@ -215,8 +215,7 @@ void dump() fflush(stdout); fflush(stderr); - gLayoutTestController->deref(); - gLayoutTestController = 0; + gLayoutTestController.clear(); } static void runTest(const wxString testPathOrURL) @@ -238,7 +237,7 @@ static void runTest(const wxString testPathOrURL) if (http == string::npos) pathOrURL.insert(0, "file://"); - gLayoutTestController = new LayoutTestController(pathOrURL, expectedPixelHash); + gLayoutTestController = LayoutTestController::create(pathOrURL, expectedPixelHash); if (!gLayoutTestController) { wxTheApp->ExitMainLoop(); } @@ -337,9 +336,6 @@ bool MyApp::OnInit() delete logger; fclose(logOutput); - delete gLayoutTestController; - gLayoutTestController = 0; - // returning false shuts the app down return false; } diff --git a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp index 265802d..90ddea8 100644 --- a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp +++ b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp @@ -451,3 +451,26 @@ void LayoutTestController::setEditingBehavior(const char* editingBehavior) { // FIXME: Implement } + +JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const +{ + +} + +bool LayoutTestController::isPageBoxVisible(int pageNumber) const +{ + // FIXME: Implement + return true; +} + +JSRetainPtr<JSStringRef> LayoutTestController::pageAreaRectInPixels(int pageNumber) const +{ + // FIXME: Implement + return 0; +} + +JSRetainPtr<JSStringRef> LayoutTestController::preferredPageSizeInPixels(int pageNumber) const +{ + // FIXME: Implement + return 0; +} diff --git a/WebKitTools/GtkLauncher/main.c b/WebKitTools/GtkLauncher/main.c index e6d69a9..17ed40f 100644 --- a/WebKitTools/GtkLauncher/main.c +++ b/WebKitTools/GtkLauncher/main.c @@ -25,7 +25,6 @@ */ #include <gtk/gtk.h> -#include <stdlib.h> #include <webkit/webkit.h> static GtkWidget* main_window; @@ -192,12 +191,9 @@ static gchar* filenameToURL(const char* filename) if (!g_file_test(filename, G_FILE_TEST_EXISTS)) return 0; - gchar *fullPath = realpath(filename, 0); - if (!fullPath) - return 0; - - gchar *fileURL = g_filename_to_uri(fullPath, 0, 0); - free(fullPath); + GFile *gfile = g_file_new_for_path(filename); + gchar *fileURL = g_file_get_uri(gfile); + g_object_unref(gfile); return fileURL; } diff --git a/WebKitTools/MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj b/WebKitTools/MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj index 4518dd3..eeb70c9 100644 --- a/WebKitTools/MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj +++ b/WebKitTools/MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj @@ -11,14 +11,42 @@ 256AC3DA0F4B6AC300CF3369 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* AppDelegate.m */; }; 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; + BC20545E11C96C92008F3375 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; BC329487116A92E2008635D0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BC329486116A92E2008635D0 /* main.m */; }; BC329498116A941B008635D0 /* BrowserWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = BC329497116A941B008635D0 /* BrowserWindowController.m */; }; BC3294A3116A9852008635D0 /* BrowserWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC3294A1116A9852008635D0 /* BrowserWindow.xib */; }; BC8FB5A8116AA1FE0080D413 /* WebKit2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC8FB5A7116AA1FE0080D413 /* WebKit2.framework */; }; + BCBD384011B08A6800E01E54 /* WebBundleMain.m in Sources */ = {isa = PBXBuildFile; fileRef = BCBD383D11B08A3100E01E54 /* WebBundleMain.m */; }; + BCBD384411B08AAD00E01E54 /* WebKit2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC8FB5A7116AA1FE0080D413 /* WebKit2.framework */; }; + BCBD38D011B08C0200E01E54 /* WebBundle.bundle in Copy WebBundle */ = {isa = PBXBuildFile; fileRef = BCBD381D11B0898200E01E54 /* WebBundle.bundle */; }; BCE625EE117FC80E00572433 /* BrowserStatisticsWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCE625ED117FC80E00572433 /* BrowserStatisticsWindow.xib */; }; BCE625F1117FC82700572433 /* BrowserStatisticsWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = BCE625F0117FC82700572433 /* BrowserStatisticsWindowController.m */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + BCBD38C511B08BA400E01E54 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = BCBD381C11B0898200E01E54; + remoteInfo = WebBundle; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + BCBD38CF11B08C0100E01E54 /* Copy WebBundle */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = Contents; + dstSubfolderSpec = 1; + files = ( + BCBD38D011B08C0200E01E54 /* WebBundle.bundle in Copy WebBundle */, + ); + name = "Copy WebBundle"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 089C165DFE840E0CC02AAC07 /* InfoPlist.strings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = InfoPlist.strings; path = mac/English.lproj/InfoPlist.strings; sourceTree = "<group>"; }; 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; }; @@ -37,6 +65,9 @@ BC329497116A941B008635D0 /* BrowserWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BrowserWindowController.m; path = mac/BrowserWindowController.m; sourceTree = "<group>"; }; BC3294A2116A9852008635D0 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = mac/English.lproj/BrowserWindow.xib; sourceTree = "<group>"; }; BC8FB5A7116AA1FE0080D413 /* WebKit2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebKit2.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + BCBD381D11B0898200E01E54 /* WebBundle.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WebBundle.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; + BCBD381E11B0898200E01E54 /* WebBundle-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "WebBundle-Info.plist"; sourceTree = "<group>"; }; + BCBD383D11B08A3100E01E54 /* WebBundleMain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebBundleMain.m; sourceTree = "<group>"; }; BCE625ED117FC80E00572433 /* BrowserStatisticsWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = BrowserStatisticsWindow.xib; path = mac/BrowserStatisticsWindow.xib; sourceTree = "<group>"; }; BCE625EF117FC82700572433 /* BrowserStatisticsWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BrowserStatisticsWindowController.h; path = mac/BrowserStatisticsWindowController.h; sourceTree = "<group>"; }; BCE625F0117FC82700572433 /* BrowserStatisticsWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BrowserStatisticsWindowController.m; path = mac/BrowserStatisticsWindowController.m; sourceTree = "<group>"; }; @@ -52,6 +83,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + BCBD381B11B0898200E01E54 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + BC20545E11C96C92008F3375 /* Cocoa.framework in Frameworks */, + BCBD384411B08AAD00E01E54 /* WebKit2.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -91,6 +131,7 @@ isa = PBXGroup; children = ( 8D1107320486CEB800E47090 /* MiniBrowser.app */, + BCBD381D11B0898200E01E54 /* WebBundle.bundle */, ); name = Products; sourceTree = "<group>"; @@ -100,6 +141,7 @@ children = ( 080E96DDFE201D6D7F000001 /* Classes */, 29B97315FDCFA39411CA2CEA /* Other Sources */, + BCBD382B11B089F700E01E54 /* WebBundle */, 29B97317FDCFA39411CA2CEA /* Resources */, BC1770481188EB05007D9E9A /* Scripts */, 29B97323FDCFA39411CA2CEA /* Frameworks */, @@ -121,6 +163,7 @@ isa = PBXGroup; children = ( 8D1107310486CEB800E47090 /* MiniBrowser-Info.plist */, + BCBD381E11B0898200E01E54 /* WebBundle-Info.plist */, 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, BC3294A1116A9852008635D0 /* BrowserWindow.xib */, 1DDD58140DA1D0A300B32029 /* MainMenu.xib */, @@ -146,6 +189,15 @@ name = Scripts; sourceTree = "<group>"; }; + BCBD382B11B089F700E01E54 /* WebBundle */ = { + isa = PBXGroup; + children = ( + BCBD383D11B08A3100E01E54 /* WebBundleMain.m */, + ); + name = WebBundle; + path = mac/WebBundle; + sourceTree = "<group>"; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -154,6 +206,7 @@ buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "MiniBrowser" */; buildPhases = ( 8D1107290486CEB800E47090 /* Resources */, + BCBD38CF11B08C0100E01E54 /* Copy WebBundle */, 8D11072C0486CEB800E47090 /* Sources */, 8D11072E0486CEB800E47090 /* Frameworks */, BC17701E1188DFB4007D9E9A /* Make Launchable */, @@ -161,6 +214,7 @@ buildRules = ( ); dependencies = ( + BCBD38C611B08BA400E01E54 /* PBXTargetDependency */, ); name = MiniBrowser; productInstallPath = "$(HOME)/Applications"; @@ -168,6 +222,23 @@ productReference = 8D1107320486CEB800E47090 /* MiniBrowser.app */; productType = "com.apple.product-type.application"; }; + BCBD381C11B0898200E01E54 /* WebBundle */ = { + isa = PBXNativeTarget; + buildConfigurationList = BCBD382111B0898300E01E54 /* Build configuration list for PBXNativeTarget "WebBundle" */; + buildPhases = ( + BCBD381911B0898200E01E54 /* Resources */, + BCBD381A11B0898200E01E54 /* Sources */, + BCBD381B11B0898200E01E54 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = WebBundle; + productName = WebBundle; + productReference = BCBD381D11B0898200E01E54 /* WebBundle.bundle */; + productType = "com.apple.product-type.bundle"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -181,6 +252,7 @@ projectRoot = ""; targets = ( 8D1107260486CEB800E47090 /* MiniBrowser */, + BCBD381C11B0898200E01E54 /* WebBundle */, ); }; /* End PBXProject section */ @@ -197,6 +269,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + BCBD381911B0898200E01E54 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -228,8 +307,24 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + BCBD381A11B0898200E01E54 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BCBD384011B08A6800E01E54 /* WebBundleMain.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + BCBD38C611B08BA400E01E54 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = BCBD381C11B0898200E01E54 /* WebBundle */; + targetProxy = BCBD38C511B08BA400E01E54 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin PBXVariantGroup section */ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { isa = PBXVariantGroup; @@ -258,6 +353,36 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + BCBD381F11B0898300E01E54 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = NO; + GCC_ENABLE_OBJC_GC = supported; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = mac/MiniBrowser_Prefix.pch; + INFOPLIST_FILE = "WebBundle-Info.plist"; + PRODUCT_NAME = WebBundle; + WRAPPER_EXTENSION = bundle; + }; + name = Debug; + }; + BCBD382011B0898300E01E54 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_ENABLE_OBJC_GC = supported; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = mac/MiniBrowser_Prefix.pch; + INFOPLIST_FILE = "WebBundle-Info.plist"; + PRODUCT_NAME = WebBundle; + WRAPPER_EXTENSION = bundle; + }; + name = Release; + }; C01FCF4B08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -318,6 +443,15 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + BCBD382111B0898300E01E54 /* Build configuration list for PBXNativeTarget "WebBundle" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + BCBD381F11B0898300E01E54 /* Debug */, + BCBD382011B0898300E01E54 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "MiniBrowser" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/WebKitTools/MiniBrowser/WebBundle-Info.plist b/WebKitTools/MiniBrowser/WebBundle-Info.plist new file mode 100644 index 0000000..c285a47 --- /dev/null +++ b/WebKitTools/MiniBrowser/WebBundle-Info.plist @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>English</string> + <key>CFBundleExecutable</key> + <string>${EXECUTABLE_NAME}</string> + <key>CFBundleIdentifier</key> + <string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundlePackageType</key> + <string>BNDL</string> + <key>CFBundleShortVersionString</key> + <string>1.0</string> + <key>CFBundleSignature</key> + <string>????</string> + <key>CFBundleVersion</key> + <string>1</string> +</dict> +</plist> diff --git a/WebKitTools/MiniBrowser/mac/AppDelegate.h b/WebKitTools/MiniBrowser/mac/AppDelegate.h index 73efe32..2173c93 100644 --- a/WebKitTools/MiniBrowser/mac/AppDelegate.h +++ b/WebKitTools/MiniBrowser/mac/AppDelegate.h @@ -23,8 +23,14 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ +enum ProcessModel { + kProcessModelSharedSecondaryThread, + kProcessModelSharedSecondaryProcess +}; +typedef unsigned long ProcessModel; + @interface BrowserAppDelegate : NSObject <NSApplicationDelegate> { - WKProcessModel currentProcessModel; + ProcessModel currentProcessModel; WKPageNamespaceRef threadPageNamespace; WKPageNamespaceRef processPageNamespace; } diff --git a/WebKitTools/MiniBrowser/mac/AppDelegate.m b/WebKitTools/MiniBrowser/mac/AppDelegate.m index 64037fa..efc9b37 100644 --- a/WebKitTools/MiniBrowser/mac/AppDelegate.m +++ b/WebKitTools/MiniBrowser/mac/AppDelegate.m @@ -28,26 +28,53 @@ #import "BrowserWindowController.h" #import "BrowserStatisticsWindowController.h" -static NSString *defaultURL = @"http://webkit.org/"; +#import <WebKit2/WKStringCF.h> +#import <WebKit2/WKContextPrivate.h> + +static NSString *defaultURL = @"file:///Users/andersca/Desktop/t.html"; @implementation BrowserAppDelegate +void _didRecieveMessageFromInjectedBundle(WKContextRef context, WKStringRef message, const void *clientInfo) +{ + CFStringRef cfMessage = WKStringCopyCFString(0, message); + LOG(@"ContextInjectedBundleClient - didRecieveMessage - message: %@", cfMessage); + CFRelease(cfMessage); + + WKStringRef newMessage = WKStringCreateWithCFString(CFSTR("Roger that!")); + WKContextPostMessageToInjectedBundle(context, newMessage); + WKStringRelease(newMessage); +} + - (id)init { self = [super init]; if (self) { if ([NSEvent modifierFlags] & NSShiftKeyMask) - currentProcessModel = kWKProcessModelSecondaryThread; + currentProcessModel = kProcessModelSharedSecondaryThread; else - currentProcessModel = kWKProcessModelSecondaryProcess; + currentProcessModel = kProcessModelSharedSecondaryProcess; - WKContextRef threadContext = WKContextCreateWithProcessModel(kWKProcessModelSecondaryThread); + WKContextRef threadContext = WKContextGetSharedThreadContext(); threadPageNamespace = WKPageNamespaceCreate(threadContext); WKContextRelease(threadContext); - WKContextRef processContext = WKContextCreateWithProcessModel(kWKProcessModelSecondaryProcess); + CFStringRef bundlePathCF = (CFStringRef)[[NSBundle mainBundle] pathForAuxiliaryExecutable:@"WebBundle.bundle"]; + WKStringRef bundlePath = WKStringCreateWithCFString(bundlePathCF); + + WKContextRef processContext = WKContextCreateWithInjectedBundlePath(bundlePath); + + WKContextInjectedBundleClient bundleClient = { + 0, /* version */ + 0, /* clientInfo */ + _didRecieveMessageFromInjectedBundle + }; + WKContextSetInjectedBundleClient(processContext, &bundleClient); + processPageNamespace = WKPageNamespaceCreate(processContext); WKContextRelease(processContext); + + WKStringRelease(bundlePath); } return self; @@ -63,19 +90,19 @@ static NSString *defaultURL = @"http://webkit.org/"; - (WKPageNamespaceRef)getCurrentPageNamespace { - return (currentProcessModel == kWKProcessModelSecondaryThread) ? threadPageNamespace : processPageNamespace; + return (currentProcessModel == kProcessModelSharedSecondaryThread) ? threadPageNamespace : processPageNamespace; } - (BOOL)validateMenuItem:(NSMenuItem *)menuItem { if ([menuItem action] == @selector(setSharedProcessProcessModel:)) - [menuItem setState:currentProcessModel == kWKProcessModelSecondaryProcess ? NSOnState : NSOffState]; + [menuItem setState:currentProcessModel == kProcessModelSharedSecondaryProcess ? NSOnState : NSOffState]; else if ([menuItem action] == @selector(setSharedThreadProcessModel:)) - [menuItem setState:currentProcessModel == kWKProcessModelSecondaryThread ? NSOnState : NSOffState]; + [menuItem setState:currentProcessModel == kProcessModelSharedSecondaryThread ? NSOnState : NSOffState]; return YES; } -- (void)_setProcessModel:(WKProcessModel)processModel +- (void)_setProcessModel:(ProcessModel)processModel { if (processModel == currentProcessModel) return; @@ -85,12 +112,12 @@ static NSString *defaultURL = @"http://webkit.org/"; - (IBAction)setSharedProcessProcessModel:(id)sender { - [self _setProcessModel:kWKProcessModelSecondaryProcess]; + [self _setProcessModel:kProcessModelSharedSecondaryProcess]; } - (IBAction)setSharedThreadProcessModel:(id)sender { - [self _setProcessModel:kWKProcessModelSecondaryThread]; + [self _setProcessModel:kProcessModelSharedSecondaryThread]; } - (IBAction)showStatisticsWindow:(id)sender diff --git a/WebKitTools/MiniBrowser/mac/BrowserWindowController.m b/WebKitTools/MiniBrowser/mac/BrowserWindowController.m index b9306c0..11e51a0 100644 --- a/WebKitTools/MiniBrowser/mac/BrowserWindowController.m +++ b/WebKitTools/MiniBrowser/mac/BrowserWindowController.m @@ -25,6 +25,7 @@ #import "BrowserWindowController.h" +#import <WebKit2/WKPagePrivate.h> #import <WebKit2/WKStringCF.h> #import <WebKit2/WKURLCF.h> @@ -99,7 +100,7 @@ - (BOOL)windowShouldClose:(id)sender { - NSLog(@"windowShouldClose"); + LOG(@"windowShouldClose"); BOOL canCloseImmediately = WKPageTryClose(_webView.pageRef); return canCloseImmediately; } @@ -120,49 +121,49 @@ static void _didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo) { - NSLog(@"didStartProvisionalLoadForFrame"); + LOG(@"didStartProvisionalLoadForFrame"); } static void _didReceiveServerRedirectForProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo) { - NSLog(@"didReceiveServerRedirectForProvisionalLoadForFrame"); + LOG(@"didReceiveServerRedirectForProvisionalLoadForFrame"); } static void _didFailProvisionalLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo) { - NSLog(@"didFailProvisionalLoadWithErrorForFrame"); + LOG(@"didFailProvisionalLoadWithErrorForFrame"); } static void _didCommitLoadForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo) { - NSLog(@"didCommitLoadForFrame"); + LOG(@"didCommitLoadForFrame"); } static void _didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo) { - NSLog(@"didFinishLoadForFrame"); + LOG(@"didFinishLoadForFrame"); } static void _didFailLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo) { - NSLog(@"didFailLoadWithErrorForFrame"); + LOG(@"didFailLoadWithErrorForFrame"); } static void _didReceiveTitleForFrame(WKPageRef page, WKStringRef title, WKFrameRef frame, const void *clientInfo) { CFStringRef cfTitle = WKStringCopyCFString(0, title); - NSLog(@"didReceiveTitleForFrame \"%@\"", (NSString *)cfTitle); + LOG(@"didReceiveTitleForFrame \"%@\"", (NSString *)cfTitle); CFRelease(cfTitle); } static void _didFirstLayoutForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo) { - NSLog(@"didFirstLayoutForFrame"); + LOG(@"didFirstLayoutForFrame"); } static void _didFirstVisuallyNonEmptyLayoutForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo) { - NSLog(@"didFirstVisuallyNonEmptyLayoutForFrame"); + LOG(@"didFirstVisuallyNonEmptyLayoutForFrame"); } static void _didStartProgress(WKPageRef page, const void *clientInfo) @@ -170,9 +171,9 @@ static void _didStartProgress(WKPageRef page, const void *clientInfo) [(BrowserWindowController *)clientInfo didStartProgress]; } -static void _didChangeProgress(WKPageRef page, double value, const void *clientInfo) +static void _didChangeProgress(WKPageRef page, const void *clientInfo) { - [(BrowserWindowController *)clientInfo didChangeProgress:value]; + [(BrowserWindowController *)clientInfo didChangeProgress:WKPageGetEstimatedProgress(page)]; } static void _didFinishProgress(WKPageRef page, const void *clientInfo) @@ -182,25 +183,25 @@ static void _didFinishProgress(WKPageRef page, const void *clientInfo) static void _didBecomeUnresponsive(WKPageRef page, const void *clientInfo) { - NSLog(@"didBecomeUnresponsive"); + LOG(@"didBecomeUnresponsive"); } static void _didBecomeResponsive(WKPageRef page, const void *clientInfo) { - NSLog(@"didBecomeResponsive"); + LOG(@"didBecomeResponsive"); } #pragma mark Policy Client Callbacks static void _decidePolicyForNavigationAction(WKPageRef page, uint32_t navigationType, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo) { - NSLog(@"decidePolicyForNavigationAction"); + LOG(@"decidePolicyForNavigationAction"); WKFramePolicyListenerUse(listener); } static void _decidePolicyForNewWindowAction(WKPageRef page, uint32_t navigationType, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo) { - NSLog(@"decidePolicyForNewWindowAction"); + LOG(@"decidePolicyForNewWindowAction"); WKFramePolicyListenerUse(listener); } @@ -213,7 +214,7 @@ static void _decidePolicyForMIMEType(WKPageRef page, WKStringRef MIMEType, WKURL static WKPageRef _createNewPage(WKPageRef page, const void* clientInfo) { - NSLog(@"createNewPage"); + LOG(@"createNewPage"); BrowserWindowController *controller = [[BrowserWindowController alloc] initWithPageNamespace:WKPageGetPageNamespace(page)]; [controller loadWindow]; @@ -222,13 +223,13 @@ static WKPageRef _createNewPage(WKPageRef page, const void* clientInfo) static void _showPage(WKPageRef page, const void *clientInfo) { - NSLog(@"showPage"); + LOG(@"showPage"); [[(BrowserWindowController *)clientInfo window] orderFront:nil]; } static void _closePage(WKPageRef page, const void *clientInfo) { - NSLog(@"closePage"); + LOG(@"closePage"); WKPageClose(page); [[(BrowserWindowController *)clientInfo window] close]; WKPageRelease(page); @@ -259,7 +260,7 @@ static void _didNavigateWithNavigationData(WKPageRef page, WKNavigationDataRef n { CFStringRef title = WKStringCopyCFString(0, WKNavigationDataGetTitle(navigationData)); CFURLRef url = WKURLCopyCFURL(0, WKNavigationDataGetURL(navigationData)); - NSLog(@"HistoryClient - didNavigateWithNavigationData - title: %@ - url: %@", title, url); + LOG(@"HistoryClient - didNavigateWithNavigationData - title: %@ - url: %@", title, url); CFRelease(title); CFRelease(url); } @@ -268,7 +269,7 @@ static void _didPerformClientRedirect(WKPageRef page, WKURLRef sourceURL, WKURLR { CFURLRef cfSourceURL = WKURLCopyCFURL(0, sourceURL); CFURLRef cfDestinationURL = WKURLCopyCFURL(0, destinationURL); - NSLog(@"HistoryClient - didPerformClientRedirect - sourceURL: %@ - destinationURL: %@", cfSourceURL, cfDestinationURL); + LOG(@"HistoryClient - didPerformClientRedirect - sourceURL: %@ - destinationURL: %@", cfSourceURL, cfDestinationURL); CFRelease(cfSourceURL); CFRelease(cfDestinationURL); } @@ -277,7 +278,7 @@ static void _didPerformServerRedirect(WKPageRef page, WKURLRef sourceURL, WKURLR { CFURLRef cfSourceURL = WKURLCopyCFURL(0, sourceURL); CFURLRef cfDestinationURL = WKURLCopyCFURL(0, destinationURL); - NSLog(@"HistoryClient - didPerformServerRedirect - sourceURL: %@ - destinationURL: %@", cfSourceURL, cfDestinationURL); + LOG(@"HistoryClient - didPerformServerRedirect - sourceURL: %@ - destinationURL: %@", cfSourceURL, cfDestinationURL); CFRelease(cfSourceURL); CFRelease(cfDestinationURL); } @@ -286,7 +287,7 @@ static void _didUpdateHistoryTitle(WKPageRef page, WKStringRef title, WKURLRef U { CFStringRef cfTitle = WKStringCopyCFString(0, title); CFURLRef cfURL = WKURLCopyCFURL(0, URL); - NSLog(@"HistoryClient - didUpdateHistoryTitle - title: %@ - URL: %@", cfTitle, cfURL); + LOG(@"HistoryClient - didUpdateHistoryTitle - title: %@ - URL: %@", cfTitle, cfURL); CFRelease(cfTitle); CFRelease(cfURL); } diff --git a/WebKitTools/MiniBrowser/mac/MiniBrowser_Prefix.pch b/WebKitTools/MiniBrowser/mac/MiniBrowser_Prefix.pch index af79d0f..faa14fc 100644 --- a/WebKitTools/MiniBrowser/mac/MiniBrowser_Prefix.pch +++ b/WebKitTools/MiniBrowser/mac/MiniBrowser_Prefix.pch @@ -28,3 +28,9 @@ #endif #import <WebKit2/WebKit2.h> + +#if ENABLE_LOGGING +#define LOG NSLog +#else +#define LOG(...) ((void)0) +#endif
\ No newline at end of file diff --git a/WebKitTools/MiniBrowser/mac/WebBundle/WebBundleMain.m b/WebKitTools/MiniBrowser/mac/WebBundle/WebBundleMain.m new file mode 100644 index 0000000..f52c98e --- /dev/null +++ b/WebKitTools/MiniBrowser/mac/WebBundle/WebBundleMain.m @@ -0,0 +1,124 @@ +/* + * Copyright (C) 2010 Apple 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: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 <Cocoa/Cocoa.h> +#include <WebKit2/WKBundle.h> +#include <WebKit2/WKBundleInitialize.h> +#include <WebKit2/WKBundlePage.h> +#include <WebKit2/WKString.h> +#include <WebKit2/WKStringCF.h> +#include <WebKit2/WKURLCF.h> +#include <stdio.h> + +static WKBundleRef globalBundle; + +// WKBundlePageClient + +void _didStartProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo) +{ +} + +void _didReceiveServerRedirectForProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo) +{ +} + +void _didFailProvisionalLoadWithErrorForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo) +{ +} + +void _didCommitLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo) +{ +} + +void _didFinishLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo) +{ +} + +void _didFailLoadWithErrorForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo) +{ +} + +void _didReceiveTitleForFrame(WKBundlePageRef page, WKStringRef title, WKBundleFrameRef frame, const void *clientInfo) +{ +} + +void _didClearWindowForFrame(WKBundlePageRef page, WKBundleFrameRef frame, JSContextRef ctx, JSObjectRef window, const void *clientInfo) +{ + CFURLRef cfURL = WKURLCopyCFURL(0, WKBundlePageGetMainFrameURL(page)); + LOG(@"WKBundlePageClient - _didClearWindowForFrame %@", [(NSURL *)cfURL absoluteString]); + CFRelease(cfURL); + + WKStringRef message = WKStringCreateWithCFString(CFSTR("Window was cleared")); + WKBundlePostMessage(globalBundle, message); + WKStringRelease(message); +} + + +// WKBundleClient + +void _didCreatePage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo) +{ + LOG(@"WKBundleClient - didCreatePage\n"); + + WKBundlePageClient client = { + 0, + 0, + _didStartProvisionalLoadForFrame, + _didReceiveServerRedirectForProvisionalLoadForFrame, + _didFailProvisionalLoadWithErrorForFrame, + _didCommitLoadForFrame, + _didFinishLoadForFrame, + _didFailLoadWithErrorForFrame, + _didReceiveTitleForFrame, + _didClearWindowForFrame + }; + WKBundlePageSetClient(page, &client); +} + +void _willDestroyPage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo) +{ + LOG(@"WKBundleClient - willDestroyPage\n"); +} + +void _didRecieveMessage(WKBundleRef bundle, WKStringRef message, const void *clientInfo) +{ + CFStringRef cfMessage = WKStringCopyCFString(0, message); + LOG(@"WKBundleClient - didRecieveMessage %@\n", cfMessage); + CFRelease(cfMessage); +} + +void WKBundleInitialize(WKBundleRef bundle) +{ + globalBundle = bundle; + + WKBundleClient client = { + 0, + 0, + _didCreatePage, + _willDestroyPage, + _didRecieveMessage + }; + WKBundleSetClient(bundle, &client); +} diff --git a/WebKitTools/MiniBrowser/win/BrowserView.cpp b/WebKitTools/MiniBrowser/win/BrowserView.cpp index 95385ca..49e46bf 100644 --- a/WebKitTools/MiniBrowser/win/BrowserView.cpp +++ b/WebKitTools/MiniBrowser/win/BrowserView.cpp @@ -27,6 +27,7 @@ #include "BrowserView.h" #include "BrowserWindow.h" +#include <WebKit2/WKContextPrivate.h> #include <WebKit2/WKURLCF.h> static const unsigned short HIGH_BIT_MASK_SHORT = 0x8000; @@ -66,8 +67,12 @@ void BrowserView::create(RECT webViewRect, BrowserWindow* parentWindow) bool isShiftKeyDown = ::GetKeyState(VK_SHIFT) & HIGH_BIT_MASK_SHORT; - //WKContextRef context = WKContextCreateWithProcessModel(isShiftKeyDown ? kWKProcessModelSecondaryThread : kWKProcessModelSecondaryProcess); - WKContextRef context = WKContextCreateWithProcessModel(kWKProcessModelSecondaryThread); + WKContextRef context; + if (isShiftKeyDown) + context = WKContextGetSharedThreadContext(); + else + context = WKContextGetSharedProcessContext(); + WKPageNamespaceRef pageNamespace = WKPageNamespaceCreate(context); m_webView = WKViewCreate(webViewRect, pageNamespace, parentWindow->window()); diff --git a/WebKitTools/QtTestBrowser/fpstimer.h b/WebKitTools/QtTestBrowser/fpstimer.h index 66d38eb..accecd2 100644 --- a/WebKitTools/QtTestBrowser/fpstimer.h +++ b/WebKitTools/QtTestBrowser/fpstimer.h @@ -25,8 +25,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef fpsmeasure_h -#define fpsmeasure_h +#ifndef fpstimer_h +#define fpstimer_h #include <QObject> #include <QSet> diff --git a/WebKitTools/Scripts/build-webkit b/WebKitTools/Scripts/build-webkit index a29a6fd..88765e8 100755 --- a/WebKitTools/Scripts/build-webkit +++ b/WebKitTools/Scripts/build-webkit @@ -56,7 +56,7 @@ my $makeArgs; my $startTime = time(); my ($threeDCanvasSupport, $threeDRenderingSupport, $channelMessagingSupport, $clientBasedGeolocationSupport, $databaseSupport, $datagridSupport, $datalistSupport, - $domStorageSupport, $eventsourceSupport, $filtersSupport, $geolocationSupport, $iconDatabaseSupport, $imageResizerSupport, $indexedDatabaseSupport, + $domStorageSupport, $eventsourceSupport, $filtersSupport, $geolocationSupport, $iconDatabaseSupport, $imageResizerSupport, $indexedDatabaseSupport, $inputSpeechSupport, $javaScriptDebuggerSupport, $mathmlSupport, $offlineWebApplicationSupport, $rubySupport, $systemMallocSupport, $sandboxSupport, $sharedWorkersSupport, $svgSupport, $svgAnimationSupport, $svgAsImageSupport, $svgDOMObjCBindingsSupport, $svgFontsSupport, $svgForeignObjectSupport, $svgUseSupport, $videoSupport, $webSocketsSupport, $wmlSupport, $wcssSupport, $xhtmlmpSupport, $workersSupport, @@ -112,6 +112,9 @@ my @features = ( { option => "indexed-database", desc => "Toggle Indexed Database API support", define => "ENABLE_INDEXED_DATABASE", default => 0, value => \$indexedDatabaseSupport }, + { option => "input-speech", desc => "Speech Input API support", + define => "ENABLE_INPUT_SPEECH", default => 0, value => \$inputSpeechSupport }, + { option => "javascript-debugger", desc => "Toggle JavaScript Debugger/Profiler support", define => "ENABLE_JAVASCRIPT_DEBUGGER", default => 1, value => \$javaScriptDebuggerSupport }, diff --git a/WebKitTools/Scripts/do-webcore-rename b/WebKitTools/Scripts/do-webcore-rename index e2ce019..54fb0af 100755 --- a/WebKitTools/Scripts/do-webcore-rename +++ b/WebKitTools/Scripts/do-webcore-rename @@ -73,6 +73,7 @@ find(\&wanted, "JavaScriptCore"); find(\&wanted, "JavaScriptGlue"); find(\&wanted, "WebCore"); find(\&wanted, "WebKit"); +find(\&wanted, "WebKit2"); sub wanted { @@ -95,7 +96,7 @@ sub wanted my $isDOMTypeRename = 0; my %renames = ( # Renames go here in the form of: - # "Tokenizer" => "DocumentParser", + # "HTMLDocumentParser" => "LegacyHTMLDocumentParser", ); my %renamesContemplatedForTheFuture = ( diff --git a/WebKitTools/Scripts/update-webkit-chromium b/WebKitTools/Scripts/update-webkit-chromium index fa94f8c..836e30e 100755 --- a/WebKitTools/Scripts/update-webkit-chromium +++ b/WebKitTools/Scripts/update-webkit-chromium @@ -28,6 +28,8 @@ # Update script for the WebKit Chromium Port. +use File::Path; + chdir("WebKit/chromium") or die $!; # Find gclient or install it. diff --git a/WebKitTools/Scripts/webkitdirs.pm b/WebKitTools/Scripts/webkitdirs.pm index 33ae7da..46d2cbf 100644 --- a/WebKitTools/Scripts/webkitdirs.pm +++ b/WebKitTools/Scripts/webkitdirs.pm @@ -1553,17 +1553,18 @@ sub runSafari } if (isAppleWinWebKit()) { - my $script = "run-webkit-nightly.cmd"; - my $result = system "cp", "$FindBin::Bin/$script", productDir(); + my $result; + my $productDir = productDir(); + if ($debugger) { + setupCygwinEnv(); + chomp($ENV{WEBKITNIGHTLY} = `cygpath -wa "$productDir"`); + my $safariPath = safariPath(); + chomp($safariPath = `cygpath -wa "$safariPath"`); + $result = system $vcBuildPath, "/debugexe", "\"$safariPath\"", @ARGV; + } else { + $result = system File::Spec->catfile(productDir(), "WebKit.exe"), @ARGV; + } return $result if $result; - - my $cwd = getcwd(); - chdir productDir(); - - my $debuggerFlag = $debugger ? "/debugger" : ""; - $result = system "cmd", "/c", "call $script $debuggerFlag"; - chdir $cwd; - return $result; } return 1; diff --git a/WebKitTools/Scripts/webkitpy/common/config/committers.py b/WebKitTools/Scripts/webkitpy/common/config/committers.py index 37bd4eb..7b69815 100644 --- a/WebKitTools/Scripts/webkitpy/common/config/committers.py +++ b/WebKitTools/Scripts/webkitpy/common/config/committers.py @@ -97,7 +97,6 @@ committers_unable_to_review = [ Committer("Diego Gonzalez", ["diegohcg@webkit.org", "diego.gonzalez@openbossa.org"], "diegohcg"), Committer("Dirk Pranke", "dpranke@chromium.org"), Committer("Drew Wilson", "atwilson@chromium.org", "atwilson"), - Committer("Dumitru Daniliuc", "dumi@chromium.org", "dumi"), Committer("Eli Fidler", "eli@staikos.net", "QBin"), Committer("Enrica Casucci", "enrica@apple.com"), Committer("Erik Arvidsson", "arv@chromium.org", "arv"), @@ -115,24 +114,28 @@ committers_unable_to_review = [ Committer("Jakob Petsovits", ["jpetsovits@rim.com", "jpetso@gmx.at"], "jpetso"), Committer("Jakub Wieczorek", "jwieczorek@webkit.org", "fawek"), Committer("James Hawkins", ["jhawkins@chromium.org", "jhawkins@google.com"], "jhawkins"), - Committer("James Robinson", ["jamesr@chromium.org", "jamesr@google.com"]), + Committer("James Robinson", ["jamesr@chromium.org", "jamesr@google.com"], "jamesr"), Committer("Jens Alfke", ["snej@chromium.org", "jens@apple.com"]), Committer("Jer Noble", "jer.noble@apple.com", "jernoble"), Committer("Jeremy Moskovich", ["playmobil@google.com", "jeremy@chromium.org"], "jeremymos"), Committer("Jessie Berlin", ["jberlin@webkit.org", "jberlin@apple.com"]), Committer("Jesus Sanchez-Palencia", ["jesus@webkit.org", "jesus.palencia@openbossa.org"], "jeez_"), + Committer("Jocelyn Turcotte", "jocelyn.turcotte@nokia.com", "jturcotte"), Committer("John Abd-El-Malek", "jam@chromium.org", "jam"), Committer("John Gregg", ["johnnyg@google.com", "johnnyg@chromium.org"], "johnnyg"), Committer("Joost de Valk", ["joost@webkit.org", "webkit-dev@joostdevalk.nl"], "Altha"), Committer("Julie Parent", ["jparent@google.com", "jparent@chromium.org"], "jparent"), Committer("Julien Chaffraix", ["jchaffraix@webkit.org", "julien.chaffraix@gmail.com"]), Committer("Jungshik Shin", "jshin@chromium.org"), + Committer("Justin Schuh", "jschuh@chromium.org", "jschuh"), Committer("Keishi Hattori", "keishi@webkit.org", "keishi"), Committer("Kelly Norton", "knorton@google.com"), Committer("Kenneth Russell", "kbr@google.com"), Committer("Kinuko Yasuda", "kinuko@chromium.org", "kinuko"), Committer("Krzysztof Kowalczyk", "kkowalczyk@gmail.com"), + Committer("Leandro Pereira", ["leandro@profusion.mobi", "leandro@webkit.org"], "acidx"), Committer("Levi Weintraub", "lweintraub@apple.com"), + Committer("Luiz Agostini", ["luiz@webkit.org", "luiz.agostini@openbossa.org"], "lca"), Committer("Mads Ager", "ager@chromium.org"), Committer("Marcus Voltis Bulach", "bulach@chromium.org"), Committer("Matt Lilek", ["webkit@mattlilek.com", "pewtermoose@webkit.org"]), @@ -157,6 +160,7 @@ committers_unable_to_review = [ Committer("Scott Violet", "sky@chromium.org", "sky"), Committer("Stephen White", "senorblanco@chromium.org", "senorblanco"), Committer("Tony Chang", "tony@chromium.org", "tony^work"), + Committer("Tony Gentilcore", "tonyg@chromium.org", "tonyg-cr"), Committer("Trey Matteson", "trey@usa.net", "trey"), Committer("Tristan O'Tierney", ["tristan@otierney.net", "tristan@apple.com"]), Committer("Victor Wang", "victorw@chromium.org"), @@ -209,6 +213,7 @@ reviewers_list = [ Reviewer("Dirk Schulze", "krit@webkit.org", "krit"), Reviewer("Dmitry Titov", "dimich@chromium.org", "dimich"), Reviewer("Don Melton", "gramps@apple.com", "gramps"), + Reviewer("Dumitru Daniliuc", "dumi@chromium.org", "dumi"), Reviewer("Eric Carlson", "eric.carlson@apple.com"), Reviewer("Eric Seidel", "eric@webkit.org", "eseidel"), Reviewer("Gavin Barraclough", "barraclough@apple.com", "gbarra"), diff --git a/WebKitTools/Scripts/webkitpy/common/net/buildbot.py b/WebKitTools/Scripts/webkitpy/common/net/buildbot.py index c849ef1..5078c55 100644 --- a/WebKitTools/Scripts/webkitpy/common/net/buildbot.py +++ b/WebKitTools/Scripts/webkitpy/common/net/buildbot.py @@ -319,9 +319,10 @@ class BuildBot(object): "Leopard", "Tiger", "Windows.*Build", - "GTK", + "GTK.*32", + "GTK.*64.*Debug", # Disallow the 64-bit Release bot which is broken. "Qt", - "Chromium", + "Chromium.*Release$", ] def _parse_last_build_cell(self, builder, cell): diff --git a/WebKitTools/Scripts/webkitpy/common/net/buildbot_unittest.py b/WebKitTools/Scripts/webkitpy/common/net/buildbot_unittest.py index 5384321..8fb4c2c 100644 --- a/WebKitTools/Scripts/webkitpy/common/net/buildbot_unittest.py +++ b/WebKitTools/Scripts/webkitpy/common/net/buildbot_unittest.py @@ -275,6 +275,9 @@ class BuildBotTest(unittest.TestCase): {'name': u'Chromium Linux Release', }, {'name': u'Chromium Mac Release', }, {'name': u'Chromium Win Release', }, + {'name': u'Chromium Linux Release (Tests)', }, + {'name': u'Chromium Mac Release (Tests)', }, + {'name': u'Chromium Win Release (Tests)', }, {'name': u'New run-webkit-tests', }, ] name_regexps = [ @@ -283,9 +286,10 @@ class BuildBotTest(unittest.TestCase): "Leopard", "Tiger", "Windows.*Build", - "GTK", + "GTK.*32", + "GTK.*64.*Debug", # Disallow the 64-bit Release bot which is broken. "Qt", - "Chromium", + "Chromium.*Release$", ] expected_builders = [ {'name': u'Tiger Intel Release', }, @@ -300,7 +304,6 @@ class BuildBotTest(unittest.TestCase): {'name': u'GTK Linux 32-bit Release', }, {'name': u'GTK Linux 32-bit Debug', }, {'name': u'GTK Linux 64-bit Debug', }, - {'name': u'GTK Linux 64-bit Release', }, {'name': u'Qt Linux Release', }, {'name': u'Qt Linux Release minimal', }, {'name': u'Qt Linux ARMv5 Release', }, diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py b/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py index a77bff0..611afdc 100644 --- a/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py +++ b/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py @@ -161,7 +161,7 @@ def up_to_unmatched_closing_paren(s): Returns: A pair of strings (prefix before first unmatched ')', - reminder of s after first unmatched ')'), e.g., + remainder of s after first unmatched ')'), e.g., up_to_unmatched_closing_paren("a == (b + c)) { ") returns "a == (b + c)", " {". Returns None, None if there is no unmatched ')' @@ -1337,26 +1337,25 @@ def check_spacing(file_extension, clean_lines, line_number, error): # there should either be zero or one spaces inside the parens. # We don't want: "if ( foo)" or "if ( foo )". # Exception: "for ( ; foo; bar)" and "for (foo; bar; )" are allowed. - matched = search(r'\b(?P<statement>if|for|foreach|while|switch)\s*\((?P<reminder>.*)$', line) + matched = search(r'\b(?P<statement>if|for|foreach|while|switch)\s*\((?P<remainder>.*)$', line) if matched: statement = matched.group('statement') - condition, rest = up_to_unmatched_closing_paren(matched.group('reminder')) + condition, rest = up_to_unmatched_closing_paren(matched.group('remainder')) if condition is not None: condition_match = search(r'(?P<leading>[ ]*)(?P<separator>.).*[^ ]+(?P<trailing>[ ]*)', condition) if condition_match: n_leading = len(condition_match.group('leading')) n_trailing = len(condition_match.group('trailing')) - if n_leading != n_trailing: - for_exception = statement == 'for' and ( - (condition.startswith(' ;') and n_trailing == 0) or - (condition.endswith('; ') and n_leading == 0)) + if n_leading != 0: + for_exception = statement == 'for' and condition.startswith(' ;') if not for_exception: error(line_number, 'whitespace/parens', 5, - 'Mismatching spaces inside () in %s' % statement) - if n_leading > 1: - error(line_number, 'whitespace/parens', 5, - 'Should have zero or one spaces inside ( and ) in %s' % - statement) + 'Extra space after ( in %s' % statement) + if n_trailing != 0: + for_exception = statement == 'for' and condition.endswith('; ') + if not for_exception: + error(line_number, 'whitespace/parens', 5, + 'Extra space before ) in %s' % statement) # Do not check for more than one command in macros in_macro = match(r'\s*#define', line) @@ -1369,6 +1368,11 @@ def check_spacing(file_extension, clean_lines, line_number, error): error(line_number, 'whitespace/comma', 3, 'Missing space after ,') + matched = search(r'^\s*(?P<token1>[a-zA-Z0-9_\*&]+)\s\s+(?P<token2>[a-zA-Z0-9_\*&]+)', line) + if matched: + error(line_number, 'whitespace/declaration', 3, + 'Extra space between %s and %s' % (matched.group('token1'), matched.group('token2'))) + if file_extension == 'cpp': # C++ should have the & or * beside the type not the variable name. matched = match(r'\s*\w+(?<!\breturn|\bdelete)\s+(?P<pointer_operator>\*|\&)\w+', line) diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py b/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py index d7cb876..2dde549 100644 --- a/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py +++ b/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py @@ -1164,28 +1164,30 @@ class CppStyleTest(CppStyleTestBase): '') def test_mismatching_spaces_in_parens(self): - self.assert_lint('if (foo ) {', 'Mismatching spaces inside () in if' + self.assert_lint('if (foo ) {', 'Extra space before ) in if' ' [whitespace/parens] [5]') - self.assert_lint('switch ( foo) {', 'Mismatching spaces inside () in switch' + self.assert_lint('switch ( foo) {', 'Extra space after ( in switch' ' [whitespace/parens] [5]') - self.assert_lint('for (foo; ba; bar ) {', 'Mismatching spaces inside () in for' + self.assert_lint('for (foo; ba; bar ) {', 'Extra space before ) in for' ' [whitespace/parens] [5]') - self.assert_lint('for ((foo); (ba); (bar) ) {', 'Mismatching spaces inside () in for' + self.assert_lint('for ((foo); (ba); (bar) ) {', 'Extra space before ) in for' ' [whitespace/parens] [5]') self.assert_lint('for (; foo; bar) {', '') self.assert_lint('for (; (foo); (bar)) {', '') self.assert_lint('for ( ; foo; bar) {', '') self.assert_lint('for ( ; (foo); (bar)) {', '') - self.assert_lint('for ( ; foo; bar ) {', '') - self.assert_lint('for ( ; (foo); (bar) ) {', '') + self.assert_lint('for ( ; foo; bar ) {', 'Extra space before ) in for' + ' [whitespace/parens] [5]') + self.assert_lint('for ( ; (foo); (bar) ) {', 'Extra space before ) in for' + ' [whitespace/parens] [5]') self.assert_lint('for (foo; bar; ) {', '') self.assert_lint('for ((foo); (bar); ) {', '') - self.assert_lint('foreach (foo, foos ) {', 'Mismatching spaces inside () in foreach' + self.assert_lint('foreach (foo, foos ) {', 'Extra space before ) in foreach' ' [whitespace/parens] [5]') - self.assert_lint('foreach ( foo, foos) {', 'Mismatching spaces inside () in foreach' + self.assert_lint('foreach ( foo, foos) {', 'Extra space after ( in foreach' + ' [whitespace/parens] [5]') + self.assert_lint('while ( foo) {', 'Extra space after ( in while' ' [whitespace/parens] [5]') - self.assert_lint('while ( foo ) {', 'Should have zero or one spaces inside' - ' ( and ) in while [whitespace/parens] [5]') def test_spacing_for_fncall(self): self.assert_lint('if (foo) {', '') @@ -1542,6 +1544,13 @@ class CppStyleTest(CppStyleTestBase): self.assert_lint('f(a, /* name */ b);', '') self.assert_lint('f(a, /* name */b);', '') + def test_declaration(self): + self.assert_lint('int a;', '') + self.assert_lint('int a;', 'Extra space between int and a [whitespace/declaration] [3]') + self.assert_lint('int* a;', 'Extra space between int* and a [whitespace/declaration] [3]') + self.assert_lint('else if { }', '') + self.assert_lint('else if { }', 'Extra space between else and if [whitespace/declaration] [3]') + def test_pointer_reference_marker_location(self): self.assert_lint('int* b;', '', 'foo.cpp') self.assert_lint('int *b;', @@ -3059,7 +3068,7 @@ class WebKitStyleTest(CppStyleTestBase): '') self.assert_multi_line_lint( '#define TEST_ASSERT(expression) do { if ( !(expression)) { TestsController::shared().testFailed(__FILE__, __LINE__, #expression); return; } } while (0)\n', - 'Mismatching spaces inside () in if [whitespace/parens] [5]') + 'Extra space after ( in if [whitespace/parens] [5]') # FIXME: currently we only check first conditional, so we cannot detect errors in next ones. # self.assert_multi_line_lint( # '#define TEST_ASSERT(expression) do { if (!(expression)) { TestsController::shared().testFailed(__FILE__, __LINE__, #expression); return; } } while (0 )\n', diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/irc_command.py b/WebKitTools/Scripts/webkitpy/tool/bot/irc_command.py index ee8c669..a848472 100644 --- a/WebKitTools/Scripts/webkitpy/tool/bot/irc_command.py +++ b/WebKitTools/Scripts/webkitpy/tool/bot/irc_command.py @@ -57,7 +57,7 @@ class Rollout(IRCCommand): if len(args) < 2: tool.irc().post("%s: Usage: SVN_REVISION REASON" % nick) return - svn_revision = args[0] + svn_revision = args[0].lstrip("r") rollout_reason = " ".join(args[1:]) tool.irc().post("Preparing rollout for r%s..." % svn_revision) try: diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py b/WebKitTools/Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py index 21bff12..08023bd 100644 --- a/WebKitTools/Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py +++ b/WebKitTools/Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py @@ -62,6 +62,10 @@ class SheriffIRCBotTest(unittest.TestCase): expected_stderr = "MOCK: irc.post: Preparing rollout for r21654...\nMOCK: irc.post: mock_nick: Created rollout: http://example.com/36936\n" OutputCapture().assert_outputs(self, run, args=["rollout 21654 This patch broke the world"], expected_stderr=expected_stderr) + def test_rollout_with_r_in_svn_revision(self): + expected_stderr = "MOCK: irc.post: Preparing rollout for r21654...\nMOCK: irc.post: mock_nick: Created rollout: http://example.com/36936\n" + OutputCapture().assert_outputs(self, run, args=["rollout r21654 This patch broke the world"], expected_stderr=expected_stderr) + def test_rollout_bananas(self): expected_stderr = "MOCK: irc.post: mock_nick: Usage: SVN_REVISION REASON\n" OutputCapture().assert_outputs(self, run, args=["rollout bananas"], expected_stderr=expected_stderr) diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/download.py b/WebKitTools/Scripts/webkitpy/tool/commands/download.py index a85b09a..17fb12c 100644 --- a/WebKitTools/Scripts/webkitpy/tool/commands/download.py +++ b/WebKitTools/Scripts/webkitpy/tool/commands/download.py @@ -98,6 +98,19 @@ If a bug id is provided, or one can be found in the ChangeLog land will update t } +class LandCowboy(AbstractSequencedCommand): + name = "land-cowboy" + help_text = "Prepares a ChangeLog and lands the current working directory diff." + steps = [ + steps.PrepareChangeLog, + steps.EditChangeLog, + steps.ConfirmDiff, + steps.Build, + steps.RunTests, + steps.Commit, + ] + + class AbstractPatchProcessingCommand(AbstractDeclarativeCommand): # Subclasses must implement the methods below. We don't declare them here # because we want to be able to implement them with mix-ins. diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queues.py b/WebKitTools/Scripts/webkitpy/tool/commands/queues.py index d14ac9e..5ff390c 100644 --- a/WebKitTools/Scripts/webkitpy/tool/commands/queues.py +++ b/WebKitTools/Scripts/webkitpy/tool/commands/queues.py @@ -184,12 +184,8 @@ class CommitQueue(AbstractPatchQueue, StepSequenceErrorHandler): patches = self._validate_patches_in_commit_queue() patches = sorted(patches, self._patch_cmp) self._update_work_items([patch.id() for patch in patches]) - builders_are_green = self._builders_are_green() - if not builders_are_green: - patches = filter(lambda patch: patch.is_rollout(), patches) if not patches: - queue_text = "queue" if builders_are_green else "rollout queue" - self._update_status("Empty %s" % queue_text) + self._update_status("Empty queue") return None # Only bother logging if we have patches in the queue. self.log_progress([patch.id() for patch in patches]) @@ -211,37 +207,18 @@ class CommitQueue(AbstractPatchQueue, StepSequenceErrorHandler): return False return True - def _builders_are_green(self): - red_builders_names = self.tool.buildbot.red_core_builders_names() - if red_builders_names: - red_builders_names = map(lambda name: "\"%s\"" % name, red_builders_names) # Add quotes around the names. - self._update_status("Builders [%s] are red. See http://build.webkit.org" % ", ".join(red_builders_names), None) - return False - return True - def should_proceed_with_work_item(self, patch): - if not patch.is_rollout(): - if not self._builders_are_green(): - return False patch_text = "rollout patch" if patch.is_rollout() else "patch" self._update_status("Landing %s" % patch_text, patch) return True def _land(self, patch, first_run=False): try: - # We need to check the builders, unless we're trying to land a - # rollout (in which case the builders are probably red.) - if not patch.is_rollout() and not self._builders_are_green(): - # We return true here because we want to return to the main - # QueueEngine loop as quickly as possible. - return True args = [ "land-attachment", "--force-clean", "--build", "--non-interactive", - # The master process is responsible for checking the status - # of the builders (see above call to _builders_are_green). "--ignore-builders", "--build-style=both", "--quiet", diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py index b32dfa8..f82eb19 100644 --- a/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py +++ b/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py @@ -137,16 +137,19 @@ MOCK: update_work_items: commit-queue [106, 197] tool.buildbot.light_tree_on_fire() expected_stderr = { "begin_work_queue" : "CAUTION: commit-queue will discard all local changes in \"%s\"\nRunning WebKit commit-queue.\n" % MockSCM.fake_checkout_root, - "should_proceed_with_work_item": "MOCK: update_status: commit-queue Builders [\"Builder2\"] are red. See http://build.webkit.org\n", + "should_proceed_with_work_item": "MOCK: update_status: commit-queue Landing patch\n", # FIXME: The commit-queue warns about bad committers twice. This is due to the fact that we access Attachment.reviewer() twice and it logs each time. "next_work_item" : """Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com) Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com) -MOCK setting flag \'commit-queue\' to \'-\' on attachment \'128\' with comment \'Rejecting patch 128 from commit-queue.\' and additional comment \'non-committer@example.com does not have committer permissions according to http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy/common/config/committers.py.\n\n- If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.\n\n- If you have committer rights please correct the error in WebKitTools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed). Due to bug 30084 the commit-queue will require a restart after your change. Please contact eseidel@chromium.org to request a commit-queue restart. After restart the commit-queue will correctly respect your committer rights.\' +MOCK setting flag 'commit-queue' to '-' on attachment '128' with comment 'Rejecting patch 128 from commit-queue.' and additional comment 'non-committer@example.com does not have committer permissions according to http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy/common/config/committers.py. + +- If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags. + +- If you have committer rights please correct the error in WebKitTools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed). Due to bug 30084 the commit-queue will require a restart after your change. Please contact eseidel@chromium.org to request a commit-queue restart. After restart the commit-queue will correctly respect your committer rights.' MOCK: update_work_items: commit-queue [106, 197] -MOCK: update_status: commit-queue Builders ["Builder2"] are red. See http://build.webkit.org -1 patch in commit-queue [106] +2 patches in commit-queue [106, 197] """, - "process_work_item" : "MOCK: update_status: commit-queue Builders [\"Builder2\"] are red. See http://build.webkit.org\n", + "process_work_item" : "MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'land-attachment', '--force-clean', '--build', '--non-interactive', '--ignore-builders', '--build-style=both', '--quiet', 1234, '--test']\nMOCK: update_status: commit-queue Pass\n", "handle_unexpected_error" : "MOCK setting flag 'commit-queue' to '-' on attachment '1234' with comment 'Rejecting patch 1234 from commit-queue.' and additional comment 'Mock error message'\n", "handle_script_error": "MOCK: update_status: commit-queue ScriptError error message\nMOCK setting flag 'commit-queue' to '-' on attachment '1234' with comment 'Rejecting patch 1234 from commit-queue.' and additional comment 'ScriptError error message'\n", } @@ -162,10 +165,13 @@ MOCK: update_status: commit-queue Builders ["Builder2"] are red. See http://buil # FIXME: The commit-queue warns about bad committers twice. This is due to the fact that we access Attachment.reviewer() twice and it logs each time. "next_work_item": """Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com) Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com) -MOCK setting flag \'commit-queue\' to \'-\' on attachment \'128\' with comment \'Rejecting patch 128 from commit-queue.\' and additional comment \'non-committer@example.com does not have committer permissions according to http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy/common/config/committers.py.\n\n- If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.\n\n- If you have committer rights please correct the error in WebKitTools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed). Due to bug 30084 the commit-queue will require a restart after your change. Please contact eseidel@chromium.org to request a commit-queue restart. After restart the commit-queue will correctly respect your committer rights.\' +MOCK setting flag 'commit-queue' to '-' on attachment '128' with comment 'Rejecting patch 128 from commit-queue.' and additional comment 'non-committer@example.com does not have committer permissions according to http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy/common/config/committers.py. + +- If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags. + +- If you have committer rights please correct the error in WebKitTools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed). Due to bug 30084 the commit-queue will require a restart after your change. Please contact eseidel@chromium.org to request a commit-queue restart. After restart the commit-queue will correctly respect your committer rights.' MOCK: update_work_items: commit-queue [106, 197] -MOCK: update_status: commit-queue Builders ["Builder2"] are red. See http://build.webkit.org -1 patch in commit-queue [106] +2 patches in commit-queue [106, 197] """, "process_work_item": "MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'land-attachment', '--force-clean', '--build', '--non-interactive', '--ignore-builders', '--build-style=both', '--quiet', 76543]\nMOCK: update_status: commit-queue Pass\n", "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '76543' with comment 'Rejecting patch 76543 from commit-queue.' and additional comment 'Mock error message'\n", diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelog.py b/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelog.py index 59048a3..7f0c1a8 100644 --- a/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelog.py +++ b/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelog.py @@ -65,7 +65,7 @@ class PrepareChangeLog(AbstractStep): return os.chdir(self._tool.scm().checkout_root) args = [self.port().script_path("prepare-ChangeLog")] - if state["bug_id"]: + if state.get("bug_id"): args.append("--bug=%s" % state["bug_id"]) if self._options.email: args.append("--email=%s" % self._options.email) diff --git a/WebKitTools/WebKitTestRunner/Configurations/Base.xcconfig b/WebKitTools/WebKitTestRunner/Configurations/Base.xcconfig new file mode 100644 index 0000000..af3f4e6 --- /dev/null +++ b/WebKitTools/WebKitTestRunner/Configurations/Base.xcconfig @@ -0,0 +1,68 @@ +// Copyright (C) 2010 Apple 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: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE INC. 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. + +HEADER_SEARCH_PATHS = ForwardingHeaders; +FRAMEWORK_SEARCH_PATHS = $(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework/Frameworks; +GCC_PREPROCESSOR_DEFINITIONS = ENABLE_DASHBOARD_SUPPORT WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST; +DEBUG_INFORMATION_FORMAT = dwarf +PREBINDING = NO +GCC_C_LANGUAGE_STANDARD = gnu99 +GCC_PRECOMPILE_PREFIX_HEADER = YES +GCC_TREAT_WARNINGS_AS_ERRORS = YES +GCC_WARN_UNUSED_FUNCTION = YES +GCC_WARN_UNUSED_VARIABLE = YES +GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO +WARNING_CFLAGS = -Wall -W -Wno-unused-parameter +LINKER_DISPLAYS_MANGLED_NAMES = YES; + + +TARGET_MAC_OS_X_VERSION_MAJOR = $(MAC_OS_X_VERSION_MAJOR); + + +// Use GCC 4.2 with Xcode 3.1, which includes GCC 4.2 but defaults to GCC 4.0. +// Note that Xcode versions as new as 3.1.2 use XCODE_VERSION_ACTUAL for the minor version +// number. Newer versions of Xcode use XCODE_VERSION_MINOR for the minor version, and +// XCODE_VERSION_ACTUAL for the full version number. +TARGET_GCC_VERSION = $(TARGET_GCC_VERSION_$(TARGET_MAC_OS_X_VERSION_MAJOR)); +TARGET_GCC_VERSION_ = $(TARGET_GCC_VERSION_1040); +TARGET_GCC_VERSION_1040 = GCC_40; +TARGET_GCC_VERSION_1050 = $(TARGET_GCC_VERSION_1050_$(XCODE_VERSION_MINOR)); +TARGET_GCC_VERSION_1050_ = $(TARGET_GCC_VERSION_1050_$(XCODE_VERSION_ACTUAL)); +TARGET_GCC_VERSION_1050_0310 = GCC_42; +TARGET_GCC_VERSION_1050_0320 = GCC_42; +TARGET_GCC_VERSION_1060 = GCC_42; +TARGET_GCC_VERSION_1070 = LLVM_GCC_42; + +GCC_VERSION = $(GCC_VERSION_$(TARGET_GCC_VERSION)); +GCC_VERSION_GCC_40 = 4.0; +GCC_VERSION_GCC_42 = 4.2; +GCC_VERSION_LLVM_GCC_42 = com.apple.compilers.llvmgcc42; + +// If the target Mac OS X version does not match the current Mac OS X version then we'll want to build using the target version's SDK. +SDKROOT = $(SDKROOT_$(MAC_OS_X_VERSION_MAJOR)_$(TARGET_MAC_OS_X_VERSION_MAJOR)); +SDKROOT_1050_1040 = macosx10.4; +SDKROOT_1060_1040 = macosx10.4; +SDKROOT_1060_1050 = macosx10.5; +SDKROOT_1070_1040 = macosx10.4; +SDKROOT_1070_1050 = macosx10.5; +SDKROOT_1070_1060 = macosx10.6; diff --git a/WebKitTools/WebKitTestRunner/Configurations/DebugRelease.xcconfig b/WebKitTools/WebKitTestRunner/Configurations/DebugRelease.xcconfig new file mode 100644 index 0000000..8b156e8 --- /dev/null +++ b/WebKitTools/WebKitTestRunner/Configurations/DebugRelease.xcconfig @@ -0,0 +1,40 @@ +// Copyright (C) 2010 Apple 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: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE INC. 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 "Base.xcconfig" + +ARCHS = $(ARCHS_$(TARGET_MAC_OS_X_VERSION_MAJOR)); +ARCHS_ = $(ARCHS_1040); +ARCHS_1040 = $(NATIVE_ARCH); +ARCHS_1050 = $(NATIVE_ARCH); +ARCHS_1060 = $(ARCHS_STANDARD_32_64_BIT); +ARCHS_1070 = $(ARCHS_STANDARD_32_64_BIT); + +ONLY_ACTIVE_ARCH = YES; + +MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(TARGET_MAC_OS_X_VERSION_MAJOR)) +MACOSX_DEPLOYMENT_TARGET_ = 10.4; +MACOSX_DEPLOYMENT_TARGET_1040 = 10.4; +MACOSX_DEPLOYMENT_TARGET_1050 = 10.5; +MACOSX_DEPLOYMENT_TARGET_1060 = 10.6; +MACOSX_DEPLOYMENT_TARGET_1070 = 10.7; diff --git a/WebKitTools/WebKitTestRunner/Configurations/InjectedBundle.xcconfig b/WebKitTools/WebKitTestRunner/Configurations/InjectedBundle.xcconfig new file mode 100644 index 0000000..4d3d1ee --- /dev/null +++ b/WebKitTools/WebKitTestRunner/Configurations/InjectedBundle.xcconfig @@ -0,0 +1,24 @@ +// Copyright (C) 2010 Apple 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: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE INC. 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. + +PRODUCT_NAME = InjectedBundle diff --git a/WebKitTools/WebKitTestRunner/Configurations/WebKitTestRunner.xcconfig b/WebKitTools/WebKitTestRunner/Configurations/WebKitTestRunner.xcconfig new file mode 100644 index 0000000..e90edba --- /dev/null +++ b/WebKitTools/WebKitTestRunner/Configurations/WebKitTestRunner.xcconfig @@ -0,0 +1,26 @@ +// Copyright (C) 2010 Apple 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: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE INC. 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. + +PRODUCT_NAME = WebKitTestRunner +GCC_ENABLE_OBJC_EXCEPTIONS = YES +GCC_PREFIX_HEADER = WebKitTestRunnerPrefix.h diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle-Info.plist b/WebKitTools/WebKitTestRunner/InjectedBundle-Info.plist new file mode 100644 index 0000000..a21fbde --- /dev/null +++ b/WebKitTools/WebKitTestRunner/InjectedBundle-Info.plist @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>English</string> + <key>CFBundleExecutable</key> + <string>${EXECUTABLE_NAME}</string> + <key>CFBundleIdentifier</key> + <string>com.apple.WebKitTestRunner.InjectedBundle</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundlePackageType</key> + <string>BNDL</string> + <key>CFBundleShortVersionString</key> + <string>1.0</string> + <key>CFBundleSignature</key> + <string>????</string> + <key>CFBundleVersion</key> + <string>1</string> +</dict> +</plist> diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundleMain.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundleMain.cpp new file mode 100644 index 0000000..f108548 --- /dev/null +++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundleMain.cpp @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2010 Apple 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: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 <WebKit2/WKBundle.h> +#include <WebKit2/WKBundleInitialize.h> +#include <WebKit2/WKBundlePage.h> +#include <WebKit2/WebKit2.h> + +static WKBundleRef globalBundle; + +// WKBundlePageClient + +void _didStartProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo) +{ +} + +void _didReceiveServerRedirectForProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo) +{ +} + +void _didFailProvisionalLoadWithErrorForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo) +{ +} + +void _didCommitLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo) +{ +} + +void _didFinishLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo) +{ +} + +void _didFailLoadWithErrorForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo) +{ +} + +void _didReceiveTitleForFrame(WKBundlePageRef page, WKStringRef title, WKBundleFrameRef frame, const void *clientInfo) +{ +} + +void _didClearWindow(WKBundlePageRef page, WKBundleFrameRef frame, JSContextRef ctx, JSObjectRef window, const void *clientInfo) +{ +} + +// WKBundleClient + +void _didCreatePage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo) +{ + WKBundlePageClient client = { + 0, + 0, + _didStartProvisionalLoadForFrame, + _didReceiveServerRedirectForProvisionalLoadForFrame, + _didFailProvisionalLoadWithErrorForFrame, + _didCommitLoadForFrame, + _didFinishLoadForFrame, + _didFailLoadWithErrorForFrame, + _didReceiveTitleForFrame, + _didClearWindow + }; + WKBundlePageSetClient(page, &client); +} + +void _willDestroyPage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo) +{ +} + +void _didRecieveMessage(WKBundleRef bundle, WKStringRef message, const void *clientInfo) +{ +} + +extern "C" void WKBundleInitialize(WKBundleRef bundle) +{ + globalBundle = bundle; + + WKBundleClient client = { + 0, + 0, + _didCreatePage, + _willDestroyPage, + _didRecieveMessage + }; + WKBundleSetClient(bundle, &client); +} diff --git a/WebKitTools/WebKitTestRunner/Makefile b/WebKitTools/WebKitTestRunner/Makefile new file mode 100644 index 0000000..4648f98 --- /dev/null +++ b/WebKitTools/WebKitTestRunner/Makefile @@ -0,0 +1,21 @@ +# Build WebKitTestRunner only on Snow Leopard and later. + +OSX_VERSION ?= $(shell sw_vers -productVersion | cut -d. -f 2) +BUILD_WEBKITTESTRUNNER = $(shell (( $(OSX_VERSION) >= 6 )) && echo "YES" ) + +ifeq "$(BUILD_WEBKITTESTRUNNER)" "YES" + +SCRIPTS_PATH = ../Scripts +include ../../Makefile.shared + +else + +all: ; + +debug d development dev develop: ; + +release r deployment dep deploy: ; + +clean: ; + +endif diff --git a/WebKitTools/WebKitTestRunner/PlatformWebView.h b/WebKitTools/WebKitTestRunner/PlatformWebView.h new file mode 100644 index 0000000..5506f33 --- /dev/null +++ b/WebKitTools/WebKitTestRunner/PlatformWebView.h @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2010 Apple 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: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 PlatformWebView_h +#define PlatformWebView_h + +#if __APPLE__ +#if __OBJC__ +@class WKView; +@class NSWindow; +#else +class WKView; +class NSWindow; +#endif +typedef WKView* PlatformWKView; +typedef NSWindow* PlatformWindow; +#elif defined(WIN32) || defined(_WIN32) +typedef WKViewRef PlatformWKView; +typedef HWND PlatformWindow; +#endif + +namespace WTR { + +class PlatformWebView { +public: + PlatformWebView(WKPageNamespaceRef); + ~PlatformWebView(); + + WKPageRef page(); + PlatformWKView platformView() { return m_view; } + +private: + PlatformWKView m_view; + PlatformWindow m_window; +}; + +} // namespace WTR + +#endif // PlatformWebView_h diff --git a/WebKitTools/WebKitTestRunner/TestController.cpp b/WebKitTools/WebKitTestRunner/TestController.cpp new file mode 100644 index 0000000..5355862 --- /dev/null +++ b/WebKitTools/WebKitTestRunner/TestController.cpp @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2010 Apple 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: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 "TestController.h" + +#include "TestInvocation.h" +#include <getopt.h> + +namespace WTR { + +TestController& TestController::shared() +{ + static TestController& shared = *new TestController; + return shared; +} + +TestController::TestController() + : m_dumpTree(false) + , m_dumpPixels(false) + , m_threaded(false) + , m_forceComplexText(false) + , m_verbose(false) + , m_printSeparators(false) + , m_usingServerMode(false) +{ +} + +void TestController::initialize(int argc, const char *argv[]) +{ + int dumpTree = 0; + int dumpPixels = 0; + int threaded = 0; + int forceComplexText = 0; + int useHTML5Parser = 0; + int verbose = 0; + + struct option options[] = { + {"notree", no_argument, &dumpTree, false}, + {"pixel-tests", no_argument, &dumpPixels, true}, + {"tree", no_argument, &dumpTree, true}, + {"threaded", no_argument, &threaded, true}, + {"complex-text", no_argument, &forceComplexText, true}, + {"legacy-parser", no_argument, &useHTML5Parser, false}, + {"verbose", no_argument, &verbose, true}, + {0, 0, 0, 0} + }; + + int option; + while ((option = getopt_long(argc, (char * const *)argv, "", options, 0)) != -1) { + switch (option) { + case '?': // unknown or ambiguous option + case ':': // missing argument + exit(1); + break; + } + } + + m_dumpTree = dumpTree; + m_dumpPixels = dumpPixels; + m_threaded = threaded; + m_forceComplexText = forceComplexText; + m_verbose = verbose; + + m_usingServerMode = (argc == optind + 1 && strcmp(argv[optind], "-") == 0); + if (m_usingServerMode) + m_printSeparators = true; + else { + m_printSeparators = (optind < argc - 1 || (m_dumpPixels && m_dumpTree)); + for (int i = optind; i != argc; ++i) + m_paths.push_back(std::string(argv[i])); + } + + initializeInjectedBundlePath(); +} + +void TestController::runTest(const char* test) +{ + TestInvocation invocation(test); + invocation.invoke(); +} + +void TestController::runTestingServerLoop() +{ + char filenameBuffer[2048]; + while (fgets(filenameBuffer, sizeof(filenameBuffer), stdin)) { + char *newLineCharacter = strchr(filenameBuffer, '\n'); + if (newLineCharacter) + *newLineCharacter = '\0'; + + if (strlen(filenameBuffer) == 0) + continue; + + runTest(filenameBuffer); + } +} + +bool TestController::run() +{ + if (m_usingServerMode) + runTestingServerLoop(); + else { + for (size_t i = 0; i < m_paths.size(); ++i) + runTest(m_paths[i].c_str()); + } + + return true; +} + +} // namespace WTR + diff --git a/WebKitTools/WebKitTestRunner/TestController.h b/WebKitTools/WebKitTestRunner/TestController.h new file mode 100644 index 0000000..86eaa7c --- /dev/null +++ b/WebKitTools/WebKitTestRunner/TestController.h @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2010 Apple 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: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 TestController_h +#define TestController_h + +#include <WebKit2/WKRetainPtr.h> +#include <string> +#include <vector> + +namespace WTR { + +class TestController { +public: + static TestController& shared(); + + // Initialize the TestController. + void initialize(int argc, const char *argv[]); + + // Returns true if all the tests passed, false otherwise. + bool run(); + + bool verbose() const { return m_verbose; } + + WKStringRef injectedBundlePath() { return m_injectedBundlePath.get(); } + +private: + TestController(); + ~TestController(); + + void runTestingServerLoop(); + void runTest(const char* pathOrURL); + + void initializeInjectedBundlePath(); + + bool m_dumpTree; + bool m_dumpPixels; + bool m_threaded; + bool m_forceComplexText; + bool m_verbose; + bool m_printSeparators; + bool m_usingServerMode; + std::vector<std::string> m_paths; + WKRetainPtr<WKStringRef> m_injectedBundlePath; +}; + +} // namespace WTR + +#endif // TestController_h diff --git a/WebKitTools/WebKitTestRunner/TestInvocation.cpp b/WebKitTools/WebKitTestRunner/TestInvocation.cpp new file mode 100644 index 0000000..80efd62 --- /dev/null +++ b/WebKitTools/WebKitTestRunner/TestInvocation.cpp @@ -0,0 +1,170 @@ +/* + * Copyright (C) 2010 Apple 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: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 "TestInvocation.h" + +#include "TestController.h" +#include <JavaScriptCore/RetainPtr.h> +#include <WebKit2/WKContextPrivate.h> +#include <WebKit2/WKPagePrivate.h> +#include <WebKit2/WKRetainPtr.h> +#include <WebKit2/WKStringCF.h> +#include <WebKit2/WKURLCF.h> + +using namespace WebKit; + +namespace WTR { + +static WKURLRef createWKURL(const char* pathOrURL) +{ + RetainPtr<CFStringRef> pathOrURLCFString(AdoptCF, CFStringCreateWithCString(0, pathOrURL, kCFStringEncodingUTF8)); + RetainPtr<CFURLRef> cfURL; + if (CFStringHasPrefix(pathOrURLCFString.get(), CFSTR("http://")) || CFStringHasPrefix(pathOrURLCFString.get(), CFSTR("https://"))) + cfURL.adoptCF(CFURLCreateWithString(0, pathOrURLCFString.get(), 0)); + else + cfURL.adoptCF(CFURLCreateWithFileSystemPath(0, pathOrURLCFString.get(), kCFURLPOSIXPathStyle, false)); + return WKURLCreateWithCFURL(cfURL.get()); +} + +TestInvocation::TestInvocation(const char* pathOrURL) + : m_url(AdoptWK, createWKURL(pathOrURL)) + , m_mainWebView(0) + , m_loadDone(false) + , m_renderTreeFetchDone(false) + , m_failed(false) +{ +} + +TestInvocation::~TestInvocation() +{ + delete m_mainWebView; + m_mainWebView = 0; +} + +void TestInvocation::invoke() +{ + initializeMainWebView(); + + WKPageLoadURL(m_mainWebView->page(), m_url.get()); + runUntil(m_loadDone); + + if (m_failed) + return; + + WKPageRenderTreeExternalRepresentation(m_mainWebView->page(), this, renderTreeExternalRepresentationFunction, renderTreeExternalRepresentationDisposeFunction); + runUntil(m_renderTreeFetchDone); +} + +void TestInvocation::dump(const char* stringToDump) +{ + printf("Content-Type: text/plain\n"); + printf("%s", stringToDump); + printf("#EOF\n"); +} + +void TestInvocation::initializeMainWebView() +{ + WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithInjectedBundlePath(TestController::shared().injectedBundlePath())); + WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get())); + m_mainWebView = new PlatformWebView(pageNamespace.get()); + + WKPageLoaderClient loaderClient = { + 0, + this, + didStartProvisionalLoadForFrame, + didReceiveServerRedirectForProvisionalLoadForFrame, + didFailProvisionalLoadWithErrorForFrame, + didCommitLoadForFrame, + didFinishLoadForFrame, + didFailLoadForFrame, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + }; + WKPageSetPageLoaderClient(m_mainWebView->page(), &loaderClient); +} + +void TestInvocation::didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, const void* clientInfo) +{ +} + +void TestInvocation::didReceiveServerRedirectForProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, const void* clientInfo) +{ +} + +void TestInvocation::didFailProvisionalLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, const void* clientInfo) +{ + TestInvocation* self = reinterpret_cast<TestInvocation*>(const_cast<void*>(clientInfo)); + self->m_loadDone = true; + self->m_failed = true; +} + +void TestInvocation::didCommitLoadForFrame(WKPageRef page, WKFrameRef frame, const void* clientInfo) +{ +} + +void TestInvocation::didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, const void* clientInfo) +{ + TestInvocation* self = reinterpret_cast<TestInvocation*>(const_cast<void*>(clientInfo)); + self->m_loadDone = true; +} + +void TestInvocation::didFailLoadForFrame(WKPageRef page, WKFrameRef frame, const void* clientInfo) +{ + TestInvocation* self = reinterpret_cast<TestInvocation*>(const_cast<void*>(clientInfo)); + + self->m_loadDone = true; + self->m_failed = true; +} + +void TestInvocation::renderTreeExternalRepresentationFunction(WKStringRef wkResult, void* context) +{ + TestInvocation* self = reinterpret_cast<TestInvocation*>(context); + + RetainPtr<CFStringRef> result(AdoptCF, WKStringCopyCFString(0, wkResult)); + CFIndex bufferLength = CFStringGetMaximumSizeForEncoding(CFStringGetLength(result.get()), kCFStringEncodingUTF8) + 1; + char* buffer = (char*)malloc(bufferLength); + CFStringGetCString(result.get(), buffer, bufferLength, kCFStringEncodingUTF8); + + self->dump(buffer); + free(buffer); + + self->m_renderTreeFetchDone = true; +} + +void TestInvocation::renderTreeExternalRepresentationDisposeFunction(void* context) +{ + TestInvocation* self = reinterpret_cast<TestInvocation*>(context); + + self->m_renderTreeFetchDone = true; + self->m_failed = true; +} + +} // namespace WTR diff --git a/WebKitTools/WebKitTestRunner/TestInvocation.h b/WebKitTools/WebKitTestRunner/TestInvocation.h new file mode 100644 index 0000000..4552203 --- /dev/null +++ b/WebKitTools/WebKitTestRunner/TestInvocation.h @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2010 Apple 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: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 TestInvocation_h +#define TestInvocation_h + +#include "PlatformWebView.h" +#include <WebKit2/WKRetainPtr.h> +#include <JavaScriptCore/Noncopyable.h> + +namespace WTR { + +class TestInvocation : Noncopyable { +public: + TestInvocation(const char*); + ~TestInvocation(); + + void invoke(); + +private: + void initializeMainWebView(); + void dump(const char*); + + // Helper + static void runUntil(bool& done); + + // PageLoaderClient + static void didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef, const void*); + static void didReceiveServerRedirectForProvisionalLoadForFrame(WKPageRef, WKFrameRef, const void*); + static void didFailProvisionalLoadWithErrorForFrame(WKPageRef, WKFrameRef, const void*); + static void didCommitLoadForFrame(WKPageRef, WKFrameRef, const void*); + static void didFinishLoadForFrame(WKPageRef, WKFrameRef, const void*); + static void didFailLoadForFrame(WKPageRef, WKFrameRef, const void*); + + // RenderTreeExternalRepresentation callbacks + static void renderTreeExternalRepresentationFunction(WKStringRef, void*); + static void renderTreeExternalRepresentationDisposeFunction(void*); + + WKStringRef injectedBundlePath(); + + WKRetainPtr<WKURLRef> m_url; + PlatformWebView* m_mainWebView; + + // Invocation state + bool m_loadDone; + bool m_renderTreeFetchDone; + bool m_failed; +}; + +} // namespace WTR + +#endif // TestInvocation_h diff --git a/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj b/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..bef50b5 --- /dev/null +++ b/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj @@ -0,0 +1,355 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 45; + objects = { + +/* Begin PBXBuildFile section */ + BC25193E11D15D8B002EBC01 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC7934A411906584005EA8E2 /* Cocoa.framework */; }; + BC25193F11D15D8B002EBC01 /* WebKit2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC7934AB1190658C005EA8E2 /* WebKit2.framework */; }; + BC25194011D15D8B002EBC01 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCDA2B991191051F00C3BC47 /* JavaScriptCore.framework */; }; + BC251A3E11D16831002EBC01 /* InjectedBundleMain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC25184611D15767002EBC01 /* InjectedBundleMain.cpp */; }; + BC793400118F7C84005EA8E2 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC7933FF118F7C84005EA8E2 /* main.mm */; }; + BC793431118F7F19005EA8E2 /* TestController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC793430118F7F19005EA8E2 /* TestController.cpp */; }; + BC7934A511906584005EA8E2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC7934A411906584005EA8E2 /* Cocoa.framework */; }; + BC7934AC1190658C005EA8E2 /* WebKit2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC7934AB1190658C005EA8E2 /* WebKit2.framework */; }; + BC7934E811906846005EA8E2 /* PlatformWebViewMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC7934E711906846005EA8E2 /* PlatformWebViewMac.mm */; }; + BC8C795C11D2785D004535A1 /* TestControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC8C795B11D2785D004535A1 /* TestControllerMac.mm */; }; + BCD7D2F811921278006DB7EE /* TestInvocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD7D2F711921278006DB7EE /* TestInvocation.cpp */; }; + BCDA2ABF1190B51A00C3BC47 /* TestInvocationMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCDA2ABE1190B51A00C3BC47 /* TestInvocationMac.mm */; }; + BCDA2B9A1191051F00C3BC47 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCDA2B991191051F00C3BC47 /* JavaScriptCore.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + BC25194111D15D94002EBC01 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = BC25186111D15D54002EBC01; + remoteInfo = InjectedBundle; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 8DD76F9E0486AA7600D96B5E /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 8; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + ); + runOnlyForDeploymentPostprocessing = 1; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 8DD76FA10486AA7600D96B5E /* WebKitTestRunner */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = WebKitTestRunner; sourceTree = BUILT_PRODUCTS_DIR; }; + BC25184611D15767002EBC01 /* InjectedBundleMain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleMain.cpp; sourceTree = "<group>"; }; + BC25186211D15D54002EBC01 /* InjectedBundle.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = InjectedBundle.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; + BC25186311D15D54002EBC01 /* InjectedBundle-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "InjectedBundle-Info.plist"; sourceTree = "<group>"; }; + BC25197111D15E61002EBC01 /* InjectedBundle.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = InjectedBundle.xcconfig; sourceTree = "<group>"; }; + BC251A1711D16774002EBC01 /* WebKitTestRunnerPrefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitTestRunnerPrefix.h; sourceTree = "<group>"; }; + BC251A1811D16795002EBC01 /* WebKitTestRunner.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = WebKitTestRunner.xcconfig; sourceTree = "<group>"; }; + BC7933FF118F7C84005EA8E2 /* main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; }; + BC793426118F7D3C005EA8E2 /* Base.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = "<group>"; }; + BC793427118F7DAF005EA8E2 /* DebugRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = "<group>"; }; + BC79342F118F7F19005EA8E2 /* TestController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestController.h; sourceTree = "<group>"; }; + BC793430118F7F19005EA8E2 /* TestController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestController.cpp; sourceTree = "<group>"; }; + BC7934A411906584005EA8E2 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; + BC7934AB1190658C005EA8E2 /* WebKit2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebKit2.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + BC7934DD119066EC005EA8E2 /* PlatformWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformWebView.h; sourceTree = "<group>"; }; + BC7934E711906846005EA8E2 /* PlatformWebViewMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformWebViewMac.mm; sourceTree = "<group>"; }; + BC8C795B11D2785D004535A1 /* TestControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TestControllerMac.mm; sourceTree = "<group>"; }; + BCD7D2F611921278006DB7EE /* TestInvocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestInvocation.h; sourceTree = "<group>"; }; + BCD7D2F711921278006DB7EE /* TestInvocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestInvocation.cpp; sourceTree = "<group>"; }; + BCDA2ABE1190B51A00C3BC47 /* TestInvocationMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TestInvocationMac.mm; sourceTree = "<group>"; }; + BCDA2B991191051F00C3BC47 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8DD76F9B0486AA7600D96B5E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + BC7934A511906584005EA8E2 /* Cocoa.framework in Frameworks */, + BC7934AC1190658C005EA8E2 /* WebKit2.framework in Frameworks */, + BCDA2B9A1191051F00C3BC47 /* JavaScriptCore.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + BC25186011D15D54002EBC01 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + BC25193E11D15D8B002EBC01 /* Cocoa.framework in Frameworks */, + BC25193F11D15D8B002EBC01 /* WebKit2.framework in Frameworks */, + BC25194011D15D8B002EBC01 /* JavaScriptCore.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 08FB7794FE84155DC02AAC07 /* WebKitTestRunner */ = { + isa = PBXGroup; + children = ( + 08FB7795FE84155DC02AAC07 /* Source */, + BC25183511D1571D002EBC01 /* InjectedBundle */, + BC793401118F7C8A005EA8E2 /* Configurations */, + 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */, + BC25194411D15DBE002EBC01 /* Resources */, + 1AB674ADFE9D54B511CA2CBB /* Products */, + ); + name = WebKitTestRunner; + sourceTree = "<group>"; + }; + 08FB7795FE84155DC02AAC07 /* Source */ = { + isa = PBXGroup; + children = ( + BC7933FE118F7C74005EA8E2 /* mac */, + BC251A1711D16774002EBC01 /* WebKitTestRunnerPrefix.h */, + BC7934DD119066EC005EA8E2 /* PlatformWebView.h */, + BC79342F118F7F19005EA8E2 /* TestController.h */, + BC793430118F7F19005EA8E2 /* TestController.cpp */, + BCD7D2F611921278006DB7EE /* TestInvocation.h */, + BCD7D2F711921278006DB7EE /* TestInvocation.cpp */, + ); + name = Source; + sourceTree = "<group>"; + }; + 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */ = { + isa = PBXGroup; + children = ( + BC7934A411906584005EA8E2 /* Cocoa.framework */, + BC7934AB1190658C005EA8E2 /* WebKit2.framework */, + BCDA2B991191051F00C3BC47 /* JavaScriptCore.framework */, + ); + name = "External Frameworks and Libraries"; + sourceTree = "<group>"; + }; + 1AB674ADFE9D54B511CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8DD76FA10486AA7600D96B5E /* WebKitTestRunner */, + BC25186211D15D54002EBC01 /* InjectedBundle.bundle */, + ); + name = Products; + sourceTree = "<group>"; + }; + BC25183511D1571D002EBC01 /* InjectedBundle */ = { + isa = PBXGroup; + children = ( + BC25184611D15767002EBC01 /* InjectedBundleMain.cpp */, + ); + path = InjectedBundle; + sourceTree = "<group>"; + }; + BC25194411D15DBE002EBC01 /* Resources */ = { + isa = PBXGroup; + children = ( + BC25186311D15D54002EBC01 /* InjectedBundle-Info.plist */, + ); + name = Resources; + sourceTree = "<group>"; + }; + BC7933FE118F7C74005EA8E2 /* mac */ = { + isa = PBXGroup; + children = ( + BC7933FF118F7C84005EA8E2 /* main.mm */, + BC7934E711906846005EA8E2 /* PlatformWebViewMac.mm */, + BCDA2ABE1190B51A00C3BC47 /* TestInvocationMac.mm */, + BC8C795B11D2785D004535A1 /* TestControllerMac.mm */, + ); + path = mac; + sourceTree = "<group>"; + }; + BC793401118F7C8A005EA8E2 /* Configurations */ = { + isa = PBXGroup; + children = ( + BC793426118F7D3C005EA8E2 /* Base.xcconfig */, + BC793427118F7DAF005EA8E2 /* DebugRelease.xcconfig */, + BC25197111D15E61002EBC01 /* InjectedBundle.xcconfig */, + BC251A1811D16795002EBC01 /* WebKitTestRunner.xcconfig */, + ); + path = Configurations; + sourceTree = "<group>"; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8DD76F960486AA7600D96B5E /* WebKitTestRunner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1DEB927408733DD40010E9CD /* Build configuration list for PBXNativeTarget "WebKitTestRunner" */; + buildPhases = ( + 8DD76F990486AA7600D96B5E /* Sources */, + 8DD76F9B0486AA7600D96B5E /* Frameworks */, + 8DD76F9E0486AA7600D96B5E /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + BC25194211D15D94002EBC01 /* PBXTargetDependency */, + ); + name = WebKitTestRunner; + productInstallPath = "$(HOME)/bin"; + productName = WebKitTestRunner; + productReference = 8DD76FA10486AA7600D96B5E /* WebKitTestRunner */; + productType = "com.apple.product-type.tool"; + }; + BC25186111D15D54002EBC01 /* InjectedBundle */ = { + isa = PBXNativeTarget; + buildConfigurationList = BC25186611D15D55002EBC01 /* Build configuration list for PBXNativeTarget "InjectedBundle" */; + buildPhases = ( + BC25185E11D15D54002EBC01 /* Resources */, + BC25185F11D15D54002EBC01 /* Sources */, + BC25186011D15D54002EBC01 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = InjectedBundle; + productName = InjectedBundle; + productReference = BC25186211D15D54002EBC01 /* InjectedBundle.bundle */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 08FB7793FE84155DC02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "WebKitTestRunner" */; + compatibilityVersion = "Xcode 3.1"; + hasScannedForEncodings = 1; + mainGroup = 08FB7794FE84155DC02AAC07 /* WebKitTestRunner */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8DD76F960486AA7600D96B5E /* WebKitTestRunner */, + BC25186111D15D54002EBC01 /* InjectedBundle */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + BC25185E11D15D54002EBC01 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8DD76F990486AA7600D96B5E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BC793400118F7C84005EA8E2 /* main.mm in Sources */, + BC793431118F7F19005EA8E2 /* TestController.cpp in Sources */, + BC7934E811906846005EA8E2 /* PlatformWebViewMac.mm in Sources */, + BCDA2ABF1190B51A00C3BC47 /* TestInvocationMac.mm in Sources */, + BCD7D2F811921278006DB7EE /* TestInvocation.cpp in Sources */, + BC8C795C11D2785D004535A1 /* TestControllerMac.mm in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + BC25185F11D15D54002EBC01 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BC251A3E11D16831002EBC01 /* InjectedBundleMain.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + BC25194211D15D94002EBC01 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = BC25186111D15D54002EBC01 /* InjectedBundle */; + targetProxy = BC25194111D15D94002EBC01 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 1DEB927508733DD40010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = BC251A1811D16795002EBC01 /* WebKitTestRunner.xcconfig */; + buildSettings = { + }; + name = Debug; + }; + 1DEB927608733DD40010E9CD /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = BC251A1811D16795002EBC01 /* WebKitTestRunner.xcconfig */; + buildSettings = { + }; + name = Release; + }; + 1DEB927908733DD40010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = BC793427118F7DAF005EA8E2 /* DebugRelease.xcconfig */; + buildSettings = { + GCC_OPTIMIZATION_LEVEL = 0; + }; + name = Debug; + }; + 1DEB927A08733DD40010E9CD /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = BC793427118F7DAF005EA8E2 /* DebugRelease.xcconfig */; + buildSettings = { + }; + name = Release; + }; + BC25186411D15D55002EBC01 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = BC25197111D15E61002EBC01 /* InjectedBundle.xcconfig */; + buildSettings = { + }; + name = Debug; + }; + BC25186511D15D55002EBC01 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = BC25197111D15E61002EBC01 /* InjectedBundle.xcconfig */; + buildSettings = { + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1DEB927408733DD40010E9CD /* Build configuration list for PBXNativeTarget "WebKitTestRunner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB927508733DD40010E9CD /* Debug */, + 1DEB927608733DD40010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "WebKitTestRunner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB927908733DD40010E9CD /* Debug */, + 1DEB927A08733DD40010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + BC25186611D15D55002EBC01 /* Build configuration list for PBXNativeTarget "InjectedBundle" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + BC25186411D15D55002EBC01 /* Debug */, + BC25186511D15D55002EBC01 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; +} diff --git a/WebKitTools/WebKitTestRunner/WebKitTestRunnerPrefix.h b/WebKitTools/WebKitTestRunner/WebKitTestRunnerPrefix.h new file mode 100644 index 0000000..e8c85a4 --- /dev/null +++ b/WebKitTools/WebKitTestRunner/WebKitTestRunnerPrefix.h @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2010 Apple 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: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + */ + +#ifdef __OBJC__ +#include <Cocoa/Cocoa.h> +#endif + +#include <WebKit2/WebKit2.h> diff --git a/WebKitTools/WebKitTestRunner/mac/PlatformWebViewMac.mm b/WebKitTools/WebKitTestRunner/mac/PlatformWebViewMac.mm new file mode 100644 index 0000000..1a8696d --- /dev/null +++ b/WebKitTools/WebKitTestRunner/mac/PlatformWebViewMac.mm @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2010 Apple 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: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 "PlatformWebView.h" + +namespace WTR { + +PlatformWebView::PlatformWebView(WKPageNamespaceRef namespaceRef) +{ + NSRect rect = NSMakeRect(0, 0, 800, 600); + m_view = [[WKView alloc] initWithFrame:rect pageNamespaceRef:namespaceRef]; + + NSRect windowRect = NSOffsetRect(rect, -10000, [[[NSScreen screens] objectAtIndex:0] frame].size.height - rect.size.height + 10000); + m_window = [[NSWindow alloc] initWithContentRect:windowRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]; + [m_window setColorSpace:[[NSScreen mainScreen] colorSpace]]; + [[m_window contentView] addSubview:m_view]; + [m_window orderBack:nil]; + [m_window setAutodisplay:NO]; +} + +PlatformWebView::~PlatformWebView() +{ + [m_window close]; + [m_window release]; + [m_view release]; +} + +WKPageRef PlatformWebView::page() +{ + return [m_view pageRef]; +} + +} // namespace WTR diff --git a/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm b/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm new file mode 100644 index 0000000..5957e0e --- /dev/null +++ b/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2010 Apple 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: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 "TestController.h" + +#include <WebKit2/WKStringCF.h> +#include <mach-o/dyld.h> + +namespace WTR { + +void TestController::initializeInjectedBundlePath() +{ + uint32_t pathLength = 0; + _NSGetExecutablePath(0, &pathLength); + char* path = (char*)malloc(pathLength); + _NSGetExecutablePath(path, &pathLength); + char* theRealPath = (char*)malloc(pathLength); + realpath(path, theRealPath); + + NSString *pwd = [[NSString stringWithUTF8String:theRealPath] stringByDeletingLastPathComponent]; + NSString *nsBundlePath = [pwd stringByAppendingPathComponent:@"InjectedBundle.bundle"]; + + free(path); + free(theRealPath); + + m_injectedBundlePath.adopt(WKStringCreateWithCFString((CFStringRef)nsBundlePath)); +} + +} // namespace WTR diff --git a/WebKitTools/WebKitTestRunner/mac/TestInvocationMac.mm b/WebKitTools/WebKitTestRunner/mac/TestInvocationMac.mm new file mode 100644 index 0000000..bd01029 --- /dev/null +++ b/WebKitTools/WebKitTestRunner/mac/TestInvocationMac.mm @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2010 Apple 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: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 "TestInvocation.h" + +namespace WTR { + +void TestInvocation::runUntil(bool& done) +{ + while (!done) + [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]; +} + +} // namespace WTR diff --git a/WebKitTools/WebKitTestRunner/mac/main.mm b/WebKitTools/WebKitTestRunner/mac/main.mm new file mode 100644 index 0000000..021c124 --- /dev/null +++ b/WebKitTools/WebKitTestRunner/mac/main.mm @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2010 Apple 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: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + */ + +#import "TestController.h" + +int main(int argc, const char* argv[]) +{ + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + [NSApplication sharedApplication]; + + WTR::TestController::shared().initialize(argc, argv); + WTR::TestController::shared().run(); + + [pool drain]; + + return 0; +} diff --git a/WebKitTools/wx/build/settings.py b/WebKitTools/wx/build/settings.py index fc77a4e..aa5ca18 100644 --- a/WebKitTools/wx/build/settings.py +++ b/WebKitTools/wx/build/settings.py @@ -175,7 +175,7 @@ if building_on_win32: create_hash_table = get_output('cygpath --unix "%s"' % create_hash_table) os.environ['CREATE_HASH_TABLE'] = create_hash_table -feature_defines = ['ENABLE_DATABASE', 'ENABLE_XSLT', 'ENABLE_JAVASCRIPT_DEBUGGER', 'ENABLE_SVG', 'ENABLE_SVG_USE', 'ENABLE_FILTERS', 'ENABLE_SVG_FONTS', 'ENABLE_SVG_ANIMATION', 'ENABLE_SVG_AS_IMAGE'] +feature_defines = ['ENABLE_DATABASE', 'ENABLE_XSLT', 'ENABLE_JAVASCRIPT_DEBUGGER', 'ENABLE_SVG', 'ENABLE_SVG_USE', 'ENABLE_FILTERS', 'ENABLE_SVG_FONTS', 'ENABLE_SVG_ANIMATION', 'ENABLE_SVG_AS_IMAGE', 'ENABLE_SVG_FOREIGN_OBJECT'] msvc_version = 'msvc2008' |